Skip to content

[Config] Add Qwen3.6 35B-A3B FMoE configs for gfx1201 - #4815

Merged
yzhou103 merged 5 commits into
ROCm:mainfrom
keneoneth:tune/gfx1201-qwen36-35b-a3b-fmoe
Sep 22, 2026
Merged

yzhou103 merged 5 commits into
ROCm:mainfrom
keneoneth:tune/gfx1201-qwen36-35b-a3b-fmoe

Conversation

@keneoneth

@keneoneth keneoneth commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Add Qwen3.6 35B-A3B FMoE tuning config files for gfx1201/RDNA4.

This is part of the Qwen3.6 gfx1201 AITER MoE enablement stack:

Technical Details

This PR adds model-specific FMoE tuned and untuned CSVs for Qwen3.6 35B-A3B on gfx1201:

  • qwen3_6_35b_a3b_bf16_tuned_fmoe.csv
  • qwen3_6_35b_a3b_bf16_untuned_fmoe.csv
  • qwen3_6_35b_a3b_fp8_tuned_fmoe.csv
  • qwen3_6_35b_a3b_fp8_untuned_fmoe.csv

The configs cover Qwen3.6 MoE shapes with:

  • model_dim = 2048
  • num_experts = 256
  • topk = 8
  • activation = Silu
  • use_g1u1 = 1
  • BF16 unquantized FMoE rows
  • FP8 block-quantized FMoE rows

This PR only adds tuning/config data. It does not add new kernels.

The tuned rows are recorded for the measured gfx1201 cu_num=32 target. The previously duplicated cu_num=64 rows were removed so the CSV does not imply separate measurements.

The FP8 untuned file lists 24 requested shapes. The tuned file currently contains 22 valid rows; M=1024, inter_dim=128 and M=2048, inter_dim=256 did not produce valid candidates in local retuning and are left for follow-up kernel/tuner work.

The BF16 M in {1,2,4,8,16} decode tier is handled by the direct small-M kernel in PR1. These config rows are for the remaining FMoE/CK-backed Qwen3.6 shapes where the generic path is still appropriate.

Test Plan

Validate the CSV files and build-time model-config/prebuild enumeration behavior:

python3 -m unittest op_tests.tuning_tests.test_csv_validation -v
python3 -m unittest op_tests.tuning_tests.test_config_shape_collision -v

Test Result

CSV validation:

Ran 13 tests in 0.107s
OK

Config shape-collision validation:

Ran 12 tests in 0.474s
OK

Submission Checklist

@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; 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 4815 --add-label <label>

@keneoneth
keneoneth marked this pull request as ready for review August 19, 2026 05:59
@keneoneth
keneoneth requested a review from a team August 19, 2026 05:59
@github-actions github-actions Bot changed the title Add Qwen3.6 35B-A3B FMoE configs for gfx1201 [Config] Add Qwen3.6 35B-A3B FMoE configs for gfx1201 Aug 19, 2026
@zufayu
zufayu self-requested a review August 20, 2026 00:53
@zufayu

zufayu commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Two questions on the data:

  1. cu_num=32 and cu_num=64 rows are byte-identical in both tuned CSVs — same kernels, same us, same tflops/bw for every (token, inter_dim) pair (bf16 14/14, fp8 22/22). Intentional duplication to cover Navi48 reporting as 64 CU vs 32 WGP? Worth a note in the description if so — as-is it reads like the 32 tier was measured separately.

  2. fp8_untuned has 24 shapes, fp8_tuned only 22 — missing token=1024 @ inter_dim=128 and token=2048 @ inter_dim=256. Tuning failure, or dropped on purpose?

Nit: model_configs/*.csv isn't read at runtime — fused_moe.py only loads aiter/configs/tuned_fmoe.csv; these are consumed at build time by moe_recipes.py::_get_tuned_fmoe_rows(). Might reword the "runtime config merge" line.

@keneoneth

Copy link
Copy Markdown
Contributor Author

Two questions on the data:

  1. cu_num=32 and cu_num=64 rows are byte-identical in both tuned CSVs — same kernels, same us, same tflops/bw for every (token, inter_dim) pair (bf16 14/14, fp8 22/22). Intentional duplication to cover Navi48 reporting as 64 CU vs 32 WGP? Worth a note in the description if so — as-is it reads like the 32 tier was measured separately.
  2. fp8_untuned has 24 shapes, fp8_tuned only 22 — missing token=1024 @ inter_dim=128 and token=2048 @ inter_dim=256. Tuning failure, or dropped on purpose?

Nit: model_configs/*.csv isn't read at runtime — fused_moe.py only loads aiter/configs/tuned_fmoe.csv; these are consumed at build time by moe_recipes.py::_get_tuned_fmoe_rows(). Might reword the "runtime config merge" line.

Thanks for reviewing.

  1. Good point on the duplicated cu_num=32 / cu_num=64 rows. I removed the mirrored cu_num=64 rows from both tuned CSVs, so the files now only contain the measured cu_num=32 tuning data.

  2. The two missing FP8 tuned rows are not intentionally dropped. I retried only the missing shapes:

token=1024, inter_dim=128
token=2048, inter_dim=256

Command used:

TUNE_ONLY=cktile python3 csrc/ck_gemm_moe_2stages_codegen/gemm_moe_tune.py \
  -i /workspace/reports/qwen36_fp8_missing_fmoe_untuned.csv \
  -o /workspace/reports/qwen36_fp8_missing_fmoe_tuned.csv \
  -o2 /workspace/reports/qwen36_fp8_missing_fmoe_profile.csv \
  --mp 1 \
  --shape_grouped \
  --warmup 10 \
  --iters 101 \
  --batch 100 \
  --errRatio 0.3

The tuning run did not produce valid rows for either shape. The relevant error was:

run gpu func warning: info:(('gfx1201', 32, 1024, 2048, 128, 256, 8, <ActivationType.Silu: 0>, torch.bfloat16, torch.float8_e4m3fn, torch.float8_e4m3fn, <QuantType.per_1x128: 4>, 1, 0), 'stage2', 'moe_ck2stages_gemm2_256x16x128x256_1x4_MulABScaleExpertWeightA8W8blkscale_v1_Nswizzle0_Quant4_MulRoutedWeight1_F8_F8_B16', 16)
wrong! device_gemm with the specified compilation parameters does not support this GEMM problem

The final tuner result was:

no valid candidate found for ('gfx1201', 32, 1024, 2048, 128, 256, 8, <ActivationType.Silu: 0>, torch.bfloat16, torch.float8_e4m3fn, torch.float8_e4m3fn, <QuantType.per_1x128: 4>, 1, 0)
no valid candidate found for ('gfx1201', 32, 2048, 2048, 256, 256, 8, <ActivationType.Silu: 0>, torch.bfloat16, torch.float8_e4m3fn, torch.float8_e4m3fn, <QuantType.per_1x128: 4>, 1, 0)

So I kept these two shapes in the untuned CSV to make the requested coverage visible, but left them out of the tuned CSV because there is no validated kernel choice to record yet. I will open a follow-up PR to address kernel/tuner support for these two FP8 shapes next.

I also reworded the PR description to avoid implying that model_configs/*.csv are loaded directly by fused_moe.py at runtime.

@yzhou103

Copy link
Copy Markdown
Contributor

please append _gfx1201 to the csv to distinguish it from mi-series.

@keneoneth

Copy link
Copy Markdown
Contributor Author

please append _gfx1201 to the csv to distinguish it from mi-series.

Sure, the csv files are renamed.

@zufayu

zufayu commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Advisory review (static + hand-run; not a merge gate). Validation/Perf ran no GPU stage — reasons are on their lines below. Findings tagged [verified] are traced to code/repro.

**Adds four data-only FMoE tuning CSVs (bf16/fp8 x tuned/untuned) for Qwen3.6 35B-A3B on gfx1201, recording tuner-measured CK 2-stage kernel picks per (token, inter_dim) shape plus the tuner input grid, with no code changes.

Review (advisory): ✅ NO FINDINGS
Validation (deterministic): NOT RUN — triage marked the four aiter/configs/model_configs/*.csv as runtime paths but no test target exists to run; these are tuned-config tables and tuner input CSVs rather than code executed at run time, so the missing target is not a defect on this data-only diff (schema, kernel-name resolution, key collision and merge behavior were verified statically, and the PR's two cited tuning suites were re-run green on the patched merge target)
Perf (advisory): NOT RUN — no perf target exists for the same reason there is no test target (data-only CSV diff, nothing runnable to benchmark); the us/tflops/bw columns are tuner-measured records, not new perf claims

@yzhou103 yzhou103 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.

LGTM

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants