Skip to content

[Triton/Gluon] [Config] Gfx1151 blockscale tuned jsons - #5557

Merged
azaidy merged 4 commits into
ROCm:mainfrom
keneoneth:gfx1151-blockscale-tuned-jsons
Sep 25, 2026
Merged

azaidy merged 4 commits into
ROCm:mainfrom
keneoneth:gfx1151-blockscale-tuned-jsons

Conversation

@keneoneth

@keneoneth keneoneth commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Add gfx1151 (RDNA3 / Strix Halo, Radeon 8060S) tuned Triton GEMM-A8W8_BLOCKSCALE config files for the DeepSeek-V4-Flash FP8 block-scale GEMM shapes.

On gfx1151 these blockscale GEMMs previously had no per-shape tuned config, so AITER fell back to the default kernel configuration and vLLM logged Using default W8A8 Block FP8 kernel config for the uncovered shapes. This PR records measured tuned configs for the DeepSeek-V4 W8A8 block-scale shapes seen in the 1M TP=2 serving run so those shapes use tuned parameters instead of the default fallback.

This is part of the DeepSeek-V4 gfx1151/RDNA3 AITER enablement stack:

Technical Details

This PR only adds tuning/config data. It does not add or modify any kernel.

All files land under:

aiter/ops/triton/configs/gfx1151/triton/gemm/gemm_a8w8_blockscale/

Added configs:

  • DEFAULT.json (gfx1151 blockscale default entries)
  • GEMM-A8W8_BLOCKSCALE-N=512-K=4096.json
  • GEMM-A8W8_BLOCKSCALE-N=1536-K=4096.json
  • GEMM-A8W8_BLOCKSCALE-N=2048-K=4096.json
  • GEMM-A8W8_BLOCKSCALE-N=4096-K=256.json
  • GEMM-A8W8_BLOCKSCALE-N=4096-K=1024.json
  • GEMM-A8W8_BLOCKSCALE-N=4096-K=4096.json
  • GEMM-A8W8_BLOCKSCALE-N=4096-K=12288.json
  • GEMM-A8W8_BLOCKSCALE-N=8192-K=1024.json
  • GEMM-A8W8_BLOCKSCALE-N=16384-K=1024.json

Each per-shape file is keyed by M_LEQ_* buckets and stores the standard Triton GEMM tuning parameters (BLOCK_SIZE_M/N/K, GROUP_SIZE_M, num_warps, num_stages, waves_per_eu, matrix_instr_nonkdim, cache_modifier, NUM_KSPLIT, kpack) for the FP8 [128, 128] block-scale GEMM.

The (N, K) shapes correspond to the DeepSeek-V4-Flash W8A8 block-scale GEMMs observed on the gfx1151 1M TP=2 route.

Test Plan

  • Load the model on gfx1151 with the AITER Triton FP8 block-scale path enabled (via the vLLM dependency above) and confirm each added shape resolves to its tuned config instead of the default fallback.
  • Confirm the Using default W8A8 Block FP8 kernel config warnings for these (N, K) shapes no longer appear during startup/serving.

Test Result

  • With these configs present, the previously uncovered DeepSeek-V4 W8A8 block-scale shapes are served with tuned parameters and no longer fall back to the default kernel config.

System-level E2E result

These configs deliver a clear end-to-end win on the DeepSeek-V4-Flash gfx1151 1M TP=2 route, exercised through the RDNA3 AITER Triton path enabled by the vLLM dependency (vllm-project/vllm#52970). Comparing an untuned image against the tuned image on the same prompt, the tuned build cuts end-to-end latency by roughly 1.4x to 1.6x and nearly doubles output token throughput.

Prompt: Tell me a random fun fact about the Roman Empire (seed 0, max tokens 256).

Metric Untuned Tuned Ratio
Prewarm E2E (s) 60.91 38.44 ~1.58x faster
Warmed follow-up E2E (s) 52.80 36.94 ~1.43x faster
Warmed follow-up output tok/s (E2E) 3.49 6.93 ~1.99x faster

Submission Checklist

@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; 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 5557 --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.

@keneoneth
keneoneth force-pushed the gfx1151-blockscale-tuned-jsons branch 2 times, most recently from 1d17510 to 84b834b Compare September 16, 2026 19:53
@keneoneth
keneoneth force-pushed the gfx1151-blockscale-tuned-jsons branch from 7f74062 to 1ed4872 Compare September 17, 2026 01:55
@keneoneth
keneoneth marked this pull request as ready for review September 23, 2026 14:38
@keneoneth
keneoneth requested a review from a team September 23, 2026 14:38
@github-actions github-actions Bot changed the title Gfx1151 blockscale tuned jsons [Triton/Gluon] [Config] Gfx1151 blockscale tuned jsons Sep 23, 2026
@keneoneth keneoneth changed the title [Triton/Gluon] [Config] Gfx1151 blockscale tuned jsons [Triton] [Config] Gfx1151 blockscale tuned jsons Sep 23, 2026
@Boss2002n
Boss2002n requested a lite review from Copilot September 23, 2026 17:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 9 High severity

Open (9)
What changed in this PR

Adds gfx1151 Triton block-scale GEMM tuning configurations for DeepSeek-V4 shapes.

Changes:

  • Adds one gfx1151 default configuration.
  • Adds nine shape-specific tuning files.
  • Configures per-M buckets and split-K parameters.
File Description
aiter/​ops/​triton/​configs/​gfx1151/​triton/​gemm/​gemm_a8w8_blockscale/​GEMM-A8W8_BLOCKSCALE-N=8192-K=1024.json Updated as part of this pull request.
aiter/​ops/​triton/​configs/​gfx1151/​triton/​gemm/​gemm_a8w8_blockscale/​GEMM-A8W8_BLOCKSCALE-N=512-K=4096.json Updated as part of this pull request.
aiter/​ops/​triton/​configs/​gfx1151/​triton/​gemm/​gemm_a8w8_blockscale/​GEMM-A8W8_BLOCKSCALE-N=4096-K=4096.json Updated as part of this pull request.
aiter/​ops/​triton/​configs/​gfx1151/​triton/​gemm/​gemm_a8w8_blockscale/​GEMM-A8W8_BLOCKSCALE-N=4096-K=256.json Updated as part of this pull request.
aiter/​ops/​triton/​configs/​gfx1151/​triton/​gemm/​gemm_a8w8_blockscale/​GEMM-A8W8_BLOCKSCALE-N=4096-K=12288.json Updated as part of this pull request.
aiter/​ops/​triton/​configs/​gfx1151/​triton/​gemm/​gemm_a8w8_blockscale/​GEMM-A8W8_BLOCKSCALE-N=4096-K=1024.json Updated as part of this pull request.
aiter/​ops/​triton/​configs/​gfx1151/​triton/​gemm/​gemm_a8w8_blockscale/​GEMM-A8W8_BLOCKSCALE-N=2048-K=4096.json Updated as part of this pull request.
aiter/​ops/​triton/​configs/​gfx1151/​triton/​gemm/​gemm_a8w8_blockscale/​GEMM-A8W8_BLOCKSCALE-N=16384-K=1024.json Updated as part of this pull request.
aiter/​ops/​triton/​configs/​gfx1151/​triton/​gemm/​gemm_a8w8_blockscale/​GEMM-A8W8_BLOCKSCALE-N=1536-K=4096.json Updated as part of this pull request.
aiter/​ops/​triton/​configs/​gfx1151/​triton/​gemm/​gemm_a8w8_blockscale/​DEFAULT.json Updated as part of this pull request.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@azaidy
azaidy self-requested a review September 23, 2026 21:58
@azaidy azaidy self-assigned this Sep 23, 2026

@azaidy azaidy left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keneoneth

  1. Either have kpack in default as well or have it in no file. I assume you need it since its set to 2 - in which case please have it in the DEFAULT.json as well.
  2. What was the default that it was falling back to? If even DEFAULT.json, this kernel would probably error out. Can you state the default kernel provider and provider a kernel level speedup table instead of just e2e?

Add "kpack": 2 to all buckets in the gfx1151 blockscale DEFAULT.json,
matching the pattern in per-shape config files and in the existing
gfx942/gfx1201 blockscale defaults (gfx1201-GEMM-A8W8_BLOCKSCALE.json
from PR ROCm#3228).

kpack is a Triton AMD backend compiler option (HIPOptions field), not a
kernel meta-parameter. It is consumed by the accelerate_matmul compiler
pass and never forwarded to the kernel body.
@github-actions github-actions Bot changed the title [Triton] [Config] Gfx1151 blockscale tuned jsons [Triton/Gluon] [Config] Gfx1151 blockscale tuned jsons Sep 24, 2026
@keneoneth

Copy link
Copy Markdown
Contributor Author

@keneoneth

  1. Either have kpack in default as well or have it in no file. I assume you need it since its set to 2 - in which case please have it in the DEFAULT.json as well.
  2. What was the default that it was falling back to? If even DEFAULT.json, this kernel would probably error out. Can you state the default kernel provider and provider a kernel level speedup table instead of just e2e?

@azaidy Thanks for the review. Addressed below.

1. kpack consistency

Either have kpack in default as well or have it in no file.

Good catch -- fixed in the latest push. Added "kpack": 2 to every bucket in DEFAULT.json, matching the existing gfx1201 and gfx942 blockscale defaults (e.g. gfx1201-GEMM-A8W8_BLOCKSCALE.json from #3228).

2. What was the default fallback + will kpack error?

What was the default that it was falling back to? If even DEFAULT.json, this kernel would probably error out.

From what I understand, before this PR, gfx1151 had no blockscale config files at all. So the fallback was handled on the vLLM side, which logged Using default W8A8 Block FP8 kernel config and supplied a hardcoded generic configuration.

Regarding kpack issue, actually it won't error. kpack is a Triton AMD backend compiler option (HIPOptions field), not a kernel meta-parameter. Triton's JIT binder extracts it from kwargs before the kernel-parameter check, same as num_warps and waves_per_eu:

# triton/third_party/amd/backend/compiler.py
@dataclass
class HIPOptions:
    ...
    matrix_instr_nonkdim: int = 0
    kpack: int = 1
    ...

def parse_options(self, opts):
    args.update({k: opts[k] for k in HIPOptions.__dataclass_fields__.keys()
                 if k in opts and opts[k] is not None})
    return HIPOptions(**args)
# triton/runtime/jit.py _pack_args():
options = backend.parse_options(kwargs)   # pulls kpack, num_warps, waves_per_eu, etc.
for k in kwargs:
    if k not in options.__dict__ and k not in sigkeys:
        raise KeyError("Keyword argument %s was specified but unrecognised" % k)

Since kpack is in HIPOptions.__dataclass_fields__, it passes the check. This is consistent with every existing blockscale config on main -- gfx942-GEMM-A8W8_BLOCKSCALE.json, gfx1201-GEMM-A8W8_BLOCKSCALE.json (#3228), and all gfx1201 per-shape files all include "kpack": 2.

3. Kernel-level speedup table

Can you state the default kernel provider and provide a kernel level speedup table instead of just e2e?

Both default and tuned use AiterFp8BlockScaledMMKernel (the AITER Triton blockscale GEMM). The difference is the per-shape tuning parameters vs the generic DEFAULT.json fallback.

Measured on gfx1151 (Strix Halo, Radeon 8060S) using triton.testing.do_bench (warmup=25, rep=100):

N K M Default (ms) Tuned (ms) Speedup
512 4096 1 1.247 0.187 6.67x
512 4096 4 1.319 0.185 7.15x
512 4096 16 0.808 0.190 4.26x
512 4096 64 1.813 0.274 6.61x
512 4096 256 3.790 1.001 3.79x
1536 4096 1 1.835 0.315 5.82x
1536 4096 4 1.885 0.313 6.02x
1536 4096 16 1.239 0.319 3.89x
1536 4096 64 2.382 0.672 3.55x
1536 4096 256 10.369 2.730 3.80x
2048 4096 1 2.723 0.408 6.68x
2048 4096 4 3.059 0.409 7.48x
2048 4096 16 2.685 0.417 6.45x
2048 4096 64 3.238 0.841 3.85x
2048 4096 256 9.884 3.128 3.16x
4096 256 1 0.205 0.103 1.99x
4096 256 4 0.204 0.109 1.86x
4096 256 16 0.137 0.103 1.34x
4096 256 64 0.312 0.153 2.05x
4096 256 256 0.752 0.310 2.43x
4096 1024 1 0.675 0.149 4.54x
4096 1024 4 0.693 0.154 4.50x
4096 1024 16 0.477 0.173 2.76x
4096 1024 64 0.945 0.360 2.63x
4096 1024 256 1.964 0.971 2.02x
4096 4096 1 4.443 0.825 5.38x
4096 4096 4 5.783 0.792 7.30x
4096 4096 16 5.427 0.834 6.51x
4096 4096 64 6.264 1.752 3.58x
4096 4096 256 9.098 5.314 1.71x
4096 12288 1 9.488 2.616 3.63x
4096 12288 4 15.097 2.434 6.20x
4096 12288 16 12.899 2.064 6.25x
4096 12288 64 17.557 4.621 3.80x
4096 12288 256 34.785 13.444 2.59x
8192 1024 1 1.196 0.215 5.57x
8192 1024 4 1.162 0.239 4.87x
8192 1024 16 0.810 0.300 2.70x
8192 1024 64 1.537 0.659 2.33x
8192 1024 256 3.876 1.765 2.20x
16384 1024 1 2.148 0.347 6.19x
16384 1024 4 2.082 0.369 5.65x
16384 1024 16 1.652 0.465 3.55x
16384 1024 64 3.717 1.210 3.07x
16384 1024 256 8.617 3.378 2.55x

Speedups range from 1.3x to 7.5x across all shapes, with the largest gains at small M (decode-dominant, the primary DSV4 serving workload).

@azaidy azaidy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@amd-xavierwang

amd-xavierwang commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Since we are creating fresh for gfx1151, does it make sense to drop all kpack entries? That matches my early work: #5217.

High level justification:

  1. the kernel actually never reads kpack from json configs.
  2. kpack(as well matrix_instr_nonkdim) are no-op on RDNA since there is only single-shape WMMA(16x16x16). Compiler ignores them anyway.

I see this PR is already approved so either way is OK. We already has inconsistent formats upstream(gfx12 has kpack and gfx11 doesn't).

@azaidy

azaidy commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Since we are creating fresh for gfx1151, does it make sense to drop all kpack entries? That matches my early work: #5217.

High level justification:

  1. the kernel actually never reads kpack from json configs.
  2. kpack(as well matrix_instr_nonkdim) are no-op on RDNA since there is only single-shape WMMA(16x16x16). Compiler ignores them anyway.

I see this PR is already approved so either way is OK. We already has inconsistent formats upstream(gfx12 has kpack and gfx11 doesn't).

That would work too. Can you please create it as a followup?

@azaidy
azaidy merged commit e45b8fe into ROCm:main Sep 25, 2026
68 of 70 checks passed
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