Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and change
BAE's
LM.step()andSchur.step()override PyPose's implementation, so they do not inherit the fix in pypose/pypose#442. This companion change follows the request in pypose/pypose#442 (comment).A finite step can produce a NaN loss (
sqrtoutside its domain) or an infinite loss (expoverflow). The existing comparison accepts NaN and retains infinity when the rejection budget is exhausted. Subtracting a non-finite update also cannot restore the original parameters.Both optimizers now reject non-finite trial losses even at the retry limit and restore trainable parameters from an exact pre-trial snapshot. This applies to explicit and matrix-free normal equations. Strategy updates, damping, linear solvers, and finite-loss acceptance rules remain unchanged: a finite uphill trial is still accepted when the existing rejection budget is exhausted. The maximum number of attempts remains
reject + 1.The implementation is self-contained and does not require pypose/pypose#442 to merge first. Snapshot storage costs O(P) additional memory. Model buffers/forward side effects are outside rollback, and the starting loss/Jacobian must be valid.
Validation
RTX 4080 SUPER, Python 3.10.12, PyTorch 2.7.0+cu128, Warp 1.13.0+cu12; CUDA extensions built with CUDA 12.8 and
USE_CUDSS=0.pytest tests/test_lm_nonfinite.py tests/test_normal_operator.py -q: 37 passed, using either PyPose #442 or unmodified PyPose main9345958.afad40e, the same new test file gives 20 failures and 12 passing finite controls; with this patch all 32 pass.git diff --checkpasses.A broader
pytest tests -qattempt was interrupted after 191 seconds: 25 passed and 15 failed, including compile/Jacobian tests. The two compiled-indexed-residual and two unused-parameter-position failures were separately reproduced on unmodified BAEafad40e. The remaining broad-suite failures have not all been baseline-checked; this is not a claim of a clean full suite. No existing assertions, skips, or CI configuration were changed.