gemm: honor func_prefix for kernel object and symbols (enables fusion)#123
Open
atassis wants to merge 1 commit into
Open
gemm: honor func_prefix for kernel object and symbols (enables fusion)#123atassis wants to merge 1 commit into
atassis wants to merge 1 commit into
Conversation
jgmelber
approved these changes
Jun 22, 2026
Collaborator
|
Note the CI failures we're seeing should disappear after a rebase. :) |
GEMV, softmax, and binary_elementwise already apply func_prefix to both the kernel object filename and the kernel symbols, so FusedMLIROperator can place several of them in one design. GEMM only applied func_prefix to the fallback generated-object name, leaving the supplied kernel_object name and the zero_/ matmul_/convert_copy_ symbols unprefixed -- so fusing any GEMM via FusedMLIROperator failed with object-copy and undefined-symbol errors. Prefix the gemm/convert_copy object names and the zero_/matmul_/convert_copy symbols. No-op when func_prefix is empty (the non-fused default).
f713a91 to
b674afe
Compare
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.
GEMV, softmax, and binary_elementwise already apply
func_prefixto both the kernel object filename and the kernel symbols, soFusedMLIROperatorcan place several of them in one design. GEMM only appliedfunc_prefixto the fallback generated-object name, leaving the suppliedkernel_objectname and thezero_/matmul_/convert_copy_symbols unprefixed — so fusing any GEMM viaFusedMLIROperatorfailed with object-copy and undefined-symbol errors. (The in-treellama_3.2_1bexample builds aFusedMLIROperator.)Changed
my_matmulnow appliesfunc_prefixto the gemm andconvert_copyobject filenames and to thezero_/matmul_/convert_copy_kernel symbols.Added / Removed
No-op when
func_prefix=""(the non-fused default), so existing callers are byte-identical. Exercised in our own batched decode, which fuses GEMM viaFusedMLIROperator.