Skip to content

[Fix] Register the tcgen05.mma emitter for the sm_100 family - #169

Merged
yaoyaoding merged 1 commit into
NVIDIA:mainfrom
0z5a:fix-sm103a-tcgen05-mma
Nov 4, 2026
Merged

yaoyaoding merged 1 commit into
NVIDIA:mainfrom
0z5a:fix-sm103a-tcgen05-mma

Conversation

@0z5a

@0z5a 0z5a commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #168.

TMemoryMmaSSEmitter was registered only for nvgpu_sm100a. On a B300 the current target is nvgpu_sm103a, and sm103a.supports(sm100a) is False, so every script that uses tcgen05.mma failed with Failed to find emitter ... Tcgen05MmaSSInst (registered targets: nvgpu/sm100a). That includes all examples/blackwell_matmul scripts.

Changes:

  • backends/emitters/cuda/tcgen05/mma.py: register the emitter for nvgpu_sm100f. sm100a, sm103a, sm100f and sm103f all support it. .kind::f16, .kind::tf32 and .kind::f8f6f4 are family features; ptxas (CUDA 13.3) accepts them for all four targets.
  • Same file: .kind::i8 is the exception. ptxas accepts it only for sm_100a, so get_mma_kind now raises CodeGenerationFailed for int8 operands unless the target supports sm100a. Today get_inst_mnk does not implement I8 yet, so this only changes the error message. It keeps the family registration from claiming i8 on 10.3 later.
  • testing/_requires.py: add requires.nvgpu_sm100f.
  • tests/instructions/test_tcgen05_{mma,alloc_free,load_store,copy}.py: use requires.nvgpu_sm100f. With requires.nvgpu_sm100a, a 10.3 GPU falls back to compile-only under scope(nvgpu_sm100a), so these tests never ran there. The alloc/load/store/copy emitters are registered for base sm100 and already work on 10.3. Only the test gate kept them from running.

Testing

B300 (CC 10.3), CUDA 13.3, PyTorch 2.14.1+cu130, tilus main at 2047456.

Build for each target (scope(...) + .compile(...)): the 7 blackwell_matmul examples (1024³ fp16) and Tcgen05MmaExample from the test with f16 and f8 operands.

target before after
sm103a 0 / 9 build, all "Failed to find emitter" 9 / 9
sm100a 9 / 9 9 / 9
sm100f (not checked) 9 / 9

int8 operands: before, the error is NotImplementedError from get_inst_mnk on sm100a and "Failed to find emitter" on sm103a. After, it is unchanged on sm100a, and on sm103a/sm100f it is tcgen05.mma .kind::i8 is not supported on nvgpu/sm103a.

Run on the B300:

One B300 GPU, main vs. this PR:

main this PR
examples/blackwell_matmul/matmul_v0.py … v6.py main(bench=False) (8192³ fp16, assert_close vs. torch) 7 / 7 fail: "Failed to find emitter … Tcgen05MmaSSInst" 7 / 7 pass
tests/instructions/test_tcgen05_{mma,alloc_free,load_store,copy}.py + tests/ir/test_targets.py 73 passed, 4 xfailed, but the 39 tcgen05 tests only compiled for sm_100a 73 passed, 4 xfailed, with the tcgen05 tests now running on the 10.3 GPU

The 4 xfails are existing xfail cases in test_tcgen05_copy.py, the same on both sides.

ruff check and ruff format --check (0.11.0) pass on the changed files.

AI assistance

Claude (Anthropic) helped find this, write the change, and run the tests; the commit carries a Co-authored-by trailer for it. I reviewed the change and the results.

The MMA emitter was registered only for nvgpu_sm100a. On a B300 the
current target is nvgpu_sm103a, which does not support sm100a, so every
script using tcgen05.mma (all blackwell_matmul examples) failed with
"Failed to find emitter ... Tcgen05MmaSSInst".

.kind::f16, .kind::tf32 and .kind::f8f6f4 are family features (ptxas
accepts them for sm_100a/103a/100f/103f), so register the emitter for
nvgpu_sm100f. .kind::i8 is sm_100a only, so reject it on other targets
with a clear error.

Add requires.nvgpu_sm100f and use it for the tcgen05 instruction tests
(mma, alloc/free, load/store, copy). With requires.nvgpu_sm100a they
fell back to compile-only on 10.3 and never ran there.

Fixes NVIDIA#168

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: 0z5a <dezhen.lu@student.uni-tuebingen.de>
@copy-pr-bot

copy-pr-bot Bot commented Oct 31, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yaoyaoding

Copy link
Copy Markdown
Member

/ok to test b6d2085

@yaoyaoding
yaoyaoding enabled auto-merge (squash) November 4, 2026 17:23
@yaoyaoding
yaoyaoding merged commit f23018a into NVIDIA:main Nov 4, 2026
10 checks passed
@yaoyaoding

Copy link
Copy Markdown
Member

@0z5a thank you!

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.

[Bug] tcgen05.mma has no emitter for sm_103a (B300), so every Blackwell matmul fails to build

2 participants