Repository navigation
Prevent cancelling updates from stopping FISTA early - #701
Open
DiadkoShmek wants to merge 2 commits into
Open
DiadkoShmek wants to merge 2 commits into
DiadkoShmek wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #701 +/- ##
==========================================
+ Coverage 92.81% 92.82% +0.01%
==========================================
Files 133 133
Lines 8863 8876 +13
==========================================
+ Hits 8226 8239 +13
Misses 637 637 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
FISTA can stop after two iterations on a positive, well-conditioned least-squares problem because
abs(sum(x - x_new))lets opposing coordinate updates cancel. With default tolerance, the example below returns(2.125, 3.125, 1.5)instead of(1, 3.5, 1.5), leaving a stationarity residual of about1.352.Use
sum(abs(x - x_new)), the documented L1 iterate-change criterion. This preserves the relative stopping rule and avoids squaring large updates. It applies to both matrix normal equations and tensor-core equations used by HALS Tucker decomposition.With the default NumPy backend:
The Gram matrix is positive definite with condition number 4; its minimizer is strictly positive, so the NNLS KKT condition here is simply
gram @ result == rhs. The second update has nonzero changes(0.375, -0.375, 0): their signed sum is zero while their L1 norm is0.75. The corrected call returns approximately(1, 3.5, 1.5)(residual9.7e-8in the NumPy CPU replay); the unchanged implementation also reaches it when early stopping is disabled withtol=0.CPU validation:
tol=0controls.Validation used source-bound CPU imports. The full backend/interpreter CI matrix, GPU, general AD/convergence guarantees and performance claims are outside this change's proof scope.
CI follow-up, 5 November 2026: made every tensor in the new regression use one explicit float64 context, including the auxiliary tensor-core factor. The data, tolerance, two regression cases and production correction are unchanged. The latest hosted matrix passes NumPy, PyTorch, Paddle, JAX and TensorFlow, plus Black and coverage checks. The Paddle job passes on the submitted head
58c84b8.The fixture also retains BASE mathematical failures and candidate passes in qualified NumPy/PyTorch/current Paddle 3.3.1 CPU checks. That extra local full Paddle 3.3.1 suite has eight tensor-ring sampling failures also reproduced on the unchanged previous submitted head; it is not a full-green result or an exact local replay of the hosted legacy environment.
I directed this work and take responsibility for the contribution and its follow-up. AI assistance was used in producing the change.