Skip to content

[FlyDSL] Fix/flydsl 051 gfx942 down scale views - #8448

Merged
coderfeli merged 3 commits into
mainfrom
fix/flydsl-051-gfx942-down-scale-views
Nov 23, 2026
Merged

coderfeli merged 3 commits into
mainfrom
fix/flydsl-051-gfx942-down-scale-views

Conversation

@coderfeli

Copy link
Copy Markdown
Collaborator

Summary

Motivation

Changes

Performance (if applicable)

Hardware Workload/configuration Before After Change

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • Tested on MI250X
  • Tested on MI300X

Documentation

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

Dependencies

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

Breaking Changes

PR Self-Review

Reviewed revision

Behavior and intent

Validation and unverified scope

PR-specific question

Changed op tests

coderfeli and others added 2 commits November 22, 2026 12:38
….5.1

FlyDSL 0.5.1 (ROCm/FlyDSL#1407) refuses a tiled-MMA fragment whose static
extent is not a multiple of the tile. The gfx942 Down kernels broadcast the
per-channel weight scale into the C fragment through a stride-0 view whose
token (MMA N) mode has extent 1, against an N tile of 16. FlyDSL 0.5.0 padded
that mode to 16 silently; since the stride is 0 every padded column read the
same address, so the result was right. 0.5.1 rejects it, so every gfx942
whole-MoE prefill row failed to compile its Down kernel with:

  MmaMakeFragmentOp: the N extent 1 is not a multiple of the tiled MMA's
  N tile 16; the fragment would reach past the view

Give that mode the full tile width (16) with stride 0, which is what 0.5.0
padded it to:
- gemm2_1x4.py: ((4,2,2,4,4), 1) -> ((4,2,2,4,4), 16) for the LDS scale view.
- gemm2.py: (N, 1) -> (N, 16) for the per_tensor and ptpc weight-scale views,
  and the matching flat_divide tile (BLOCK_N, 1) -> (BLOCK_N, 16).

Verified on MI308X (gfx942):
- FlyDSL 0.5.1: op_tests/test_flydsl_moe_gfx942.py passes (failed before on
  the first 1x4 Down compile); every valid config of get_tune_space() x
  {no, per_tensor, ptpc} compiles and matches the reference.
- FlyDSL 0.5.0, before vs after: the final ISA of every Down kernel the
  shipped prefill rows and the tune space reach (15 distinct compilations,
  default prefill and 1x4, per_tensor and ptpc) is identical apart from the
  source line numbers in asm_mark comments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
FlyDSL 0.5.1 (ROCm/FlyDSL ae8f35dfa) makes get_rocm_arch() raise when no
GPU is detected and FLYDSL_GPU_ARCH is unset; 0.5.0 fell back to gfx942.

- hstu_attention, linear_attention_kernels and
  linear_attention_prefill_kernels read the arch into module constants at
  import, so importing them on a GPU-less host (e.g. collecting their tests
  on a CPU runner) now failed. Resolve it where it is used instead;
  get_rocm_arch() caches the hardware probe, and an AOT dry run now sees
  the FLYDSL_GPU_ARCH it sets rather than whatever was set at import.
- aot_cache._target_arch(): without a device, only FLYDSL_GPU_ARCH (which
  the AOT dry run always sets) names the target. Raise a clear error when it
  is unset instead of probing or guessing; 0.5.0's gfx942 fallback filed
  entries under the wrong arch on any other target.
- Drop the K5 opt kernel's flydsl>=0.2.0 check: aiter.ops.flydsl already
  requires >=0.5.0 at import, so it could never fire.

Verified on MI308X with FlyDSL 0.5.1: the three modules import with no GPU
tool on PATH and HIP/ROCR devices hidden (two failed before);
_target_arch() gives gfx942 with a device, the FLYDSL_GPU_ARCH value
(lower-cased) when set, and the new error with neither. Passing:
test_flydsl_hstu_attention{,_bwd}, test_flydsl_linear_attention{,_prefill},
test_flydsl_gdr_mtp, tests/test_flydsl_aot_cache.py and
test_flydsl_moe_gfx942.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderfeli
coderfeli requested a review from a team November 22, 2026 12:47
@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 8448 --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.

@github-actions github-actions Bot changed the title Fix/flydsl 051 gfx942 down scale views [FlyDSL] Fix/flydsl 051 gfx942 down scale views Nov 22, 2026
@aiter-bot

aiter-bot commented Nov 22, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision e44537118588 · 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
  • 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
  • FAIL — changed op test not explained in Changed op tests: op_tests/test_flydsl_hstu_attention.py
  • FAIL — Changed op tests must explain why each changed op test is necessary and non-redundant

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

@coderfeli coderfeli added ci:mi300x Run MI300X standard and OPUS CI on PRs and removed ci:mi300x Run MI300X standard and OPUS CI on PRs labels Nov 22, 2026
…che key

- op_tests/test_flydsl_hstu_attention.py: the tuned-CSV tests still read
  hstu_attention._GPU_ARCH, removed in the previous commit, so
  test_tuned_csv_is_picked_up and test_tuned_csv_best_duration_wins failed
  with AttributeError under pytest (CI runs the file as a script, which only
  reaches main()). Use get_rocm_arch(), as _get_tuned_config now does.
- aot_cache._target_arch(): with no device visible to torch, resolve the
  target through get_rocm_arch() as FlyDSL's compiler does, so
  HSA_OVERRIDE_GFX_VERSION and the rocm_agent_enumerator / rocminfo probe
  are honored again; FlyDSL >= 0.5.1 raises itself when nothing names a
  target. Keep refusing on FlyDSL 0.5.0 without an override, where
  get_rocm_arch() would guess gfx942.

Verified with FlyDSL 0.5.1 on MI308X: pytest -k tuned_csv 3 passed (2 failed
before); _target_arch() gives gfx942 with a device, the lower-cased
FLYDSL_GPU_ARCH when set, gfx942 for no device + HSA_OVERRIDE_GFX_VERSION=9.4.2
and for no device + hardware probe, and FlyDSL's error with none of them.
FlyDSL 0.5.0: raises with no device and no override, honors
HSA_OVERRIDE_GFX_VERSION. tests/test_flydsl_aot_cache.py passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderfeli
coderfeli merged commit 18ec1db into main Nov 23, 2026
57 checks passed
@coderfeli
coderfeli deleted the fix/flydsl-051-gfx942-down-scale-views branch November 23, 2026 02:58
josh-schell-amd added a commit to josh-schell-amd/vllm that referenced this pull request Dec 2, 2026
v0.1.30.post1 took the FlyDSL 0.5.3 bump without ROCm/aiter#8448, which
gfx942 FP8 MoE prefill Down kernels need to compile under FlyDSL >= 0.5.1.
v0.1.30.post2 is post1 plus vllm-project#8448 and a hipCCL JIT header fix.

Co-Authored-By: Claude <[email protected]>
Signed-off-by: josh schell <[email protected]>
hellozhuo-amd added a commit that referenced this pull request Dec 3, 2026
…he tuned-rows helper

Review item 4: main() gated on get_gfx() (the last GPU_ARCHS entry) while
the perf rows record get_gfx_runtime(); both now use the running card.

The merge of main brought #8448, which replaced the module constant
`hstu_attention._GPU_ARCH` with `get_rocm_arch()`. `_tuned_rows_for` still
read the constant, so test_flydsl_hstu_attention_tuned_rows_select_kernel
raised AttributeError; it now keys on get_rocm_arch() as the loader does.

Co-Authored-By: Claude <[email protected]>
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