Repository navigation
Lower 16x16 Triton tl.dot to mma.sync with scalar fallback - #179
Open
Srikanth1234567808 wants to merge 3 commits into
Open
Srikanth1234567808 wants to merge 3 commits into
Srikanth1234567808 wants to merge 3 commits into
Conversation
MAP_ANONYMOUS and RTLD_DEFAULT are hidden by -std=c99 -pedantic. Without _GNU_SOURCE the strict build fails before any compiler work can run.
The tile lowering stages row-major f32 operands and emits BIR_MMA for 16x16x16 and 16x16x8 dots. NVIDIA converts to half at fragment load and emits real mma.sync; targets without tensor cores run a new IR pass that expands the op into ordinary BIR FMAs, so the same kernel compiles and validates on CPU, RV64, AMD and Metal. Raises the CPU/RV64 code buffers for the expanded instruction stream.
Adds Triton matmul fixtures for K=16 and K=8, PTX and CPU regression tests, a numeric differential check with an injection guard, and updates the feature status, roadmap and changelog to describe what the new path does and does not cover.
Owner
|
Hello, letting CI run, don't worry about Tensix too much as that's an "on their side" issue. It'll just take me some time to test this on some hardware. |
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.
What this does
Bridges Triton
tl.dotto Booth's existing matrix IR for 16x16x16 and 16x16x8 tiles, instead of materialising the tile and unrolling it into scalar FMAs.BIR_MMA(with a documented0x80subop flag marking f32-staged inputs).is_mma()converts the staged f32 operands to half at fragment load and emits realmma.syncinstructions.bir_expand_mma()IR pass rewrites the op into ordinary BIR loads/FMAs/stores viabir_insert(), so the same kernel compiles on CPU, RV64, AMD and Metal. Previously all matrix ops were refused by those backends._GNU_SOURCEforMAP_ANONYMOUS/RTLD_DEFAULT).Measured effect
Same 16x16x16 Triton matmul, compiled to PTX before and after:
mul.rn.f32add.rn.f32mma.sync.alignedVerification
make test: 1075 tests, 1057 passed, 0 failed, 18 skipped (18 needllvm-objdump, absent here).bash tests/diff/run_diff.sh: PASS, including a new numeric matmul differential (256/256 exact) with an--injectguard.mma.syncat both K=16 and K=8; multi-MMA kernels validated numerically on CPU.Scope and limitations (please review with these in mind)
This is a bring-up slice, not the whole Triton matrix-core roadmap item:
--nvidia-cubinhas no SASS form formma.sync(also true of the CUDA MMA builtins); use--nvidia-ptx. Large matmuls exceed cubin's code capacity regardless of this change.