Repository navigation
Increase the local buffer size in the AVX512 SGEMM fallback kernel used for LLVM on Windows - #6236
Merged
Conversation
…ed for LLVM on Windows The kernel copies 6 values of B per k into its stack buffer, so the 8 KiB Windows buffer only held K <= 341, while SGEMM_Q is up to 512 for SKYLAKEX and COOPERLAKE. Same problem as OpenMathLib#6232 in the DGEMM kernel.
Contributor
Author
Collaborator
|
Thanks, figures - not a fault of the original authors, but much later, seemingly innocuous changes to param.h trading GEMM_P for GEMM_Q to increase performance of the respective C kernel introduced at the same time. |
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.
Same problem as #6232, which #6234 fixed in the DGEMM kernel: the SGEMM twin has it too.
sgemm_kernel_16x4_skylakex.Scopies 6 values of B per k into a stack buffer that was 8 KiB on Windows, enough for K ≤ 341.SGEMM_Q is 448 for SKYLAKEX and up to 512 for COOPERLAKE, so longer K blocks overwrite the saved registers and the return address.
The kernel is only used for clang on Windows (#5756), so only those builds are affected: SGEMM, SSYRK and STRMM can crash on AVX512 machines.
The new SYRK utest in #6235 runs into it in the msys2 CLANG64 jobs.
The buffer now holds K up to 512 (
512*4*6bytes, the size other systems already used).Tested with msys2 CLANG64 and the CI flags on a GitHub Windows runner (Xeon 8370C, Cooperlake kernels), on develop with #6234: openblas_utest crashed in SSYRK before, all 147 tests pass after.