Skip to content

[FlyDSL] Fix gfx1250 GEMM output offset overflow - #7119

Open
chandankumr wants to merge 1 commit into
ROCm:mainfrom
chandankumr:investigate/6402-gfx1250-bf16-gemm-overflow
Open

chandankumr wants to merge 1 commit into
ROCm:mainfrom
chandankumr:investigate/6402-gfx1250-bf16-gemm-overflow

Conversation

@chandankumr

Copy link
Copy Markdown

Summary

Fixes #6402 by correcting output addressing in the gfx1250 FlyDSL gemm_a16w16 kernel for large BF16 GEMM outputs.

The kernel previously used a single output buffer descriptor and global store offsets. For large padded M grids, offsets could exceed the 32-bit byte-offset range, allowing stores from invalid rows to wrap around and overwrite earlier output data.

This change rebases the output pointer at each M tile using 64-bit arithmetic, limits the descriptor to the valid rows in that tile, and uses tile-local offsets for output stores. It also guards stores against rows beyond the logical M dimension. The regular and split-K paths share the corrected final-store logic.

Tests

Added regression tests for the large-offset arithmetic and the padded-grid corruption case, along with GPU tests for a control shape, the 2 GiB boundary, and the 4 GiB padded-grid scenario.

Local checks passed:

  • Ruff
  • Black
  • Python compilation
  • CPU regression tests (3 passed)

The three GPU integration tests were skipped locally because gfx1250 hardware was unavailable. They still need to be run on a suitable AMD GPU.

@chandankumr
chandankumr requested a review from a team October 29, 2026 00:14
@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 (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 gfx1201 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 7119 --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.

@zufayu
zufayu requested a review from coderfeli October 30, 2026 01:28
@zufayu
zufayu requested a review from aoli26 November 3, 2026 06:34
@zufayu
zufayu removed the request for review from coderfeli November 11, 2026 06:53
@zufayu zufayu assigned aoli26 and unassigned coderfeli Nov 11, 2026
@zufayu
zufayu requested a review from coderfeli November 11, 2026 06:53
@github-actions

Copy link
Copy Markdown
Contributor

No activity for 15 days, so this is now labelled stale. A push or a comment clears it; keep-open exempts it. Nothing is closed automatically.

@github-actions github-actions Bot added the stale The PR hasn't been updated in 2 weeks label Nov 27, 2026

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

FlyDSL stale The PR hasn't been updated in 2 weeks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[gfx1250] BF16 GEMM: Triton gemm_a16w16 leaves the rows of C past byte 2^31 unwritten

3 participants