Repository navigation
[Triton/Gluon] [Perf] Cache gfx1250 Gluon MoE A8W4 layouts - #6500
Conversation
Eager calls rebuild Gluon layouts in Python on every launch. Cache the builder so a repeated config is a dict copy. Co-authored-by: Cursor <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
There was a problem hiding this comment.
🟡 Changes recommended
The central caching and copy-isolation behavior lacks regression coverage.
1 open finding
What changed in this PR
Caches gfx1250 Gluon MoE A8W4 layout construction to reduce repeated host-side launch overhead.
Changes:
- Normalizes gather dtype and CTA layout for stable cache keys.
- Returns a shallow copy of cached layouts.
| File | Description |
|---|---|
aiter/ops/triton/_gluon_kernels/gfx1250/moe/moe_op_gemm_a8w4.py |
Adds cached layout construction. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Summary
get_moe_a8w4_layoutsso a repeated gfx1250 Gluon MoE A8W4 launch reuses layouts instead of rebuilding them in Python.GatherIndxis reduced to its dtype andctas_per_cgato a tuple before the cache key. Callers receive a shallow copy of the cached dict.Performance
Host-side on gfx1250, uncached rebuild versus a cached call:
Under Triton 3.9, 1000 cache hits on the A8W4 prefill config were 0.558 µs.
block_m == 16and persistent decode still build layouts inside the kernel and do not call this helper.Made with Cursor