Skip to content

[Triton/Gluon] [Config] Add gfx1250 A16W16 GEMM configs for Wan2.2 shapes - #6032

Merged
k50112113 merged 2 commits into
ROCm:mainfrom
sogalin:amd-opt-wan2.2
Oct 1, 2026
Merged

k50112113 merged 2 commits into
ROCm:mainfrom
sogalin:amd-opt-wan2.2

Conversation

@sogalin

@sogalin sogalin commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Config-only; no kernel or Python changes. Two commits:

  1. Gluon GEMM-A16W16 tile configs for the Wan2.2-T2V-A14B DiT shapes on gfx1250. Without them, these shapes fall back to DEFAULT.json (32x64 tiles, NUM_BUFFERS=5).
  2. A wan22_bf16_tuned_gemm.csv dispatch table for tgemm. Triton handles the DiT GEMMs; the two M=1 time-embedding shapes stay on torch, where Triton is 1.5x–7.5x slower.
    All tile configs use NUM_BUFFERS=2 (see [Triton/Gluon] [Config] Add gfx1250 A16W16 GEMM configs for FLUX.2 shapes #4851 for the determinism concern).

Validation

Each config is bit-exact against torch and gives identical results across repeated launches.

M, N, K DEFAULT Tuned TFLOP/s
32400, 5120, 5120 7.72 ms 2.63 ms 645
32400, 13824, 5120 19.98 ms 6.43 ms 714
32400, 5120, 13824 20.40 ms 6.62 ms 693
512, 5120, 5120 126 us 86 us 312

End-to-end Wan2.2-T2V-A14B (720x1280, 33 frames, 8 steps, 1x gfx1250), using the companion SGLang: denoising goes from 228.7 s to 64.4 s (3.55x), with bit-identical output video.
Note: the CSV rows are keyed on cu_num=192.

Submission Checklist

Tuned GEMM-A16W16 tile configs for the Wan2.2-T2V-A14B DiT projections
(dim 5120, FFN 13824, text dim 4096). Without them these shapes fall back
to DEFAULT.json (32x64 tiles, NUM_BUFFERS=5).

All configs use NUM_BUFFERS=2 and were only accepted if bit-exact against
torch and identical across repeated launches.

  | M, N, K            | DEFAULT | tuned   | TFLOP/s |
  | 32400, 5120, 5120  | 7.72 ms | 2.63 ms |     645 |
  | 32400, 13824, 5120 | 19.98ms | 6.43 ms |     714 |
  | 32400, 5120, 13824 | 20.40ms | 6.62 ms |     693 |
  | 512, 5120, 5120    | 126 us  |  86 us  |     312 |
  | 512, 5120, 4096    |  96 us  |  86 us  |     248 |
  | 32400, 64, 5120    | 153 us  | 102 us  |     207 |
Dispatch table for the 8 (M, N, K) shapes Wan2.2-T2V-A14B feeds to tgemm
at 720x1280, 33 frames, plus M=512 N=5120 K=4096 for the text projection,
each timed on both backends. Triton takes the large DiT GEMMs; the M=1
time-embedding shapes (N=5120 with K=256 and K=5120) stay on torch, where
Triton is 1.5x to 7.5x slower.

Rows are keyed on cu_num=192 (the gfx1250 part this was measured on).
@sogalin
sogalin requested a review from a team October 1, 2026 04:01
@github-actions

github-actions Bot commented Oct 1, 2026

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
multigpu 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: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
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 6032 --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.

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.

Copilot review overview

🔵 Needs a closer look

Hardware-specific correctness and performance claims require final review against gfx1250 validation results.

Review effort: Balanced
Findings: None

What changed in this PR

Adds gfx1250 tuning and dispatch data for Wan2.2 A16W16 GEMM workloads.

Changes:

  • Adds five Gluon shape-specific configurations with deterministic two-buffer pipelines.
  • Adds model-specific backend dispatch for Wan2.2 GEMM shapes.
File Description
GEMM-A16W16-N=64-K=5120.json Tunes the narrow-output GEMM.
GEMM-A16W16-N=5120-K=5120.json Tunes small and large M buckets.
GEMM-A16W16-N=5120-K=4096.json Tunes projection GEMMs by M bucket.
GEMM-A16W16-N=5120-K=13824.json Tunes the large-K projection.
GEMM-A16W16-N=13824-K=5120.json Tunes the large-N projection.
wan22_bf16_tuned_gemm.csv Selects torch or Triton/Gluon per measured shape.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@k50112113
k50112113 merged commit 03aa566 into ROCm:main Oct 1, 2026
58 of 62 checks passed
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.

3 participants