Repository navigation
Apply left factors once in structured triangular solves - #158
Open
DiadkoShmek wants to merge 1 commit into
Open
DiadkoShmek wants to merge 1 commit into
DiadkoShmek wants to merge 1 commit into
Conversation
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.
TriangularLinearOperator.solveforwardsleft_tensorinto delegated solves for repeated or non-dense representations, then multiplies by it again. A square left factor producesL @ L @ solve(A, R)instead ofL @ solve(A, R); a rectangular factor can raise a shape error. This also affects the quadratic-form case withL = R.mT.Let the delegated solve compute only
solve(A, R). Apply the wrapper's left factor once while a vector RHS still has its normalized one-column shape, then restore vector output shape.For a public triangular-plus-diagonal construction with
A = diag(4, 6),R = [[1], [3]], andL = [[2, 1], [0, 3]], the current result is[[3.5], [4.5]]; the corrected and exact result is[[1], [1.5]].Validation on PyTorch 2.14.1 CPU, float32/float64:
The checks cover added-diagonal SPD examples and supported repeated general triangles, shared RHS/vector forms and selected broadcasting. Additional RHS batch prefixes retain a paired pre-existing BatchRepeat limitation. The full repository suite, GPU and higher-order AD were not tested.
I directed this work and take responsibility for the contribution and its follow-up. AI assistance was used in producing the change.