Skip to content

[Config] [gfx1250] gpt-oss prefill a8w4: 128x256x256, no cluster - #7744

Draft
akao-amd wants to merge 9 commits into
ROCm:mainfrom
akao-amd:pr-gfx1250-a8w4-prefill-tiles
Draft

akao-amd wants to merge 9 commits into
ROCm:mainfrom
akao-amd:pr-gfx1250-a8w4-prefill-tiles

Conversation

@akao-amd

@akao-amd akao-amd commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On a 96-CU gfx1250 partition (MI455X in DPX), gpt-oss TP1 fp8 x fp4 (a8w4) MoE prefill ran the 256-CU rows, tuned with a
1x4 cluster. This adds five cu_num=96 rows (token 2048, 4096, 8192, 16384, 32768): 128x256x256 for both GEMMs, 1x4
warps, 2 buffers, no cluster, the schedule the original tuning on a 96-CU partition picked. The 256-CU rows are
unchanged. Config only.

Changes

  • aiter/configs/model_configs/gptoss_gfx1250_tuned_grouped_fmoe.csv: five rows, gfx1250, cu_num 96, model_dim 3072,
    inter_dim 3072 (gpt-oss TP1), 128 experts, top-4, Swiglu, bf16 out, fp8 e4m3fn activations, fp4 weights, per-1x32.
    The scheduling cells are written out (no cluster, default TDM waves, no next-stage prefetch). Like every row in this
    file, us/tflops/bw are 0: they are not measurements.
  • Selection (unchanged code): M is padded to a power of two. A 96-CU part now gets these rows for M 1025 to 32768, and
    M above 32768 uses the 32768 row (the lookup caps at the largest row). M <= 1024 has no 96-CU row and keeps the 256-CU
    rows, as before. A 256-CU part never sees these rows; fp4 x fp4 rows are untouched.
  • op_tests/tuning_tests/test_grouped_ep_fused_lookup.py: GptOss96CuPrefillLookupTest pins that selection (CPU only,
    gfx and CU count mocked, reads every merged grouped-MoE table).

TP1 only (inter_dim 3072); TP2 (inter_dim 1536) and other models have no new rows. In SGLang, gpt-oss reaches this table
only through the FlyDSL grouped MoE (SGLANG_GFX1250_W4A8_FLYDSL=1, batches of at least 384 tokens); without that
switch the MoE runs the Triton/Gluon moe_gemm_a8w4 and this PR has no effect.

Performance

Op level, MI455X (gfx1250) 96-CU partition with the other partition of the card idle, image
rocm/sgl-dev:v1.0.0-rocm101-mi45x-20261202 (Triton 3.9.0, FlyDSL 0.5.0), this branch at 99911fa, gpt-oss TP1 MoE (fused_moe, graph timing):

python op_tests/flydsl_tests/test_flydsl_grouped_gemm.py --scenario bench --data-format a8w4 --act swiglu \
  --experts 128 --topk 4 --model-dim 3072 --inter-dim 3072 --tokens 8192 16384 32768 65536 \
  --data-init uniform --scale-init auto --warmup 10 --iters 201 --no-check-aot-cache

Before = main's CSV, after = this CSV, selected through AITER_CONFIG_GROUPED_FMOE in the same tree (same code); three
alternating rounds, fresh process each, spread < 0.2 %. Every case passed the accuracy check. The gemm1 / gemm2 column
is the same command with --scenario kernel, first round.

Hardware Tokens (M) Before us (256-CU rows) After us (96-CU rows) Change gemm1 / gemm2 us, before -> after
MI455X 96-CU 8192 1382-1385 1080-1082 -22 % 891 / 406 -> 675 / 326
MI455X 96-CU 16384 2538-2540 2005-2006 -21 % 1642 / 745 -> 1250 / 604
MI455X 96-CU 32768 4824-4827 3837-3838 -20 % 3131 / 1409 -> 2390 / 1165
MI455X 96-CU 65536 (uses the 32768 row) 9355-9365 7519-7522 -20 % 6063 / 2724 -> 4702 / 2289

End to end (serving) not re-measured on this head.

Earlier measurement (original description, November, an older image and stack; not re-run on this head): on the 96-CU
partition, gpt-oss-120b TP1 8k +1.7 %, 70k +2.6 % output throughput, TTFT at 8k about -5 %.

The base1130_v3 stack (MI450 gpt-oss measurements, 12-01) carried this change as an earlier commit with the same five
rows, byte for byte. That stack's A/B has the rows in both arms, so it does not measure this PR alone. The grouped-MoE
kernels under the rows changed on main since then, which is why the numbers above are labelled earlier.

Testing

  • Unit tests added or updated

  • Performance benchmarks run on this head (op level; serving not re-run)

  • Tested on MI250X

  • Tested on MI300X

  • CPU: GptOss96CuPrefillLookupTest 5 passed, with and without a visible GPU; it fails on main's CSV.
    op_tests/tuning_tests/test_config_shape_collision.py -k grouped_fmoe passes.

  • MI455X (gfx1250) 96-CU partition, image rocm/sgl-dev:v1.0.0-rocm101-mi45x-20261202 (torch 2.12.0+rocm10.1.0,
    Triton 3.9.0, FlyDSL 0.5.0), this branch's CSV against main ecfa616, same device:

    • Lookup with the device's own gfx and CU count (no mocks): on this head fp8 activations at M 1025 to 70000 select
      the 96-CU rows, M <= 1024 and every fp4 x fp4 case select the 256-CU rows; on main every case selects a 256-CU
      row.
    • Accuracy: python op_tests/flydsl_tests/test_flydsl_grouped_gemm.py --scenario csv --csv-path aiter/configs/model_configs/gptoss_gfx1250_tuned_grouped_fmoe.csv --no-check-aot-cache (fused_moe against the
      torch reference, one case per row, two data/scale inits): head 58/58 passed, the new rows included; main 48/48.
    • AOT: GPU_ARCHS=gfx1250 python -m aiter.aot.flydsl.moe --row-tokens-only --csv <the CSV above>: 29 kernels, 174
      replays, 0 failed. The run-only sweep (same CSV sweep without --no-check-aot-cache) then passes 54/58: every new
      row passes; the 4 failures are the two unchanged 256-CU rows at token 512 (two inits each), which miss the prebuilt
      cache on a 96-CU part because their route-quant K split depends on the device CU count while the prebuild uses the
      row's 256. Main has the same rows.

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

