Skip to content

gemm: honor func_prefix for kernel object and symbols (enables fusion)#123

Open
atassis wants to merge 1 commit into
amd:develfrom
atassis:iron-gemm-fusion
Open

gemm: honor func_prefix for kernel object and symbols (enables fusion)#123
atassis wants to merge 1 commit into
amd:develfrom
atassis:iron-gemm-fusion

Conversation

@atassis

@atassis atassis commented Jun 18, 2026

Copy link
Copy Markdown

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. (The in-tree llama_3.2_1b example builds a FusedMLIROperator.)

Changed

  • my_matmul now applies func_prefix to the gemm and convert_copy object filenames and to the zero_/matmul_/convert_copy_ kernel symbols.

Added / Removed

  • None.

No-op when func_prefix="" (the non-fused default), so existing callers are byte-identical. Exercised in our own batched decode, which fuses GEMM via FusedMLIROperator.

@andrej

andrej commented Jun 22, 2026

Copy link
Copy Markdown
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).
@atassis atassis force-pushed the iron-gemm-fusion branch from f713a91 to b674afe Compare June 22, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants