Repository navigation
[Triton/Gluon] add mla decode kernel name prefix - #5214
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags & labels: |
_fwd_kernel_stage1, _fwd_grouped_kernel_stage1, _fwd_kernel_stage2 and
_csr_to_dense_kernel say nothing about which op they belong to once they are
out of the source file and into a JIT artifact or a profiling trace.
_fwd_kernel_stage2 was not merely generic, it was ambiguous: two different
kernels shipped that base name, attention/mla_decode.py and
_triton_kernels/attention/mla_decode_rope.py, and their key lists open with the
same three entries (NUM_KV_SPLITS, BLOCK_DV, Lv), so a trace line had to be read
to the end to tell which op produced it. Prefixed both.
Only the base_name argument to make_kernel_repr changes. The Python functions
keep their names, so no import, launch site or test moves, and nothing else in
the tree reads these strings -- no tuned config file, AOT metadata path or cache
key is derived from a repr base name.
attention/mla_decode.py
_fwd_kernel_stage1 -> mla_decode_fwd_kernel_stage1
_fwd_grouped_kernel_stage1 -> mla_decode_fwd_grouped_kernel_stage1
_fwd_kernel_stage2 -> mla_decode_fwd_kernel_stage2
_csr_to_dense_kernel -> mla_decode_csr_to_dense_kernel
_triton_kernels/attention/mla_decode_rope.py
_fwd_kernel_stage2 -> mla_decode_rope_fwd_kernel_stage2
A scan of the 256 distinct make_kernel_repr base names in the tree finds seven
still shared by more than one file: _fwd_kernel (extend_attention, pa_prefill,
prefill_attention), _bwd_preprocess (the two MHA backward kernels), and five
arch or backend variants of a single logical kernel (_pa_decode_sparse,
_pa_decode_sparse_reduce, _mla_decode_fwd_kernel, _mla_decode_fwd_reduce_kernel,
_gluon_fp8_mqa_logits_kernel). This clears the eighth.
Reported by @brunomazzottiamd in review of #5097.
9c8be74 to
3d8aa22
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The RoPE stage-1 kernel representation still lacks the new namespace prefix.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Prefixes MLA decode Triton kernel representations for clearer tracing and compiled artifact names.
Changes:
- Namespaces standard and RoPE MLA decode kernel representations.
- Leaves the RoPE stage-1 representation unprefixed.
File summaries
| File | Description |
|---|---|
aiter/ops/triton/attention/mla_decode.py |
Prefixes four kernel representation names. |
aiter/ops/triton/_triton_kernels/attention/mla_decode_rope.py |
Prefixes the stage-2 RoPE representation. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Boss2002n <[email protected]>
No description provided.