Fix dense LU cache prototypes for wrapper matrices#1076
Merged
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Summary
Fixes #1075.
Dense BLAS LU cache initialization was calling
ArrayInterface.lu_instance(similar(A, 0, 0)). That works for some dense wrappers, but it can drop wrapper identity beforelu_instancegets a chance to dispatch on the actual matrix type.For
ComponentMatrix, the problematic pattern is:So the backend cache slot was initialized for an
LUwithMatrixfactors, whilesolve!later stored anLUwithComponentMatrixfactors, causing thesetfield!TypeError.This PR changes the dense BLAS LU cache initializers to ask
lu_instanceaboutAdirectly:That preserves wrapper-specific dispatch for
ComponentMatrixand keeps the previousFixedSizeArraybehavior.AppleAccelerate still normalizes the pivot vector to
Cint, since that backend storesCintpivots.Tests
retcode: Success.test/Core/componentarrays.jl: 10/10test/Core/fixedsizearrays.jl: 47/47MatrixComponentMatrixFixedSizeArrayI also ran the Core group far enough to confirm:
Default Alg Tests: 89/89FixedSizeArrays: 47/47ComponentArrays: 10/10Adjoint Sensitivity: 22/22ForwardDiff Overloads: 119/119The longer Core run later stopped in an existing AppleAccelerate verbosity log-pattern test on this macOS setup. The captured log contained the expected singular-matrix message, but the log matcher failed; this appears unrelated to the LU cache prototype change.