Skip to content

[FlyDSL] Fix the hardcoded die and CU counts in the FlyDSL kernels - #5504

Open
RElbers wants to merge 20 commits into
mainfrom
relbers/gfx950_flydsl_xcd_count
Open

RElbers wants to merge 20 commits into
mainfrom
relbers/gfx950_flydsl_xcd_count

Conversation

@RElbers

@RElbers RElbers commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Takes the die and CU counts from the device at dispatch, and from the target a job names at AOT build time, instead of assuming eight dies and 256 units. On MI350P this makes FlyDSL Mega-mHC 1.17x faster on geomean at 64 tokens and below (up to 1.31x), and leaves the other FlyDSL kernels' timings unchanged.

First of four, one per backend: this one, Triton (#5505), opus (#5848), HIP (#6877).

Motivation

FlyDSL kernels whose program-id round-robin folds by a die count assumed eight, and the persistent grids assumed 256 units. Both are already wrong on MI308X, which is gfx942 with 80 CUs and four dies and ships 3045 tuned rows. Both are wrong again on MI350P, gfx950 with 128 CUs and four dies.

Technical Details

  • Kernel names gain the count only when it differs from eight. A binary already cached for an eight-die part stays valid, and a four-die part cannot reuse it.
  • The kernel compile and launch functions keep num_xcds=8 as their default so out-of-tree callers keep working, and every in-tree caller passes the queried value. The internal planning helpers that size grids and checks take it as a required argument with no default: grid_size and dist_residency_error (Mega-mHC) and make_launch_grid (conv3d). No in-tree caller can fall back to eight unnoticed.
  • Both MoE stages remap their workgroups through xcd_remap_grid from [FlyDSL] [Bugfix] Fix MoE XCD swizzle on grids not divisible by 8 #7567 (eppaneamd), passing the device's die count. xcd_remap_grid gives the first num_workgroups % num_xcds dies one workgroup more, so it is a permutation for any grid size. Until [FlyDSL] [Bugfix] Fix MoE XCD swizzle on grids not divisible by 8 #7567 lands on main, this diff also shows its changes; merging the two in either order is consistent.
  • The a16w4 MoE shared-expert tiles round-robin over the device's die count, as the routed tiles already did; they assumed eight.
  • The conv3d compile cache is keyed on the die count, since one AOT process builds kernels for several targets.
  • The AOT half asks the target, not the build host, since a release builds on a machine that is not the part being built for.
  • FlyDSL Mega-mHC maps the split-K workgroups of a token block onto one die, pads its grid to whole groups of that many blocks, and sizes its DIST_FINISH residency check by the die count. The splits exchange partial sums through that die's L2, so the count in the mapping must not be below the device's; it is read for the input tensor's device. Single-split kernels do not use it and keep their names.
  • AOT maps a 228-CU row to gfx942 (MI300A); it used to fall through to the gfx950 default. This changes the compile target for such rows, not only their die count, but no shipped CSV has one.

Testing

AOT job collection matches the base exactly at 781 mxfp4 MoE, 1948 MoE and 3428 GEMM jobs. Kernel names are unchanged at eight dies and carry the suffix at four. Module imports, ruff and black clean.

tests/test_flydsl_dry_run.py passes and op_tests/test_flydsl_hgemm.py passes on MI355X.

tests/test_flydsl_moe_xcd_swizzle.py runs a 2 x 21 grid of 42 workgroups, which is not a multiple of 4 or 8. It fails on MI350P and on MI355X when the remainder-safe remap is reverted, and passes with it. tests/test_conv3d_ci_modes.py passes.

Timed against the merge base on MI355X and on MI350P, run base, head, base on one GPU, each run with its own empty FlyDSL cache; speedup is the mean of the two base runs over head:

Test MI355X geomean MI350P geomean MI350P range
test_flydsl_hgemm.py 1.00x 1.00x 0.98x to 1.09x
test_flydsl_moe_a16wfp4.py 1.00x 1.00x 1.00x to 1.01x
test_flydsl_gather_kv_b_proj.py 1.00x 1.02x 0.99x to 1.06x
test_flydsl_moe_a16wfp4.py, shared expert – 1.00x 0.99x to 1.03x
test_flydsl_conv_implicit.py --mode perf – 1.00x 0.98x to 1.05x
test_flydsl_mega_mhc.py, 1 to 64 tokens 0.99x 1.17x 1.07x to 1.31x
test_flydsl_mega_mhc.py, 384 tokens and up 1.00x 1.00x 0.99x to 1.01x

The GEMM, MoE and gather kernels keep their timings on both parts: on MI355X the counts equal the ones they replace, and on MI350P the four-die remap neither gains nor loses on these shapes. test_flydsl_gather_kv_b_proj.py's Triton column, which this branch does not touch, reads 1.00x on MI350P. The shared-expert and conv3d rows are timed on MI350P only; on MI355X their kernels are unchanged. Of the shared-expert cases only the largest grid, 128 tokens, gains, by 1% to 3%; conv3d is flat over two repeats. FlyDSL a8w4 MoE has no tuned rows for 128 CUs, so MI350P does not run it. The 68 FlyDSL mxfp4 MoE rows tuned for 128 CUs are not timed: test_moe_2stage.py stops on main at test_presorted_moe_hook, before its tuned-row cases.

On MI355X the MoE remap is not timed: on grids divisible by the die count every workgroup gets the same tile as before.

Mega-mHC is faster on MI350P up to 64 tokens: one token block now pads to a group of four instead of eight, and from 16 tokens the residency check, now sized for four dies, allows twice the split count. test_flydsl_mega_mhc.py passes on both parts; on MI355X its kernels are unchanged, and at 1 to 64 tokens two runs of the same code differ there by up to 5%, as much as base and head do.

PR Self-Review

Reviewed revision

f8c4e39

Behavior and intent

FlyDSL kernels take the die and CU counts from the device, and AOT builds from the target, instead of assuming 8 dies and 256 CUs, which is wrong on MI308X and MI350P.

Validation and unverified scope

On MI350P (gfx950, 128 CUs, 4 XCDs, ROCm 7.2.3):

  • tests/test_flydsl_dry_run.py, tests/test_flydsl_moe_xcd_swizzle.py and tests/test_conv3d_ci_modes.py pass.
  • op_tests/test_flydsl_moe_a16wfp4.py, test_flydsl_mega_mhc.py and test_flydsl_gather_kv_b_proj.py pass.
  • op_tests/test_flydsl_conv_implicit.py fails 1 of 19 cases because production conv_in has no tuned row for (gfx950, 128); this is the same on main.
  • op_tests/test_flydsl_hgemm.py passes its other checks, then stops at its own "band-stream HGEMM requires gfx950 with 256 CUs" check.
  • With the remap change reverted, the MoE swizzle test fails (stage 1 output has NaN, a tile never computed); it passes again when restored.
  • A FlyDSL a16w16 GEMM runs correctly at 4 dies.
  • Kernel names gain nxcd4, so 4-die and 8-die binaries no longer share a cache entry.

On MI355X (8 dies) the same tests pass, including test_flydsl_conv_implicit.py at 19 of 19. The swizzle test also passes with the die count forced to 4, and fails at 8 dies with the remap change reverted.

The FlyDSL hgemm, a16w-mix MoE and gather GEMM tests keep their timings on MI355X and MI350P, and conv3d on MI350P. Mega-mHC is 1.17x faster on geomean on MI350P at 64 tokens and below (see Testing).

Unverified: timing of the FlyDSL mxfp4 MoE rows tuned for 128 CUs, four of which use the MoE remap; test_moe_2stage.py stops on main before reaching them.

Not in scope: band-stream HGEMM explicitly refuses parts other than gfx950 with 256 CUs (gemm_a16w16_band.py), so it does not run on MI350P.

PR-specific question

The main risk is running a binary built for one die count on a part with another. The MoE remap is a permutation for any grid size. The die count is in the kernel name, and the AOT build asks the target rather than the host, which the dry-run test covers. Mega-mHC's split-K finish is only correct when its die count is not below the device's, so the wrapper reads it for the tensor's device.

Changed op tests

op_tests/flydsl_tests/test_flydsl_moe.py: from #7567; its a8w4 data generator gains distinct_experts, which the swizzle test uses so that every sorted block holds a routed row. No test is added.

op_tests/test_flydsl_conv_implicit.py: passes a die count to make_launch_grid in its host-path check, which does not depend on it. No test is added.

op_tests/test_flydsl_mega_mhc.py: passes the device's die count to the scratch-size helper, the residency checks and the ISA lookup, which otherwise assume eight and disagree with the wrapper on a four-die part. No test is added.

@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
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 5504 --add-label <label>

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 opt this PR out.

@RElbers
RElbers changed the base branch from main to relbers/gfx950_mi350p_identity September 14, 2026 13:55
@RElbers
RElbers added this pull request to stack #5506 September 14, 2026 13:55
@RElbers
RElbers force-pushed the relbers/gfx950_flydsl_xcd_count branch from 6589da6 to 79b189c Compare September 29, 2026 11:04
@RElbers
RElbers removed this pull request from stack #5506 October 27, 2026 08:01
@RElbers
RElbers changed the base branch from relbers/gfx950_mi350p_identity to main October 27, 2026 08:01
@RElbers
RElbers added this pull request to stack #7002 October 27, 2026 08:01
@vpietila-amd
vpietila-amd self-requested a review October 28, 2026 15:27
@aiter-bot

aiter-bot commented Oct 29, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 61317f10efe7 · 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. What behavior would each changed op test fail on before this PR, and why is that coverage not already provided by an existing canonical test?
  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 — Reviewed revision must contain at least the first 7 characters of the current head SHA

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

@RElbers
RElbers marked this pull request as ready for review October 29, 2026 22:48
@RElbers
RElbers requested a review from a team October 29, 2026 22:48
@github-actions github-actions Bot changed the title Fix the hardcoded die and CU counts in the FlyDSL kernels [FlyDSL] Fix the hardcoded die and CU counts in the FlyDSL kernels Oct 29, 2026
Copilot AI balanced review requested due to automatic review settings November 2, 2026 10:13

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

Unresolved XCD handling can mismatch AOT and runtime specializations and leave MoE tiles unwritten or duplicated, while newly required arguments break existing callers.

5 open issues
What changed in this PR

This PR updates FlyDSL dispatch and ahead-of-time compilation to use device or build-target die and compute-unit counts instead of fixed hardware assumptions. It is the FlyDSL portion of the broader backend topology updates.

Changes:

  • Pass hardware counts through GEMM, MoE, gather, and convolution paths.
  • Distinguish topology-dependent kernel specializations while preserving existing names for eight-die variants.
  • Add target-aware AOT count resolution and a dry-run regression test.
File Description
tests/​test_flydsl_dry_run.py Tests target-derived die counts during AOT replay.
aiter/​ops/​flydsl/​mxfp4_gemm2_kernels.py Supplies die and CU counts to GEMM2 compilation.
aiter/​ops/​flydsl/​mxfp4_gemm1_kernels.py Supplies the die count to GEMM1 compilation.
aiter/​ops/​flydsl/​moe_kernels.py Propagates device die counts through MoE dispatch.
aiter/​ops/​flydsl/​kernels/​preshuffle_gemm.py Passes the die count into tile remapping.
aiter/​ops/​flydsl/​kernels/​mxfp8_gemm_8wave.py Parameterizes remapping and topology-specific names.
aiter/​ops/​flydsl/​kernels/​mxfp4_gemm2.py Parameterizes die remapping and persistent-grid CU limits.
aiter/​ops/​flydsl/​kernels/​mxfp4_gemm1.py Parameterizes die remapping and kernel names.
aiter/​ops/​flydsl/​kernels/​moe_2stage_a16wmix/​gemm2.py Uses configurable die counts and device-derived CU limits.
aiter/​ops/​flydsl/​kernels/​moe_2stage_a16wmix/​gemm1.py Adds die-count specialization to stage1.
aiter/​ops/​flydsl/​kernels/​moe_2stage_a16wmix/​__init__.py Queries die counts in both stage wrappers.
aiter/​ops/​flydsl/​kernels/​mixed_moe_gemm_2stage.py Forwards die counts to shared MoE builders.
aiter/​ops/​flydsl/​kernels/​mixed_moe_gemm_2stage_common.py Parameterizes both stages’ remapping and names.
aiter/​ops/​flydsl/​kernels/​gemm_a8w8_8wave.py Generalizes the shared die-aware remap.
aiter/​ops/​flydsl/​kernels/​gemm_a16w16_gfx950.py Adds die count to GEMM parameters and dispatch.
aiter/​ops/​flydsl/​kernels/​gather_gemm_8wave.py Specializes gather remapping by die count.
aiter/​ops/​flydsl/​kernels/​fhmoe.py Forwards die counts to shared kernel builders.
aiter/​ops/​flydsl/​kernels/​conv/​conv3d_gfx950_utils.py Adds die count to convolution grids and coordinates.
aiter/​ops/​flydsl/​gemm_kernels.py Supplies device die count to preshuffled GEMM.
aiter/​ops/​flydsl/​gemm_a8w8_mxfp8_8wave.py Threads die count through MXFP8 compilation.
aiter/​ops/​flydsl/​gemm_a8w8_bpreshuffle_8wave.py Threads die count through eight-wave GEMM compilation.
aiter/​ops/​flydsl/​gather_kv_b_proj.py Uses device die counts for gather compilation and defaults.
aiter/​ops/​flydsl/​fhmoe.py Propagates die counts through FHMoE compilation.
aiter/​aot/​flydsl/​mxfp4_moe.py Includes target topology in AOT jobs and compilation.
aiter/​aot/​flydsl/​gemm.py Passes target-derived die counts to GEMM builders.
aiter/​aot/​flydsl/​dry_run.py Answers die-count queries using the replayed target.
aiter/​aot/​flydsl/​common.py Adds target die-count lookup and the 228-CU architecture mapping.

Review effort: Balanced

Comment thread aiter/ops/flydsl/gather_kv_b_proj.py Resolved
Copilot AI balanced review requested due to automatic review settings November 2, 2026 10:28

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.

🔵 Needs a closer look

Both MoE stages mishandle remainder tiles in six-XCD dispatch, leaving some outputs unwritten and processing others twice, with possible double-counted contributions in atomic mode.

5 open issues

Review effort: Balanced

vpietila-amd
vpietila-amd previously approved these changes Nov 2, 2026

@vpietila-amd vpietila-amd 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.

Looks good to me. This is mostly a mechanical change with the default value matching the existing behavior. Hence, the changes from this PR should only cause change of behavior when compiling for devices that have the non-default XCD/CU counts. I've tested these changes in a DeepSeek V4 end-to-end serving, which also covers testing the AOT compilation changes. Both MI350P and MI350X were tested.

Comment thread aiter/aot/flydsl/mxfp4_moe.py Resolved
@Melantha-S
Melantha-S requested a review from zufayu November 3, 2026 14:34
Copilot AI balanced review requested due to automatic review settings November 3, 2026 21:45

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 was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@zufayu
zufayu requested a review from coderfeli November 4, 2026 02:59
- Takes the XCD count from the device through chip_info.get_num_xcds in the
  FlyDSL GEMM, MoE, conv3d and gather kernels that remapped work over a
  fixed eight dies, and keys their compiled-kernel caches on it.
- Sizes the persistent MXFP4 stage-2 grid from the CU count instead of a
  fixed 256.
- Adds target_num_xcds to the FlyDSL AOT, and answers it for the target in
  dry_run, so a build compiles each tuned row for its target's die count
  rather than the build host's.
- Covers the dry-run die count per target in the AOT tests.
@RElbers
RElbers force-pushed the relbers/gfx950_flydsl_xcd_count branch from 1e056ab to 4fbb83d Compare November 6, 2026 14:50
Copilot AI balanced review requested due to automatic review settings November 6, 2026 14:50

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 was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@zufayu
zufayu requested a review from solinzby1 November 9, 2026 02:01
eppaneamd and others added 3 commits November 10, 2026 04:51
CI runs op_tests/*.py as sharded scripts, and op_tests/flydsl_tests is not in
the plan, so test_flydsl_moe_xcd_swizzle_uneven_grid never ran there. The
Focused regression tests step runs `python3 -m pytest -q tests` on pull
requests (MI35X shard 0), so the test moves, unchanged, to
tests/test_flydsl_moe_xcd_swizzle.py. It imports its data generator, tolerance
check, tile_k helper and gfx950 skip from the op test file, which keeps the
distinct_experts argument of _generate_a8w4_gui_data.

On MI355X (torch 2.13.0+rocm10.0.0, FlyDSL 0.4.2, an empty FlyDSL cache per
run): with the three kernel files of the merge-base the test fails
(xcd4_uneven_grid_stage1: output has NaN), with this commit's it passes, 0
skipped; the whole tests/ directory in CI's layout runs in 13 s.

Signed-off-by: Rony Leppänen <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The gfx950 skip imported from the op test uses get_gfx(), which follows
GPU_ARCHS and takes its last entry, so on an MI355X with
GPU_ARCHS='gfx950;gfx942' the regression was skipped. It now checks
get_gfx_runtime(), the running GPU, in the test body, as
op_tests/test_flydsl_pa_decode.py does.

On MI355X with GPU_ARCHS='gfx950;gfx942', get_gfx() returns gfx942 and
get_gfx_runtime() gfx950. Under the other settings tried (unset, 'gfx950',
'gfx942;gfx950') both return gfx950.

Signed-off-by: Rony Leppänen <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@zufayu
zufayu requested review from aoli26 and removed request for coderfeli November 11, 2026 06:54
@zufayu
zufayu requested a review from coderfeli November 11, 2026 06:54
eppaneamd and others added 4 commits November 13, 2026 14:26
Brings in #7774, which ports op_tests/test_flydsl_moe_a16wfp4.py's
stage-2 cache-key test to FlyDSL 0.5.0. The version this branch last
merged imports _jit_function_cache_key, which FlyDSL 0.5.0 does not have,
so that test failed in CI. No conflicts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Rony Leppänen <[email protected]>
…sl_xcd_count

# Conflicts:
#	aiter/ops/flydsl/gemm_kernels.py
#	aiter/ops/flydsl/kernels/gemm_a16w16_gfx950.py
- Maps split-K workgroups so that all splits of a token block share the device's die, pads the grid to whole groups of that many blocks, and sizes the DIST_FINISH residency check by its dies, where each assumed eight.
- Reads the die count for the input tensor's device in the wrapper and requires it in grid_size and dist_residency_error, so no caller falls back to eight unnoticed.
- Adds the die count to split-K kernel names only when it differs from eight, so eight-die binaries keep their names and single-split kernels, which do not use it, keep one name.
- Passes the die count in the Mega-mHC test's scratch-size helper, residency checks and ISA lookup.

The splits of a token block exchange partial sums and counters through their die's L2, so the mapping's die count must not be below the device's.

@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 2487f08:

Verified blocker: both MoE stages compute workgroups_per_xcd = num_workgroups // num_xcds and remap from that quotient without handling the remainder. For a grid not divisible by the XCD count, this omits some tiles and duplicates others. The dedicated fix in #7567 is still open, so this PR must either absorb that remainder-safe mapping or carry an explicit resolved dependency before merge.

Primary reviewer: @coderfeli (FlyDSL kernel/AOT topology owner); @yadaish can co-review the MoE portion.

Author action: rebase current main, resolve the current conflicts, incorporate/depend on #7567, and rerun topology coverage on the supported XCD counts. Also align the PR description with the intentional no-default compatibility behavior. The failed Aiter Gate remains a separate merge blocker.

RElbers and others added 7 commits November 17, 2026 11:19
…sl_xcd_count

# Conflicts:
#	aiter/ops/flydsl/kernels/gemm_a8w8_8wave.py
#	aiter/ops/flydsl/kernels/moe_2stage_a16wmix/gemm2.py
- Takes num_xcds as a required argument of make_launch_grid instead of querying the device inside it, so the host planning stays plain arithmetic that tests/test_conv3d_ci_modes.py can run without imports.
- Passes the device's die count from the compile path, and a fixed count in the op test's host-path check, which does not depend on it.
- Uses token 7 and topk 3, a 2 x 21 grid, so the workgroup count is not a multiple of 4 or 8 and the test also fails on a 4-die part if the remap drops the remainder.
- Notes that 42 is a multiple of 6, which no gfx950 part has.
- Passes the current die count into the cached compile, so a process that builds
  several targets cannot reuse a kernel compiled for another die count.
- Keeps the public compile_conv3d_implicit(param) signature unchanged.
- Replaces the fixed 8 in the shared-expert XCD round-robin of both stages with
  num_xcds, as the routed path already does.
@RElbers

RElbers commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

@zufayu I merged #7567 into this branch, so this PR doesn't have to wait for #7567 to merge first. I also merged latest main and added the runtime XCD count to the kernels that came in from main without it: Mega-mHC split-K, the a16w4 MoE shared expert, and the conv3d compile cache. I reran coverage on MI350P (4 XCDs) and MI355X (8 XCDs) and updated the PR description with the new measurements. The Aiter Gate failure was a NameError from this branch in the conv3d CI-mode test, it is now fixed.

- Routes the blockscale, mxfp8 8-wave and preshuffle GEMM compiles through main's FlyDSL AOT cache, keeping the device's XCD count as a compile argument.
- Adds the XCD count to each of those AOT cache keys, since the cache directory is keyed on arch and CU count but not on the die count.
- Passes the XCD count to main's new mxfp8 split-K tail compile as well, which the merged compile wrapper requires.
…et table

- Reads get_num_xcds under the input's device in the preshuffle and mxfp8 8-wave wrappers, whose AOT keys and launches use that device, as the blockscale wrapper already does.
- Makes num_xcds and out_dtype required in the blockscale _compile_gemm, so a caller cannot silently compile for eight XCDs.
- Removes the FlyDSL AOT copy of target_num_xcds and imports the build_targets table in its users, so the FlyDSL prebuild and the HIP build cannot disagree on a SKU's die count.
- Updates the AOT cache design doc's blockscale key and its key rules to include the XCD count, which the cache directory's fingerprint does not cover.
…die count

- Passes num_xcds to the mxscale preshuffle GEMM's XCD remap and keys its compiled kernels on it; unswizzled configs keep one build for every die count.
- Sizes the fused split-K l2_reduce default against the device's XCDs, which assumed eight and so took the path for grids twice its per-XCD budget on a four-XCD part.
- Deals the bmm xcd_order tile runs and the skinny a16w16 N slabs over the device's XCDs.
- Keeps eight as the split-K tile group in the bmm and mxscale kernels: it is a multiple of every gfx950 XCD count, so a tile's splits still share one XCD's L2 when the count is misread.

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.

7 participants