Skip to content

[FlyDSL][gfx950] Add balanced FT split-K and tune BF16 (128,7168,12288) - #7866

Merged
xytpai merged 38 commits into
ROCm:mainfrom
xytpai:perf/bf16-latent-projections
Nov 16, 2026
Merged

xytpai merged 38 commits into
ROCm:mainfrom
xytpai:perf/bf16-latent-projections

Conversation

@xytpai

@xytpai xytpai commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Changes

  • Add balanced whole-K-tile partitioning to gfx950 FT split-K when the previous partition size is not aligned to block_k. Require complete K tiles and at least stages - 1 tiles per partition. Preserve partition boundaries for previously valid configurations and leave HTI unchanged.
  • Add block_n=160 to the gfx950 search pool and enumerate split-K candidates before per-configuration validation.
  • Add --b-non-temporal auto|off|on|both (--flydsl-b-non-temporal alias) to control B-load cache-policy candidates during tuning.
  • Add one BF16 configuration for (M,N,K)=(128,7168,12288) on gfx950/256 CU: tile 128×160×64, stages 3, split-K 5, waves 2×2, BNT enabled. Its 192 K tiles are partitioned as 39/39/38/38/38.

Retain ordinary BF16 atomic accumulation and the existing tuner accuracy criterion. No preshuffle, FP32 workspace, separate reduction kernel, or public API changes. Advance the FT split-K device-symbol version to invalidate cached pre-change binaries; saved CSV names retain their format.

Performance

MI355X (gfx950, 256 CU), BF16 (128,7168,12288), PyTorch 2.10.0 / ROCm 7.2.4,
FlyDSL 0.5.0. Two cards, seeds 11801/11802, code revision 242a79f.

Before = the previous PR's FP32 atomic split-K + BF16 conversion, not an
upstream-main baseline. After = ordinary BF16 atomic GEMM; accumulation precision
differs. Timings include all GPU kernels needed for the final output.

Measurement GPU Before (µs) After (µs)
Graph, rotating16 A 48.40 41.10
Graph, rotating16 B 48.97 41.51
Default run_perftest A 54.66 43.81
Default run_perftest B 54.51 43.83

Graph measurements: 16 independent A/W/output sets, 128 complete calls/replay,
20 ABBA/BAAB blocks; medians shown. Paired rotating latency decreases
15.1–15.3% versus the above baseline. Against torch.mm, the same-card
rotating comparisons are 50.00 → 41.10 µs and 50.65 → 41.52 µs.
Default run_perftest uses its profiler-based protocol; values are medians of
five runs per card. It is not interchangeable with graph-event timing.
A separate trace confirms one GEMM kernel/call, with no post-reduce.

Accuracy: unchanged BF16 tuner criterion (rtol=atol=0.05, <5% mismatches);
observed mismatch fraction is 1.74–1.79%. Strict all-element .01 does not
pass (12.50–12.68% mismatches). No equal-precision or model E2E speedup is claimed.
BNT targets rotating inputs; hot input is faster with BNT off
(36.92–37.09 µs off versus about 41.59 µs on).

@xytpai
xytpai requested a review from a team November 12, 2026 08:16
@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 7866 --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.

@aiter-bot

aiter-bot commented Nov 12, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 242a79f3cffa · 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 architecture, dtype and shape boundaries select the changed kernel path, and what invariant prevents unsupported inputs from reaching it?
  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.

