Skip to content

[FlyDSL] Add gfx950 split Softmax and FP32 split-K BF16 GEMM - #5362

Draft
sunway513 wants to merge 2 commits into
mainfrom
sunway513/flydsl-gfx950-split-kernels
Draft

sunway513 wants to merge 2 commits into
mainfrom
sunway513/flydsl-gfx950-split-kernels

Conversation

@sunway513

Copy link
Copy Markdown
Collaborator

Long single-row Softmax leaves gfx950 with one workgroup and register spills. Small-M BF16 GEMM needs more parallel work, but BF16 split-K atomic accumulation can add enough rounding error to fail a stricter accuracy check.

Adds two opt-in FlyDSL launcher factories to AITER:

  • build_softmax_split: chunked max/sum followed by chunk-parallel normalization for 1–4 long rows, with FP32 statistics.
  • build_gemm_bf16_split_fp32: the existing FP32-output FlyDSL split-K GEMM plus a new FlyDSL BF16 conversion. The default tile targets small M; this does not replace the global GEMM dispatcher.

Each launcher owns preallocated workspace. Shape/dtype/device/contiguity and output aliasing are checked. Concurrent streams require separate launcher instances, retained while captured graphs exist. No external FlyDSL source checkout is needed by the implementations or tests; only the optional benchmark needs the original Softmax source for its baseline.

Exact PR implementation, MI355X/gfx950, AITER CI ROCm 7.2.4 / PyTorch 2.10, FlyDSL compiler 0.3.2:

BF16 operation Original FlyDSL New implementation Speedup
Softmax [1,131072] 26.577 us 6.263 us 4.244x
Softmax [1,89999] 15.135 us 6.325 us 2.393x
GEMM [M,N,K]=[32,384,7168] 9.351 us 7.878 us 1.187x

15 randomized paired rounds, 64 complete calls per graph. Both Softmax stages and all GEMM split-K/convert work are included; allocation/compilation are excluded. These are resident-working-set operator timings against the original Softmax and HGEMM unit-test configuration, not claims against exhaustive vendor autotuning or model-level speedups. Raw samples, provenance and reproduction commands are included in docs/flydsl/.

Validation: 110 GPU tests passed on the PR checkout, including all three Softmax dtypes, long/ragged rows, wide-range inputs, independent GEMM seeds, poisoned-output graph replay, invalid contracts and separate stream workspaces. Ruff and git diff --check passed. Nonfinite inputs, arbitrary strides and same-instance concurrent use are outside the documented contract.

@github-actions

github-actions Bot commented Sep 8, 2026

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 5362 --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.

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.

1 participant