feat(matmul): add MULTI_BLOCK Makefile target for matmul_multi_block.cpp - #73
feat(matmul): add MULTI_BLOCK Makefile target for matmul_multi_block.cpp#73Simona787 wants to merge 1 commit into
Conversation
Adds TYPE=MULTI_BLOCK rule supporting matmul_multi_block.cpp source with configurable M/N/K/tM/tN/tK, MODE, and NBLOCKS parameters. Enables compilation of multi-block matmul ELFs like: matmul_MULTI_BLOCK_MASK_FP32_M8192_N4096_K1600_tM32_tN32_tK32.elf
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52f6c29e43
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| TARGET = $(ELF_HEAD)/$(NAME)_MULTI_BLOCK_$(MODE)_M$(M)_N$(N)_K$(K)_tM$(tM)_tN$(tN)_tK$(tK).elf | ||
| else | ||
| TARGET = $(ELF_HEAD)/$(TESTCASE)_MULTI_BLOCK_$(MODE)_M$(M)_N$(N)_K$(K)_tM$(tM)_tN$(tN)_tK$(tK).elf |
There was a problem hiding this comment.
Encode NBLOCKS in the output filename
When the same shape and mode are built with different NBLOCKS values, both configurations resolve to the same target path, so the later build overwrites the earlier ELF even though the compiled row partitioning and required runtime thread count differ. This prevents retaining or reliably selecting multiple block-count configurations and can cause an ELF to be executed with the wrong thread count; include NBLOCKS in both target-name branches.
Useful? React with 👍 / 👎.
| static_assert(globN % tilN == 0); | ||
| static_assert(globK % tilK == 0); | ||
|
|
||
| using dtype = float; |
There was a problem hiding this comment.
Reject or implement non-FP32 modes
For any invocation such as TYPE=MULTI_BLOCK MODE=MASK_FP16, the Makefile accepts and embeds the mode in the ELF name, but this source always instantiates float inputs. Consumers that select input encoding from the advertised mode will therefore provide half/FP8-sized buffers that the kernel reads as FP32, producing invalid results or reading beyond the supplied data. Either derive dtype from the supported mode macros or reject every mode except MASK_FP32.
Useful? React with 👍 / 👎.
- 基线 ops-20260904(a0ddcc3) + env_test 现构建工具链(model 49547742/llvm 67d3ac98/TileOP f8fb8943) - 新tag含kernels/重构,5个PR(PTO-ISA#82/PTO-ISA#84/PTO-ISA#39/PTO-ISA#78/PTO-ISA#75)merge冲突=降级不忠实;干净merge PTO-ISA#73/PTO-ISA#79/PTO-ISA#83/#74可信 - gfsim 0->8 新模型真实改善;#74本轮首次可验(moe_dispatch/combine全PASS) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds TYPE=MULTI_BLOCK Makefile rule that compiles matmul_multi_block.cpp with configurable M/N/K/tM/tN/tK, MODE, and NBLOCKS parameters.
Enables compilation of multi-block matmul ELFs like:
Changes: