Repository navigation
perf(gptoss): tune bf16 GEMM shapes to non-hipblaslt kernels - #4352
Merged
Merged
Conversation
Tune gpt-oss-120b bf16 GEMM shapes (o/down-proj N=2880 K=4096, qkv/gate-up N=5120, router gate N=128, lm_head N=201088; K=2880/4096) to asm/flydsl/ triton/opus kernels so they no longer fall back to torch/hipblaslt. The hipblaslt algo/workspace init is stream-capture-illegal and crashes cudagraph capture with HIP error 900 under -tp 2 --enable-dp-attention --enable-expert-parallel --enable-tbo. Entries live in the per-model config, sorted by gfx with gfx1250 last.
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Starting gpt-oss-120b with
-tp 2 --enable-dp-attention --enable-expert-parallel --enable-tbocrashes during CUDA/HIP graph capture:Root cause
Several gpt-oss bf16 GEMM shapes have no tuned config, so they fall back to the
torchpath (F.linear→ hipBLASLt). Under--enable-tbo, decode batches are split intobs/2micro-batches, producing GEMM shapes (e.g.m=2880 n=128 k=4096, the o/down projection at the TBO ubatch token count) that are executed for the first time during cudagraph capture. hipBLASLt's algorithm/workspace init on first touch of a shape is stream-capture-illegal → HIP error 900.Confirmed via
HIPBLASLT_LOG_MASK=32trace: the crashing matmul carries a hipBLASLtsolution_index, i.e. it went through the hipBLASLt path.Fix
Tune the affected gpt-oss bf16 GEMM shapes (all
dtype=bf16 outdtype=bf16) so they resolve to direct-launch kernels instead of torch/hipBLASLt:Result: all resolve to
asm/flydsl/triton/opus— notorch/hipblaslt. Entries live in the per-modelmodel_configs/gptoss_bf16_tuned_gemm.csv(not the sharedbf16_tuned_gemm.csv), sorted by gfx with gfx1250 last.Tuned with
gemm_a16w16_tune.py --libtype asm,opus,flydsl,triton,skinny(hipblaslt and torch excluded).Verification (gfx950, MI355X)