Tuned rows only; the lookup is unchanged.

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Independent of the other gfx1250 gpt-oss PRs (#7743 -> #8883 -> #8884 -> #8885, #7745, #7746). Branch merged main
ecfa616.

Breaking Changes

None.

PR Self-Review

Reviewed revision

99911fa

Behavior and intent

On a 96-CU gfx1250 partition, gpt-oss TP1 a8w4 MoE prefill at M >= 1025 (padded token 2048 and up) uses a 96-CU
schedule (128x256x256, 1x4 warps, 2 buffers, no cluster) instead of the 256-CU rows tuned with a cluster. A 96-CU part
had no rows of its own for this shape.

Validation and unverified scope

  • CPU: python -m unittest op_tests.tuning_tests.test_grouped_ep_fused_lookup.GptOss96CuPrefillLookupTest: 5 passed.
  • MI455X 96-CU partition, at 72f0b7e (its CSV and runtime code are identical to this head, which only changes the
    test): device lookup, 0 unexpected selections on this branch and on main;
    test_flydsl_grouped_gemm.py --scenario csv against the torch reference, 58/58 passed (main 48/48);
    aiter.aot.flydsl.moe prebuild, 174 replays passed; run-only sweep 54/58 (the misses are unchanged 256-CU rows).
  • MI455X 96-CU partition, at this head 99911fa: test_flydsl_grouped_gemm.py --scenario bench / --scenario kernel,
    main's CSV vs this CSV, all cases passed; fused_moe -20 to -22 % at M 8192 to 65536 (Performance).
  • Unverified: end-to-end (serving) performance on this head; FlyDSL 0.5.5 (main's pin) at runtime (the image has 0.5.0); TP2
    and other models (no rows); 256-CU parts (unchanged by construction, pinned by the CPU test).

PR-specific question

Consumers: rows with gfx1250, cu_num 96, token 2048..32768, model_dim 3072, inter_dim 3072, expert 128, topk 4, Swiglu, bf16, fp8 e4m3fn x fp4x2, per_1x32, read by _find_grouped_config (FlyDSL grouped MoE, aiter.fused_moe on gfx1250).
Unrelated shapes: GptOss96CuPrefillLookupTest asserts that 256-CU lookups return the same row with and without the new
rows, that 96-CU lookups at M <= 1024 and every fp4 x fp4 lookup return the 256-CU row, and that only these five rows
exist for the shape. The device lookup on main and this branch agrees.

Changed op tests

op_tests/tuning_tests/test_grouped_ep_fused_lookup.py: new GptOss96CuPrefillLookupTest (CPU): selection of the 96-CU
rows, the M > 32768 cap, the M <= 1024 and fp4 fallbacks, 256-CU lookups unchanged. Not redundant: no test covered a
per-CU-count row in this table.

🤖 Generated with Claude Code

M>=2048 fp8xfp4 rows were tuned for 256 CUs with a 1x4 cluster. The bench winner drops the cluster and uses 1x4 warps with 2 buffers. TP1 8k/1k c64 +1.7%, 70k/300 c4 +2.6%.
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

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

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
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 Radeon R9700 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 7744 --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.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

… the 256-CU ones.

The M >= 2048 winner was measured on a 96-CU partition, so key it cu_num=96 and leave the 256-CU tuning as it was. Write every scheduling cell explicitly instead of leaving them blank; the values are the ones the blanks resolved to.
@akao-amd
akao-amd marked this pull request as ready for review November 11, 2026 08:54
@akao-amd
akao-amd requested a review from a team November 11, 2026 08:54
@aiter-bot

aiter-bot commented Nov 11, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 3808eabfb974 · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@zufayu
zufayu self-requested a review November 12, 2026 01:12
@zufayu zufayu self-assigned this Nov 12, 2026
@akao-amd

Copy link
Copy Markdown
Contributor Author

The two red Standard Tests shards look unrelated to this change (it only adds gfx1250 / cu_num=96 rows to the gpt-oss grouped-MoE CSV, which gfx950 never looks up):

If shard 2 flakes again after this update, could someone re-run the failed job? Thanks!

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

AITER SOP code review on current head ff72526:

The five 96-CU rows do not show an independent row-level logic blocker, but the edited gptoss_gfx1250_tuned_grouped_fmoe.csv file no longer exists on current main. This must be rebased and migrated to the active GPT-OSS config schema before the code/config review can close.

Primary reviewer: @yzhou103 (tuning/config owner); @yadaish can co-review the FlyDSL kernel/config pairing.

Author action: migrate the rows, prove the 96-CU TP1 lookup selects them, and attach accuracy plus performance against an explicit baseline. Current Docker Hub rate-limit failures are infrastructure, but CI must be rerun after the migration.

@akao-amd

Copy link
Copy Markdown
Contributor Author

@zufayu thanks for the review. The CSV is still on main: aiter/configs/model_configs/gptoss_gfx1250_tuned_grouped_fmoe.csv, last touched by b5078fc. aiter/jit/core.py loads every *tuned_grouped_fmoe*.csv under model_configs/, and this PR's header matches main's. The branch merged cleanly, so I merged current main into it (1290706aa) and CI will rerun on that head.

On our side, accuracy and performance numbers against an explicit baseline for the 96-CU rows are still outstanding, and so is a check that the TP1 lookup selects them. If the migration you mentioned refers to something other than the file on main, please say what it is.

@akao-amd
akao-amd marked this pull request as draft December 3, 2026 02:38
akao-amd and others added 3 commits December 3, 2026 03:08
… test

GptOss96CuPrefillLookupTest reads every tuned grouped-MoE table the runtime
merges and checks, with gfx and cu_num mocked:
- 96 CUs, fp8 x fp4, M 2048 to 32768 (and M above 32768, capped): the new
  128x256x256 rows, 1x4 warps, 2 buffers, no cluster;
- 96 CUs at M <= 1024, and fp4 x fp4 at any M: the 256-CU rows, the same
  row a 256-CU part gets;
- 256 CUs: the same row with and without the 96-CU rows in the table.

Fails on main's CSV (no 96-CU rows); passes on this branch (CPU only).

Co-Authored-By: Claude <[email protected]>
… test

dtypes.fp8 follows the host: without a visible GPU it is torch.uint8, so the
96-CU lookup test asked for uint8 activation rows and found none (1 failure,
29 subtest errors on a GPU-less host; reported by codexB). The CSV key is
gfx1250's OCP e4m3fn, so the test uses torch.float8_e4m3fn directly. Passes
with and without a visible GPU.

Co-Authored-By: Claude <[email protected]>

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants