Skip to content

a16w16 gemm tuned dsv4 pro shapes - #4222

Open
ahmed-bsod wants to merge 9 commits into
mainfrom
ahmed/dsv4-tune-bf16gemm
Open

ahmed-bsod wants to merge 9 commits into
mainfrom
ahmed/dsv4-tune-bf16gemm

Conversation

@ahmed-bsod

@ahmed-bsod ahmed-bsod commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

GEMM A16W16 tuned kernel time (µs), K=7168

N \ M 1 32 64 128 256 16384
64 3.71 4.49 4.55 4.32 4.46 18.57
384 3.92 4.76 5.18 5.31 6.25 54.46
512 3.96 4.77 5.38 6.02 7.07 63.04
1024 4.09 5.17 6.16 7.30 9.70 99.49
2048 4.46 5.90 7.05 9.49 12.20 196.21
32320 26.06 28.61 32.67 44.21 68.88 3094.86

@ahmed-bsod
ahmed-bsod requested review from a team and Copilot July 13, 2026 15:17
@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:triton-300x Run an additional Triton test job on MI300X in PRs; main branch always runs both MI35X and MI300X
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 4222 --add-label <label>

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.

Pull request overview

This PR adds tuned configuration coverage for A16W16 GEMM shapes used by DSv4/DSv4pro on gfx1250 (via Triton/Gluon configs), and tightens the default “skinny” fallback so it only applies on specific CDNA-class gfx targets.

Changes:

  • Restricts the skinny default-shape fallback in get_GEMM_A16W16_config() to gfx90a/gfx942/gfx950 only.
  • Adds gfx1250 GEMM-A16W16 (N,K-specialized) JSON configs for K=7168 across several N values, keyed by M-bounds.
  • Adds gfx1250 DSv4/DSv4pro bf16 tuned GEMM CSV entries that route these shapes to the Triton backend.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
aiter/tuned_gemm.py Restricts skinny fallback dispatch to specific gfx targets.
aiter/ops/triton/configs/gemm/gfx1250-GEMM-A16W16-N=64-K=7168.json Adds gfx1250 (N=64,K=7168) Gluon tuning params by M bounds.
aiter/ops/triton/configs/gemm/gfx1250-GEMM-A16W16-N=384-K=7168.json Adds gfx1250 (N=384,K=7168) Gluon tuning params by M bounds.
aiter/ops/triton/configs/gemm/gfx1250-GEMM-A16W16-N=512-K=7168.json Adds gfx1250 (N=512,K=7168) Gluon tuning params by M bounds.
aiter/ops/triton/configs/gemm/gfx1250-GEMM-A16W16-N=1024-K=7168.json Adds gfx1250 (N=1024,K=7168) Gluon tuning params by M bounds.
aiter/ops/triton/configs/gemm/gfx1250-GEMM-A16W16-N=2048-K=7168.json Adds gfx1250 (N=2048,K=7168) Gluon tuning params by M bounds.
aiter/ops/triton/configs/gemm/gfx1250-GEMM-A16W16-N=32320-K=7168.json Adds gfx1250 (N=32320,K=7168) Gluon tuning params by M bounds (DSv4pro).
aiter/configs/model_configs/dsv4pro_bf16_tuned_gemm.csv New DSv4pro gfx1250 bf16 tuned GEMM shapes routed to Triton backend.
aiter/configs/model_configs/dsv4_bf16_tuned_gemm.csv Adds DSv4 gfx1250 bf16 tuned GEMM shapes (multiple N values, K=7168) routed to Triton backend.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread aiter/tuned_gemm.py Outdated
Comment on lines +277 to +280
elif (
gfx in ("gfx90a", "gfx942", "gfx950")
and is_skinny_default_shape(M, N, K, dtype, cu_num)
):
Comment on lines +1 to +3
gfx,cu_num,M,N,K,bias,dtype,outdtype,scaleAB,bpreshuffle,libtype,solidx,splitK,us,kernelName,err_ratio,tflops,bw
gfx1250,256,1,32320,7168,False,torch.bfloat16,torch.bfloat16,False,False,triton,0,0,0.0,auto,0.0,0.0,0.0
gfx1250,256,2,32320,7168,False,torch.bfloat16,torch.bfloat16,False,False,triton,0,0,0.0,auto,0.0,0.0,0.0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

python3 -m unittest op_tests.tuning_tests.test_config_shape_collision

----------------------------------------------------------------------
Ran 12 tests in 0.304s

OK

@zufayu
zufayu requested a review from yzhou103 July 14, 2026 05:10
@ahmed-bsod
ahmed-bsod force-pushed the ahmed/dsv4-tune-bf16gemm branch from 5d93596 to 11d7fa1 Compare July 15, 2026 21:17
…e buffer as the ds_load without waiting for all the ds_loads to drain. we leave one buffer gap between tdm load and lds read now
Comment on lines +1031 to +1032
gfx1250,256,2,2048,7168,False,torch.bfloat16,torch.bfloat16,False,False,triton,0,0,0,auto,0.0,0.0,0.0
gfx1250,256,1,2048,7168,False,torch.bfloat16,torch.bfloat16,False,False,triton,0,0,0,auto,0.0,0.0,0.0

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.

could you please add the actual op duration here ?

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

No activity for 15 days, so this is now labelled stale. A push or a comment clears it; keep-open exempts it.

@github-actions github-actions Bot added the stale The PR hasn't been updated in 2 weeks label Oct 7, 2026
@zufayu
zufayu requested a review from yifehuan October 9, 2026 08:21
@github-actions github-actions Bot removed the stale The PR hasn't been updated in 2 weeks label Oct 11, 2026

This branch has not been deployed

No deployments
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.

5 participants