@xytpai
xytpai marked this pull request as draft November 12, 2026 08:50
@xytpai xytpai changed the title [gfx950] Retune BF16 latent projection GEMMs [FlyDSL][gfx950] Optimize BF16 latent projection GEMMs Nov 12, 2026
@xytpai
xytpai marked this pull request as ready for review November 12, 2026 12:53
@github-actions github-actions Bot changed the title [FlyDSL][gfx950] Optimize BF16 latent projection GEMMs [FlyDSL] [gfx950] Optimize BF16 latent projection GEMMs Nov 12, 2026
@xytpai xytpai changed the title [FlyDSL] [gfx950] Optimize BF16 latent projection GEMMs [FlyDSL] [gfx950] Optimize exact large-M BF16 latent projections Nov 12, 2026
@github-actions github-actions Bot changed the title [FlyDSL] [gfx950] Optimize exact large-M BF16 latent projections [HIP] [FlyDSL] [gfx950] Optimize exact large-M BF16 latent projections Nov 13, 2026
@github-actions github-actions Bot changed the title [gfx950][Tuning] Retune dsv4 BF16 GEMM configurations only [HIP] [gfx950][Tuning] Retune dsv4 BF16 GEMM configurations only Nov 13, 2026
@github-actions github-actions Bot added the HIP label Nov 13, 2026
@xytpai xytpai changed the title [HIP] [gfx950][Tuning] Retune dsv4 BF16 GEMM configurations only [FlyDSL][gfx950] Accelerate plain BF16 GEMM with FP32 split planes Nov 16, 2026
@github-actions github-actions Bot changed the title [FlyDSL][gfx950] Accelerate plain BF16 GEMM with FP32 split planes [HIP] [FlyDSL] [gfx950][Tuning] Retune dsv4 BF16 GEMM configurations only Nov 16, 2026
@xytpai xytpai added the ci:all label Nov 16, 2026
@xytpai

xytpai commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

@coderfeli @aoli26 @solinzby1 Please review the normal BF16 GEMM dispatch/workspace contract before merge. Updated head 5a49be2 uses ordinary unshuffled weights, balanced independent FP32 split-K5 planes and a separate BF16 post-reduce. Full normal-API rotating GPU time is 41.8–42.0 us including both kernels (previous PR 48.7–48.9 us); default run_perftest is about43.2 us. Internal scratch is17.5 MiB per invocation. Four API forms, changed-input graphs, separate streams and one-process GPU0→1→0 pass locally. No model E2E improvement is claimed; downstream CI and explicit maintainer approval are still required. Per the request, no docs or test files were added/modified. Details and baseline test failures are in the updated description.

@xytpai xytpai changed the title [HIP] [FlyDSL] [gfx950][Tuning] Retune dsv4 BF16 GEMM configurations only [FlyDSL][gfx950] Optimize plain BF16 GEMM (128,7168,12288) and (128,3584,7168) Nov 16, 2026
@xytpai xytpai changed the title [FlyDSL][gfx950] Optimize plain BF16 GEMM (128,7168,12288) and (128,3584,7168) [FlyDSL][gfx950] Improve rotating BF16 GEMM: (128,7168,12288) and (128,3584,7168) Nov 16, 2026
@github-actions github-actions Bot changed the title [FlyDSL][gfx950] Improve rotating BF16 GEMM: (128,7168,12288) and (128,3584,7168) [HIP] [FlyDSL] [gfx950] Optimize plain BF16 GEMM (128,7168,12288) and (128,3584,7168) Nov 16, 2026
@xytpai xytpai changed the title [HIP] [FlyDSL] [gfx950] Optimize plain BF16 GEMM (128,7168,12288) and (128,3584,7168) [FlyDSL][gfx950] Optimize plain BF16 GEMM (128,7168,12288) Nov 16, 2026
@xytpai xytpai changed the title [FlyDSL][gfx950] Optimize plain BF16 GEMM (128,7168,12288) [FlyDSL][gfx950] Balanced atomic BF16 split-K for (128,7168,12288) Nov 16, 2026
@github-actions github-actions Bot changed the title [FlyDSL][gfx950] Balanced atomic BF16 split-K for (128,7168,12288) [HIP] [FlyDSL] [gfx950] Optimize plain BF16 GEMM (128,7168,12288) Nov 16, 2026
@xytpai xytpai changed the title [HIP] [FlyDSL] [gfx950] Optimize plain BF16 GEMM (128,7168,12288) [FlyDSL][gfx950] Add balanced FT split-K and tune BF16 (128,7168,12288) Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants