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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LinearAlgebra: improve type-inference in Symmetric/Hermitian matmul #54303
LinearAlgebra: improve type-inference in Symmetric/Hermitian matmul #54303
Changes from all commits
fda8c87
3073352
54a4038
108db04
a2dd315
5db39fb
7a8bb75
1e06a1e
cefa1b1
28d4fd8
b24cc1e
9e66d1a
541a76d
31692d5
311382b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is true, this should be a giant contribution to the reduction of compile times, right? If we land in this branch, then we don't need to compile symm and hemm, or in the other case syrk/herk/gemm_wrapper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some compile-time improvement indeed, although it's not dramatic.
Each execution is in a separate session in the following:
Descending into
generic_matmatmul!
using Cthulhu does seem to indicate that unused branches are eliminated, and e.g. in the first case, onlygemm_wrapper!
is being compiled, and in the second, onlyBLAS.symm!
is compiled.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
code_typed
for the first case (gemm
) is identical between this PR and nightly:I'm not certain why there's a compile-time improvement here. (perhaps noise?) In this case, the
all
is already being folded (despite the loop over the characters). I suspect the loop is being unrolled entirely, as the characters are allChar
s that are fully known at compile time.The second case (
symm
) is where the major improvement comes in:The
BLAS.symm!
branch that is being followed is "inlined" now. This is the case where the loop is not unrolled ordinarily, but using theall(map(..))
combination permits constant propagation.