Skip to content

[Triton/Gluon] [Perf] Cache gfx1250 Gluon MoE A8W4 layouts - #6500

Merged
Boss2002n merged 1 commit into
ROCm:mainfrom
zjin-lcf:cache-gfx1250-moe-a8w4-layouts
Oct 14, 2026
Merged

Boss2002n merged 1 commit into
ROCm:mainfrom
zjin-lcf:cache-gfx1250-moe-a8w4-layouts

Conversation

@zjin-lcf

Copy link
Copy Markdown
Contributor

Summary

  • Cache get_moe_a8w4_layouts so a repeated gfx1250 Gluon MoE A8W4 launch reuses layouts instead of rebuilding them in Python.
  • The public signature is unchanged. GatherIndx is reduced to its dtype and ctas_per_cga to 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:

Call Rebuild Cached
A8W4 prefill, M=128, no gather 1096 µs 0.5 µs
A8W4 prefill, M=128, int32 gather 1101 µs 0.6 µs
A8W4, M=16, no gather 1056 µs 0.4 µs
A8W4, M=16, int32 gather 1200 µs 0.8 µs

Under Triton 3.9, 1000 cache hits on the A8W4 prefill config were 0.558 µs. block_m == 16 and persistent decode still build layouts inside the kernel and do not call this helper.

Made with Cursor

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]>
@zjin-lcf
zjin-lcf requested a review from a team October 13, 2026 19:47
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 6500 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

@github-actions github-actions Bot changed the title [Triton] [Perf] Cache gfx1250 Gluon MoE A8W4 layouts [Triton/Gluon] [Perf] Cache gfx1250 Gluon MoE A8W4 layouts Oct 13, 2026
@azaidy
azaidy requested review from lburzawa and nsusanto October 13, 2026 21:20
@Boss2002n
Boss2002n requested a balanced review from Copilot October 13, 2026 21:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants