Skip to content

[Config] Add gfx950 DeepSeek-V4.1 MXFP8 GEMM rows for N = 12800, 6400 and 3200 (K = 6144) - #8159

Merged
yifehuan merged 3 commits into
ROCm:mainfrom
iraj465:config/dsv41-mxfp8-gemm-tp-shard-rows
Nov 26, 2026
Merged

yifehuan merged 3 commits into
ROCm:mainfrom
iraj465:config/dsv41-mxfp8-gemm-tp-shard-rows

Conversation

@iraj465

@iraj465 iraj465 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds 204 gfx950 rows to
aiter/configs/model_configs/dsv41_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv:
N = 12800, 6400 and 3200 at K = 6144, w_scale_block 32x32, cu_num 256, at the
68 M values the table already uses for its other gfx950 shapes. Rows only. No
code changes and no existing row changes.

Motivation

The table tunes N = 25600, K = 6144 (68 rows). Closed PR #6994 and open PR
#8052 describe that shape as the DeepSeek-V4.1 Engram WKV projection. The table
has no row for N = 12800, 6400 or 3200 at that K. These are N = 25600 / P for
P = 2, 4 and 8: the shards of that weight in vLLM under tensor parallel without
sequence parallelism. Its ROCm Engram layer gives every rank a 1 / P slice of
each key and of the value (RocmEngram._create_wkv in
vllm/models/deepseek_v41/amd/engram.py, vLLM main 52fae19fb). With sequence
parallelism vLLM does not shard this layer and N stays 25600. This is another
sharding than the one of #8052 (a key shard plus the whole value, N = 10240 at
P = 4), so the two sets of rows serve different callers.

Without rows, two things happen today:

  • A direct gemm_a8w8_blockscale_bpreshuffle call with one of these N finds no
    row at any M. get_mxscale_bpreshuffle_config reports "untuned" and the
    FlyDSL batched GEMM runs with its heuristic kernel.
  • vLLM does not call AITER for these layers. With AITER enabled in vLLM
    (VLLM_ROCM_USE_AITER=1; off by default), on gfx950, with bf16 as default
    dtype and batch-invariant mode off, it sends a 32x32 block-scaled MXFP8 layer
    to AITER only when rows exist for its (N, K) at M = 1 and at M = 8192
    (is_mxfp8_block32_bpreshuffle_gemm_tuned in vllm/_aiter_ops.py), and
    otherwise keeps its own Triton GEMM.

With the rows:

  • The direct call takes less time at 193 of the 204 tuned shapes:
    1.04x to 2.17x on an MI350X and 1.03x to 2.37x on an MI355X (gfx950, 256 CUs), geometric
    mean over all 204 shapes 1.43x and 1.50x. At the other 11 shapes the row names the
    kernel that main already runs, so nothing changes there (see Validation).
  • The vLLM gate opens. Under the conditions above, a vLLM that runs an AITER
    build with these rows moves these layers from its Triton GEMM to AITER's
    FlyDSL kernels at every M, decode sizes included. Timed through vLLM's own operator, AITER with these rows against vLLM's Triton GEMM is 1.11x to 2.18x at M = 1 to 16 and 1.19x to 2.40x at M = 512 to 16384 on an MI350X, and 1.16x to 2.67x and 1.18x to 2.57x on an MI355X (above 1.00x: the rows are faster), see Performance.

Changes

  • 204 rows inserted into the gfx950 block of the table, in its existing
    (N, K, M) order: N = 3200 before the (4096, 1280) rows, N = 6400 before the
    (8192, 1280) rows, N = 12800 before the (16384, 1280) rows.
  • Rows by backend: 55 mxpsh, 54 8-wave, 95 batched-GEMM (kernelId=bmm) rows.
  • Every other (gfx, cu_num, N, K, w_scale_block) keeps its rows byte for byte.
  • Effect on AITER lookups: only calls with gfx950, 256 CUs, K = 6144, 32x32
    scales and N in {12800, 6400, 3200} change. Before, no M had a row. After,
    every M from 1 up resolves to a row through the existing padded-M walk,
    except N = 3200 above M = 32768, which stays on the heuristic.
  • Effect on vLLM: the M = 1 and M = 8192 rows are what its routing check reads
    (see Motivation).
  • Related work: closed PR [FlyDSL] [Perf] Fuse Engram TP gate/residual and tune WKV GEMMs on gfx950 #6994 carried rows for N = 12800 and 6400 at
    M = 1, 2, 4, 8, 16 and was not merged; main has none of them. Open PR [Config] gfx950 DSv4.1-Flash MXFP8 GEMM rows for the rank-sharded Engram WKV (N=10240, K=6144) #8052
    (draft) adds nine rows for N = 10240, K = 6144 to this file and inserts them
    at the line where this PR inserts its N = 12800 group, so the PR that merges
    second needs a rebase; no key is shared. Open PR [FlyDSL][gfx950] Tune DSV4.1 MXFP8 Q-a+KV prefill at four M points #8024 edits other rows of
    this file (N = 1792, K = 5120) and adds 8-wave tiles. If another PR lands
    rows for the same keys first, this PR will drop its copies.

Performance (if applicable)

Direct call aiter.gemm_a8w8_blockscale_bpreshuffle(x, w, x_scale, w_scale, bf16)
with a 32x32 e8m0 weight scale and a 1x32 e8m0 activation scale, on synthetic
random data (no model checkpoint). Before = main 82b6b4f19. After = main plus
this table. One process per variant per round, 4 rounds in the order main, rows /
rows, main / main, rows / rows, main. Each process captures 10 calls in a CUDA
graph and takes the median of 11 replays. The ratio is the median of the 4
per-round ratios. Software: torch 2.13.0+rocm10.0.0, FlyDSL 0.5.3, main's aiter
and csrc laid over the AITER of the image vllm/vllm-openai-rocm:v0.33.0.
Measured on 24 November on an MI350X and on an MI355X; each GPU was idle before
and after its run by the driver's busy and memory counters. The benchmark script
times only the public operator; it is not part of this PR and is available on
request.

Hardware Workload/configuration Before After Change
MI350X (gfx950, 256 CUs) N = 12800, K = 6144, 68 tuned M: geometric mean (smallest to largest) - - 1.50x (1.00x to 2.17x)
MI350X (gfx950, 256 CUs) N = 6400, K = 6144, 68 tuned M: geometric mean (smallest to largest) - - 1.40x (0.98x to 1.96x)
MI350X (gfx950, 256 CUs) N = 3200, K = 6144, 68 tuned M: geometric mean (smallest to largest) - - 1.41x (1.00x to 1.79x)
MI355X (gfx950, 256 CUs) N = 12800, K = 6144, 68 tuned M: geometric mean (smallest to largest) - - 1.57x (1.00x to 2.37x)
MI355X (gfx950, 256 CUs) N = 6400, K = 6144, 68 tuned M: geometric mean (smallest to largest) - - 1.47x (1.00x to 2.18x)
MI355X (gfx950, 256 CUs) N = 3200, K = 6144, 68 tuned M: geometric mean (smallest to largest) - - 1.46x (1.00x to 1.91x)
MI350X (gfx950, 256 CUs) 1 x 12800 x 6144 15.87 us 13.44 us 1.18x
MI350X (gfx950, 256 CUs) 64 x 12800 x 6144 24.47 us 19.43 us 1.26x
MI350X (gfx950, 256 CUs) 1024 x 12800 x 6144 172.5 us 83.21 us 2.07x
MI350X (gfx950, 256 CUs) 8192 x 12800 x 6144 755.6 us 612.4 us 1.23x
MI350X (gfx950, 256 CUs) 64 x 6400 x 6144 13.38 us 12.48 us 1.07x
MI350X (gfx950, 256 CUs) 1024 x 6400 x 6144 87.75 us 58.93 us 1.49x
MI350X (gfx950, 256 CUs) 1 x 3200 x 6144 7.69 us 6.85 us 1.12x
MI350X (gfx950, 256 CUs) 1024 x 3200 x 6144 46.01 us 38.89 us 1.19x
MI355X (gfx950, 256 CUs) 1 x 12800 x 6144 13.98 us 12.35 us 1.13x
MI355X (gfx950, 256 CUs) 64 x 12800 x 6144 22.61 us 18.48 us 1.22x
MI355X (gfx950, 256 CUs) 1024 x 12800 x 6144 156.6 us 68.50 us 2.29x
MI355X (gfx950, 256 CUs) 8192 x 12800 x 6144 599.4 us 504.8 us 1.19x
MI355X (gfx950, 256 CUs) 64 x 6400 x 6144 12.23 us 11.55 us 1.06x
MI355X (gfx950, 256 CUs) 1024 x 6400 x 6144 79.40 us 51.66 us 1.54x
MI355X (gfx950, 256 CUs) 1 x 3200 x 6144 7.07 us 6.36 us 1.11x
MI355X (gfx950, 256 CUs) 1024 x 3200 x 6144 41.13 us 30.36 us 1.36x

Of the 204 shapes, 11 are below 1.03x on both devices: M = 2, 16 and 32 at N = 12800, M = 1, 2, 4, 8, 16 and 32 at N = 6400, and M = 16 and 32 at N = 3200. Their rows name the kernel that main's heuristic picks, so both variants run the same kernel there (0.98x to 1.01x on the MI350X, 1.00x to 1.02x on the MI355X; see Validation). The other 193 shapes are 1.04x to 2.17x on the MI350X and 1.03x to 2.37x on the MI355X, and none of them is slower than main in any of the four rounds on either device.

Calls at M values that have no row of their own, same method, 29 M values per
N. 86 of the 87 pad to a neighbour row. One (M = 40000 at N = 3200) is above
the grid, has no row and is main against main:

Hardware Workload/configuration Before After Change
MI350X (gfx950, 256 CUs) 86 M values that pad to a row: geometric mean (smallest to largest) - - 1.29x (0.99x to 2.09x)
MI350X (gfx950, 256 CUs) 3000 x 12800 x 6144 (served by the M = 4096 row) 300.5 us 243.9 us 1.23x
MI350X (gfx950, 256 CUs) 5000 x 12800 x 6144 (served by the M = 8192 row) 444.5 us 364.3 us 1.22x
MI350X (gfx950, 256 CUs) 20000 x 12800 x 6144 (served by the M = 8192 row) 1784.9 us 1453.7 us 1.23x
MI350X (gfx950, 256 CUs) 20000 x 3200 x 6144 (served by the M = 32768 row) 556.1 us 399.3 us 1.39x
MI355X (gfx950, 256 CUs) 86 M values that pad to a row: geometric mean (smallest to largest) - - 1.30x (0.95x to 2.26x)
MI355X (gfx950, 256 CUs) 3000 x 12800 x 6144 (served by the M = 4096 row) 250.8 us 204.4 us 1.23x
MI355X (gfx950, 256 CUs) 5000 x 12800 x 6144 (served by the M = 8192 row) 356.4 us 291.7 us 1.22x
MI355X (gfx950, 256 CUs) 20000 x 12800 x 6144 (served by the M = 8192 row) 1409.4 us 1180.7 us 1.19x
MI355X (gfx950, 256 CUs) 20000 x 3200 x 6144 (served by the M = 32768 row) 453.3 us 336.1 us 1.35x

On the MI350X 5 of the 86 are below 1.00x: 5 are served by a row that names main's kernel (0.992x to 0.999x, the same kernel in both variants). On the MI355X 4 of the 86 are below 1.00x: 3 are served by a row that names main's kernel (0.994x to 0.999x, the same kernel in both variants) and M = 5000 at N = 3200 on the M = 8192 row (0.954x, 117.6 us against 123.1 us). M = 5000 at N = 3200 is 1.058x on the MI350X. On the MI355X the 8-wave kernel of that row takes as long at M = 5000 as at M = 6145 (123.1 us and 123.8 us), where the heuristic's kernel grows with M (117.6 us and 162.0 us).

All 204 tuned shapes and all 87 off-grid shapes, both devices

Tuned M (one row each); times in us:

N M MI350X main MI350X rows MI350X main / rows MI355X main MI355X rows MI355X main / rows
12800 1 15.9 13.4 1.18 14.0 12.4 1.13
12800 2 15.9 15.9 1.00 14.1 14.0 1.01
12800 4 15.8 15.2 1.04 14.0 13.5 1.04
12800 8 15.8 15.0 1.05 14.0 13.5 1.03
12800 16 15.9 15.8 1.00 14.1 14.1 1.00
12800 32 16.1 16.0 1.00 14.4 14.4 1.00
12800 48 23.6 18.9 1.25 21.9 17.9 1.22
12800 64 24.5 19.4 1.26 22.6 18.5 1.22
12800 80 28.7 21.9 1.32 26.3 20.6 1.27
12800 96 28.6 22.7 1.26 26.1 21.2 1.23
12800 112 28.5 25.3 1.13 26.2 23.3 1.12
12800 128 28.8 26.8 1.07 26.7 24.0 1.11
12800 144 52.8 29.4 1.79 47.6 26.4 1.80
12800 160 53.1 33.6 1.58 47.6 30.2 1.58
12800 176 53.2 34.2 1.56 47.8 29.9 1.60
12800 192 53.4 35.6 1.51 47.9 30.0 1.60
12800 208 56.6 35.1 1.61 50.5 30.3 1.67
12800 224 56.4 34.8 1.62 50.5 29.8 1.69
12800 240 56.3 34.9 1.62 50.5 30.0 1.68
12800 256 56.6 35.3 1.60 50.6 30.1 1.68
12800 288 83.6 38.6 2.17 79.7 33.8 2.36
12800 320 83.6 39.9 2.10 80.2 34.0 2.35
12800 352 84.4 49.4 1.71 81.4 40.6 2.01
12800 384 85.8 49.2 1.74 83.6 40.9 2.04
12800 416 87.1 54.9 1.59 78.9 45.3 1.74
12800 448 87.1 55.1 1.58 79.2 45.8 1.73
12800 480 87.2 56.3 1.55 79.5 46.4 1.71
12800 512 87.7 59.1 1.49 79.8 50.4 1.59
12800 544 93.3 66.2 1.40 84.7 54.9 1.54
12800 576 93.6 66.5 1.41 85.0 55.0 1.54
12800 608 94.3 67.0 1.41 85.9 54.5 1.57
12800 640 96.2 66.3 1.45 87.1 55.2 1.58
12800 672 126.6 75.1 1.69 116.6 65.5 1.78
12800 704 127.5 73.1 1.74 116.9 61.8 1.89
12800 736 127.8 71.8 1.78 117.5 61.4 1.91
12800 768 130.8 73.8 1.77 118.6 61.0 1.95
12800 800 135.9 78.4 1.74 122.0 64.9 1.88
12800 832 136.1 77.8 1.74 122.5 64.9 1.89
12800 864 137.4 81.0 1.69 123.9 66.1 1.87
12800 896 137.2 80.9 1.70 124.3 65.9 1.89
12800 928 172.2 81.1 2.12 156.3 65.9 2.37
12800 960 172.1 81.6 2.11 156.6 67.2 2.33
12800 992 172.6 81.2 2.13 156.6 67.0 2.34
12800 1024 172.5 83.2 2.07 156.6 68.5 2.29
12800 1088 175.2 90.8 1.93 156.7 77.0 2.05
12800 1152 176.2 92.1 1.91 158.2 75.9 2.08
12800 1216 172.4 110.4 1.56 150.2 93.9 1.60
12800 1280 175.7 111.0 1.59 151.9 93.9 1.62
12800 1344 210.9 142.2 1.48 190.4 119.7 1.59
12800 1408 213.7 141.2 1.51 192.0 125.4 1.53
12800 1472 207.5 149.4 1.38 182.7 126.7 1.44
12800 1536 209.4 155.7 1.34 183.0 130.2 1.41
12800 1600 248.5 146.8 1.69 225.5 126.0 1.79
12800 1664 252.0 165.4 1.52 227.5 138.8 1.64
12800 1728 245.4 164.9 1.49 218.8 138.6 1.58
12800 1792 248.5 177.1 1.41 221.4 144.5 1.53
12800 1856 261.5 159.1 1.64 229.3 131.1 1.75
12800 1920 263.4 159.1 1.65 230.8 132.0 1.75
12800 1984 283.0 160.2 1.77 252.4 132.3 1.91
12800 2048 284.8 161.5 1.77 252.7 132.8 1.90
12800 4096 401.9 323.5 1.24 333.4 272.4 1.22
12800 6144 549.3 449.4 1.22 437.2 360.6 1.21
12800 8192 755.6 612.4 1.23 599.4 504.8 1.19
12800 10240 898.9 729.3 1.23 717.0 581.6 1.23
12800 12288 1104.2 898.3 1.23 874.2 712.3 1.23
12800 14336 1248.0 1024.6 1.22 995.3 823.3 1.21
12800 16384 1451.7 1181.5 1.23 1148.2 966.8 1.19
12800 32768 2854.7 2329.0 1.23 2256.7 1919.7 1.18
6400 1 9.9 10.0 0.98 8.5 8.6 1.00
6400 2 9.9 9.9 1.00 8.6 8.6 1.00
6400 4 9.9 9.9 1.00 8.6 8.6 1.01
6400 8 10.0 10.0 1.00 8.7 8.7 1.00
6400 16 9.9 9.9 1.00 8.8 8.8 1.00
6400 32 11.8 11.9 1.00 10.4 10.3 1.00
6400 48 13.1 12.3 1.06 12.0 10.9 1.10
6400 64 13.4 12.5 1.07 12.2 11.6 1.06
6400 80 22.4 14.1 1.59 21.1 13.2 1.60
6400 96 22.3 14.0 1.60 21.0 13.1 1.61
6400 112 22.5 16.4 1.37 21.1 14.9 1.42
6400 128 23.2 16.6 1.39 21.8 15.4 1.41
6400 144 24.8 20.5 1.21 23.2 18.5 1.25
6400 160 24.8 20.6 1.20 23.2 18.5 1.26
6400 176 24.9 20.7 1.20 23.4 18.6 1.26
6400 192 24.9 20.1 1.24 23.6 18.4 1.28
6400 208 28.7 21.7 1.32 26.5 19.6 1.35
6400 224 28.7 21.7 1.33 26.5 19.7 1.34
6400 240 28.6 21.5 1.34 26.6 19.6 1.36
6400 256 28.7 22.4 1.28 26.7 20.1 1.33
6400 288 44.2 25.2 1.76 41.3 22.5 1.83
6400 320 44.2 25.0 1.77 41.4 22.7 1.82
6400 352 44.3 29.8 1.49 41.6 26.9 1.55
6400 384 44.4 30.2 1.47 41.6 27.0 1.54
6400 416 45.3 34.1 1.33 41.1 28.6 1.43
6400 448 45.3 34.5 1.32 41.1 28.4 1.44
6400 480 45.2 33.3 1.36 41.1 29.7 1.38
6400 512 45.6 36.9 1.24 41.2 31.2 1.32
6400 544 47.4 39.7 1.21 45.9 34.6 1.33
6400 576 49.1 42.1 1.15 45.9 35.0 1.31
6400 608 49.0 41.4 1.18 45.9 34.4 1.34
6400 640 49.6 39.1 1.27 45.9 34.5 1.33
6400 672 84.2 49.1 1.71 78.9 41.6 1.90
6400 704 83.6 47.7 1.75 79.3 40.3 1.96
6400 736 84.3 47.4 1.78 79.6 39.6 2.01
6400 768 85.8 48.2 1.78 80.0 40.0 2.00
6400 800 88.1 54.5 1.62 82.3 46.1 1.78
6400 832 88.2 54.1 1.63 82.3 45.3 1.82
6400 864 88.2 54.0 1.64 82.5 45.0 1.83
6400 896 88.7 54.6 1.62 83.0 45.0 1.84
6400 928 87.4 57.3 1.53 79.1 47.7 1.66
6400 960 87.4 57.1 1.53 79.1 47.1 1.68
6400 992 87.6 59.3 1.47 79.3 52.1 1.53
6400 1024 87.8 58.9 1.49 79.4 51.7 1.54
6400 1088 90.3 62.8 1.46 81.5 52.4 1.55
6400 1152 90.5 61.1 1.48 82.0 52.8 1.55
6400 1216 89.2 67.0 1.33 78.1 54.9 1.42
6400 1280 90.5 68.1 1.34 78.4 55.9 1.40
6400 1344 123.6 70.4 1.76 114.7 60.1 1.91
6400 1408 124.2 72.7 1.71 115.5 60.8 1.90
6400 1472 120.5 71.8 1.68 110.2 60.0 1.84
6400 1536 121.2 70.1 1.73 110.6 60.0 1.84
6400 1600 127.3 75.2 1.71 116.0 62.8 1.85
6400 1664 129.5 74.4 1.75 116.7 62.3 1.87
6400 1728 126.4 76.3 1.66 111.9 63.2 1.77
6400 1792 127.4 75.4 1.70 113.1 62.3 1.81
6400 1856 133.1 80.6 1.65 117.6 65.4 1.80
6400 1920 134.5 81.5 1.65 118.3 66.5 1.78
6400 1984 159.8 81.5 1.96 145.2 66.5 2.18
6400 2048 159.3 82.4 1.94 145.4 66.6 2.18
6400 4096 204.6 162.5 1.26 168.6 133.5 1.26
6400 6144 297.4 244.3 1.22 248.1 200.4 1.24
6400 8192 397.2 323.8 1.23 329.8 272.1 1.21
6400 10240 441.0 369.9 1.19 353.7 295.5 1.19
6400 12288 543.9 448.7 1.21 433.1 362.3 1.20
6400 14336 644.2 527.7 1.22 513.8 428.8 1.20
6400 16384 742.5 610.0 1.22 595.5 512.8 1.16
6400 32768 1433.0 1207.9 1.19 1146.3 987.0 1.16
3200 1 7.7 6.8 1.12 7.1 6.4 1.11
3200 2 7.6 6.1 1.24 7.1 6.4 1.11
3200 4 7.7 6.1 1.25 7.2 6.4 1.13
3200 8 7.7 7.1 1.09 7.3 6.8 1.08
3200 16 7.7 7.7 1.00 7.3 7.3 1.00
3200 32 7.5 7.4 1.01 7.1 7.0 1.02
3200 48 9.3 8.0 1.16 8.9 7.7 1.15
3200 64 9.3 8.9 1.05 9.0 8.4 1.06
3200 80 15.4 11.3 1.36 14.2 10.4 1.37
3200 96 15.4 11.1 1.39 14.3 10.3 1.38
3200 112 15.5 11.5 1.35 14.3 10.8 1.33
3200 128 15.8 12.3 1.28 14.7 11.2 1.31
3200 144 22.4 13.6 1.64 20.7 12.7 1.63
3200 160 22.4 13.5 1.66 20.6 12.6 1.63
3200 176 22.5 15.0 1.50 20.6 13.9 1.49
3200 192 22.6 15.0 1.50 20.8 14.0 1.49
3200 208 23.0 15.0 1.53 21.6 14.0 1.54
3200 224 23.0 15.1 1.53 21.4 14.1 1.52
3200 240 23.0 15.0 1.53 21.5 14.1 1.52
3200 256 23.2 16.8 1.38 21.6 15.2 1.42
3200 288 29.5 18.2 1.62 27.1 17.0 1.60
3200 320 29.5 18.1 1.63 27.4 16.7 1.64
3200 352 29.6 18.8 1.57 27.3 17.1 1.58
3200 384 30.0 21.1 1.42 27.4 18.9 1.44
3200 416 31.1 23.1 1.35 28.4 19.6 1.45
3200 448 31.0 21.8 1.42 28.1 19.6 1.43
3200 480 31.0 22.0 1.41 28.3 19.4 1.46
3200 512 31.1 22.6 1.38 28.7 19.7 1.45
3200 544 32.8 24.9 1.32 30.3 21.6 1.41
3200 576 32.9 25.5 1.29 30.7 22.4 1.37
3200 608 33.0 26.0 1.28 30.7 22.2 1.38
3200 640 33.6 25.4 1.33 31.2 22.4 1.40
3200 672 44.1 28.4 1.55 40.2 24.9 1.61
3200 704 44.2 29.9 1.48 40.2 27.0 1.49
3200 736 44.3 29.6 1.50 40.2 27.0 1.49
3200 768 44.5 30.9 1.44 40.5 27.2 1.49
3200 800 45.8 30.8 1.49 43.2 27.3 1.58
3200 832 45.9 30.7 1.50 43.2 27.3 1.58
3200 864 46.0 30.6 1.50 43.3 27.5 1.57
3200 896 46.1 31.7 1.45 43.4 28.0 1.55
3200 928 45.9 31.1 1.48 41.2 28.1 1.47
3200 960 46.0 31.5 1.46 41.1 27.9 1.47
3200 992 45.9 37.3 1.23 41.1 31.9 1.29
3200 1024 46.0 38.9 1.19 41.1 30.4 1.36
3200 1088 48.1 37.3 1.29 43.5 33.0 1.32
3200 1152 47.5 39.2 1.22 43.5 32.5 1.34
3200 1216 47.1 39.7 1.19 41.1 33.0 1.24
3200 1280 47.8 39.2 1.22 41.5 34.0 1.22
3200 1344 82.1 46.0 1.79 76.4 40.0 1.91
3200 1408 82.5 48.4 1.71 77.1 41.7 1.85
3200 1472 80.7 47.0 1.72 74.2 40.8 1.82
3200 1536 81.3 47.8 1.70 74.7 40.6 1.85
3200 1600 83.2 50.9 1.64 77.6 41.7 1.86
3200 1664 83.6 49.6 1.69 77.8 41.6 1.86
3200 1728 80.9 50.9 1.59 75.4 40.2 1.87
3200 1792 82.2 56.1 1.46 76.1 46.5 1.63
3200 1856 84.9 53.0 1.60 79.0 42.8 1.84
3200 1920 85.4 51.1 1.67 79.4 43.3 1.83
3200 1984 80.4 53.0 1.51 73.5 43.6 1.69
3200 2048 80.9 54.6 1.48 73.9 44.6 1.66
3200 4096 129.9 83.6 1.56 111.6 67.3 1.65
3200 6144 189.3 146.5 1.29 162.2 120.6 1.35
3200 8192 253.8 163.3 1.55 215.5 135.8 1.59
3200 10240 275.4 220.7 1.25 228.7 188.6 1.21
3200 12288 337.5 246.8 1.37 279.2 204.8 1.36
3200 14336 398.4 268.6 1.49 330.5 216.6 1.53
3200 16384 467.2 323.9 1.44 382.9 272.9 1.41
3200 32768 926.7 636.7 1.46 756.1 508.2 1.49

M without a row of their own ("row M" is the row that served the call); times in us:

N M row M MI350X main MI350X rows MI350X main / rows MI355X main MI355X rows MI355X main / rows
12800 3 4 15.9 13.5 1.18 14.1 12.5 1.13
12800 6 8 15.9 15.1 1.05 14.0 13.5 1.04
12800 12 16 15.7 15.7 1.00 14.0 14.0 1.00
12800 17 32 16.0 16.0 1.00 14.6 14.5 1.00
12800 40 48 23.4 18.7 1.25 21.7 17.8 1.22
12800 100 112 28.7 25.1 1.14 26.4 23.2 1.14
12800 250 256 57.4 36.6 1.57 51.0 31.8 1.60
12800 257 288 83.3 39.9 2.09 77.7 34.4 2.26
12800 600 608 95.2 68.9 1.38 86.0 58.2 1.48
12800 1000 1024 172.8 87.8 1.97 156.5 75.0 2.09
12800 1025 1088 173.1 92.7 1.86 155.3 78.6 1.98
12800 1500 1536 207.8 152.3 1.37 182.7 132.3 1.38
12800 2000 2048 281.7 160.6 1.75 252.2 136.6 1.85
12800 2049 4096 215.1 170.8 1.26 175.2 143.4 1.22
12800 3000 4096 300.5 243.9 1.23 250.8 204.4 1.23
12800 4000 4096 395.9 322.4 1.23 331.8 272.7 1.22
12800 4050 4096 397.1 321.5 1.24 332.5 272.9 1.22
12800 4097 8192 410.3 328.1 1.25 335.5 276.9 1.21
12800 5000 8192 444.5 364.3 1.22 356.4 291.7 1.22
12800 6100 6144 547.5 444.3 1.23 433.6 359.7 1.20
12800 6145 8192 554.8 453.1 1.23 442.0 365.0 1.21
12800 8100 8192 753.7 605.6 1.24 595.8 498.7 1.20
12800 9000 8192 851.3 659.4 1.29 674.9 556.6 1.21
12800 10200 10240 901.1 731.8 1.23 713.0 580.9 1.23
12800 12000 8192 1095.8 882.1 1.24 865.5 703.8 1.23
12800 16300 16384 1452.0 1191.1 1.22 1146.8 959.8 1.20
12800 20000 8192 1784.9 1453.7 1.23 1409.4 1180.7 1.19
12800 32700 32768 2857.6 2336.4 1.22 2258.4 1926.2 1.17
12800 40000 8192 3527.0 2904.8 1.22 2782.1 2306.2 1.21
6400 3 4 10.0 10.0 0.99 8.6 8.5 1.00
6400 6 8 10.0 10.0 1.01 8.6 8.5 1.00
6400 12 16 9.9 10.0 1.00 8.8 8.6 1.02
6400 17 32 11.6 11.7 1.00 9.9 10.1 0.99
6400 40 48 13.1 12.2 1.07 11.8 10.9 1.07
6400 100 112 22.6 16.6 1.36 21.3 15.1 1.41
6400 250 256 29.1 22.3 1.30 27.0 20.8 1.30
6400 257 288 44.2 24.7 1.79 41.6 23.2 1.79
6400 600 608 50.1 42.6 1.18 46.5 35.8 1.30
6400 1000 1024 88.3 59.4 1.48 79.5 52.7 1.50
6400 1025 1088 90.2 61.7 1.46 81.4 54.1 1.51
6400 1500 1536 121.9 70.6 1.73 110.2 61.8 1.78
6400 2000 2048 159.2 82.6 1.92 145.4 67.7 2.15
6400 2049 4096 108.7 86.2 1.25 90.4 70.9 1.28
6400 3000 4096 181.1 141.4 1.28 162.4 125.4 1.30
6400 4000 4096 201.1 160.7 1.26 166.2 134.7 1.24
6400 4050 4096 201.0 160.1 1.25 165.7 131.8 1.26
6400 4097 8192 204.4 164.0 1.25 168.0 137.5 1.22
6400 5000 8192 221.0 184.3 1.20 180.2 147.7 1.22
6400 6100 6144 299.6 243.8 1.23 248.0 205.1 1.21
6400 6145 8192 303.3 248.6 1.22 249.5 205.4 1.21
6400 8100 8192 394.8 324.2 1.22 329.1 272.1 1.21
6400 9000 8192 417.6 338.9 1.23 337.3 283.1 1.19
6400 10200 10240 441.3 368.7 1.19 354.2 300.3 1.18
6400 12000 8192 536.5 445.5 1.21 430.0 357.0 1.20
6400 16300 16384 745.6 608.3 1.23 596.2 509.0 1.17
6400 20000 8192 884.3 732.2 1.21 704.6 582.8 1.21
6400 32700 32768 1441.6 1203.5 1.19 1148.0 984.2 1.17
6400 40000 8192 1778.9 1496.2 1.19 1409.8 1199.2 1.18
3200 3 4 7.6 6.9 1.09 7.1 6.4 1.11
3200 6 8 7.7 7.0 1.10 7.1 6.5 1.09
3200 12 16 7.7 7.7 1.00 7.2 7.1 1.00
3200 17 32 7.5 7.5 1.00 6.9 6.9 1.01
3200 40 48 9.3 8.0 1.16 8.7 7.5 1.15
3200 100 112 15.5 11.5 1.35 14.6 10.7 1.36
3200 250 256 23.1 16.7 1.38 21.8 15.2 1.44
3200 257 288 29.6 18.4 1.61 27.2 17.0 1.60
3200 600 608 33.6 25.8 1.30 30.8 22.5 1.37
3200 1000 1024 46.7 38.0 1.23 41.5 32.7 1.27
3200 1025 1088 47.7 39.9 1.20 43.5 33.1 1.32
3200 1500 1536 81.3 49.4 1.64 74.6 42.2 1.77
3200 2000 2048 81.3 54.7 1.49 74.1 46.1 1.61
3200 2049 4096 70.9 63.7 1.11 59.4 58.0 1.04
3200 3000 4096 119.1 72.2 1.65 107.7 62.1 1.75
3200 4000 4096 128.1 82.3 1.56 109.7 68.2 1.61
3200 4050 4096 127.6 83.6 1.54 109.5 68.7 1.60
3200 4097 8192 130.8 85.8 1.53 110.5 71.8 1.53
3200 5000 8192 142.3 134.4 1.06 117.6 123.1 0.95
3200 6100 6144 192.3 147.3 1.31 161.8 122.0 1.33
3200 6145 8192 192.3 142.9 1.34 162.0 123.8 1.31
3200 8100 8192 254.8 161.8 1.57 216.2 133.6 1.62
3200 9000 16384 263.3 173.3 1.51 220.4 143.4 1.54
3200 10200 10240 276.7 222.8 1.25 228.1 188.1 1.21
3200 12000 16384 333.3 244.5 1.36 276.5 202.8 1.36
3200 16300 16384 460.8 324.5 1.42 383.2 270.2 1.42
3200 20000 32768 556.1 399.3 1.39 453.3 336.1 1.35
3200 32700 32768 932.8 634.4 1.47 755.2 513.7 1.47
3200 40000 - 1143.1 1139.5 1.00 921.9 922.2 1.00

Through vLLM's operator: before = vLLM main 52fae19fb with main's table, which runs its Triton GEMM; after = the same with this table, which runs the rows. Same timing method.

Hardware Workload/configuration Before After Change
MI350X (gfx950, 256 CUs) vLLM operator, activation already quantised, M = 1 to 16, 15 shapes: geometric mean (smallest to largest) Triton rows 1.45x (1.11x to 2.18x)
MI350X (gfx950, 256 CUs) vLLM operator, activation already quantised, M = 17 to 511, 6 shapes: geometric mean (smallest to largest) Triton rows 1.60x (1.36x to 1.94x)
MI350X (gfx950, 256 CUs) vLLM operator, activation already quantised, M = 512 and above, 18 shapes: geometric mean (smallest to largest) Triton rows 1.59x (1.19x to 2.40x)
MI350X (gfx950, 256 CUs) vLLM operator, raw bf16 activation (quantisation included), M = 1 to 16, 15 shapes: geometric mean (smallest to largest) Triton rows 1.62x (1.32x to 1.98x)
MI350X (gfx950, 256 CUs) vLLM operator, raw bf16 activation (quantisation included), M = 17 to 511, 6 shapes: geometric mean (smallest to largest) Triton rows 1.59x (1.29x to 2.06x)
MI350X (gfx950, 256 CUs) vLLM operator, raw bf16 activation (quantisation included), M = 512 and above, 18 shapes: geometric mean (smallest to largest) Triton rows 1.55x (1.20x to 2.24x)
MI355X (gfx950, 256 CUs) vLLM operator, activation already quantised, M = 1 to 16, 15 shapes: geometric mean (smallest to largest) Triton rows 1.51x (1.16x to 2.67x)
MI355X (gfx950, 256 CUs) vLLM operator, activation already quantised, M = 17 to 511, 6 shapes: geometric mean (smallest to largest) Triton rows 1.64x (1.37x to 2.01x)
MI355X (gfx950, 256 CUs) vLLM operator, activation already quantised, M = 512 and above, 18 shapes: geometric mean (smallest to largest) Triton rows 1.61x (1.20x to 2.57x)
MI355X (gfx950, 256 CUs) vLLM operator, raw bf16 activation (quantisation included), M = 1 to 16, 15 shapes: geometric mean (smallest to largest) Triton rows 1.67x (1.38x to 2.37x)
MI355X (gfx950, 256 CUs) vLLM operator, raw bf16 activation (quantisation included), M = 17 to 511, 6 shapes: geometric mean (smallest to largest) Triton rows 1.62x (1.30x to 2.09x)
MI355X (gfx950, 256 CUs) vLLM operator, raw bf16 activation (quantisation included), M = 512 and above, 18 shapes: geometric mean (smallest to largest) Triton rows 1.55x (1.18x to 2.36x)

The rows for M up to 32 are what keeps this route open. With those 18 rows left out of the table the same measurement on the MI355X gives 1.00x and 1.00x over the 39 shapes of each operator: vLLM's check finds no row at M = 1 and runs its Triton GEMM in both variants.

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • Tested on MI250X
  • Tested on MI300X

Tuned on an MI350X (gfx950, 256 CUs); the A/B ran on an MI350X and on an
MI355X. The rows are gfx950 rows with cu_num 256.
python3 -m unittest op_tests.tuning_tests.test_csv_validation op_tests.tuning_tests.test_config_shape_collision:
52 tests OK on this head and on main.

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

Tuned-config rows only. The table format and the lookup are unchanged.

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Breaking Changes

No existing key changes. One limit is new for direct callers. The M = 8192 rows of N = 12800 and of N = 6400 are 8-wave kernels, and through the existing padded-M rule they also serve larger M. 8-wave kernels refuse M * N * 2 >= 2^31 with a ValueError, so a direct call with M >= 83887 at N = 12800 (M >= 167773 at N = 6400) now raises, where main ran the heuristic kernel. Calls through vLLM cannot reach that size: vLLM splits a call into chunks of at most 2^31 bytes, 83886 rows at N = 12800. The table has the same property today for N = 25600 (M >= 41944).

PR Self-Review

Reviewed revision

faf3e7f

Behavior and intent

Configuration only. For gfx950 with 256 CUs, a 2-D
gemm_a8w8_blockscale_bpreshuffle call with 32x32 e8m0 weight scales, K = 6144
and N = 12800, 6400 or 3200 found no tuned row at any M and ran the FlyDSL
batched GEMM with its heuristic kernel. These N are N = 25600 / P for P = 2, 4
and 8, the per-rank shards of the N = 25600 weight that the table already tunes
(vLLM's sharding under tensor parallel without sequence parallelism). With the
204 rows the lookup returns a measured mxpsh, 8-wave or batched-GEMM kernel for
every M (exact M or the existing padded-M walk), except N = 3200 above
M = 32768, which keeps the heuristic. No dispatch code changes. One effect
outside AITER is intended and stated: with AITER enabled, vLLM keeps its own
Triton GEMM for a 32x32 layer unless rows exist at M = 1 and M = 8192, so these
rows also move vLLM's layers with these shapes to AITER.

Validation and unverified scope

Main 82b6b4f19 was merged on 24 November. Since the earlier base main had changed this table in three commits (#7827, #7868, #8296) without touching these keys, #8296 had reworked the FlyDSL MXFP8 kernels that the rows name, and main had moved from FlyDSL 0.5.0 to 0.5.3. So all 204 rows were measured again on current main, on an MI350X and on an MI355X. The 186 rows from M = 48 kept their gain on both devices. Of the 18 rows for M up to 32, nine no longer reached 1.03x over the heuristic's kernel on both devices; the worst, M = 16 at N = 6400, was 0.87x on the MI355X and 0.97x on the MI350X. Those nine rows now name the kernel that main's heuristic picks, with the values the tuner profiled for that kernel, and the table in Performance is the measurement of the table as it is in this revision. The rows are kept because vLLM's check needs a row at M = 1, and because a row at M = 16 or 32 keeps the M below it off the M = 48 row.

Tuned with
python3 csrc/gemm_a8w8_mxfp8_bpreshuffle/gemm_a8w8_mxfp8_bpreshuffle_tune.py --mxscale_table -i <M,N,K,w_scale_block shape list> -o <scratch csv> -o2 <profile csv> --timeout 14400
on an MI350X (gfx950, 256 CUs), default
--errRatio 0.05,
AITER main 7c2fa4dae Python sources and configs on an amd-aiter 0.1.25 install, FlyDSL 0.5.0, torch 2.12.0+rocm10.0.0. 617,082 candidates were timed (594,818 mxpsh, 2,448 8-wave, 19,816 batched-GEMM). The 204 rows have errRatio at
most 0.0012. The rows were tuned at main
7c2fa4dae; the A/B and the checks below ran at main 82b6b4f19. The
OPUS kernels that #6696 added in between are tuner candidates for 128x128 scale
blocks only, so they do not compete for these 32x32 rows.

One thing differs from the stock tuner. For an (N, K) with no rows of its own,
--mxscale_table takes batched-GEMM candidates only from the heuristic pick and
its split-K neighbours, so that family would be 2 or 3 kernels per shape. We ran
the tuner with a local 16-line change, not part of this PR, that makes it also
time the kernelId=bmm kernel names of the table's other (N, K) with the same
block at M/2 to 2M, as the tuner's 1x32 mode does with its
pool, and, for M up to 32, the kernel names of the 10 rows in the closed PR
#6994. The heuristic kernel stays a candidate for every shape, so no row can
be slower than main in the tuner's own timing.

Twelve rows are not the tuner's winner: the nine of 24 November named above, and three from the first selection. The tuner gives every timed call another
copy of the weight; the A/B in Performance replays one weight. At M = 32 for
N = 12800 and for N = 3200 and at M = 64 for N = 6400 the tuner's winner, a
kernel with non-temporal weight loads, was 1.10x, 1.03x and 1.09x faster than
the heuristic kernel in the tuner's timing, and in two replay A/B runs it was
0.93x to 0.97x, 0.92x to 0.94x and 0.99x to 1.00x against main. For these three
shapes seven candidates were timed both ways (the tuner's first three, the
heuristic kernel and the fastest candidates without non-temporal loads), and
the row holds the candidate whose smaller gain of the two is the largest. At
the two M = 32 shapes that is the heuristic kernel itself: the row keeps
M = 17 to 32 on it, where these M would otherwise pad to the M = 48 row. At
M = 64 for N = 6400 it is flydsl_mxpsh_32x64x512_F8_F8_B16_w4_x4_sk1_pf
(1.04x in the tuner's timing; 1.07x on the MI350X and 1.06x on the MI355X
in the A/B above). The other 192 rows are the tuner's winners of 18 November.

Checks:

  • Paired A/B through the public operator, see Performance: 204 tuned shapes and
    87 off-grid shapes, 4 rounds each (the reducer refuses a run that lacks a
    shape or a round). For every record of the "rows" variant the lookup returned
    the kernel of the row that an offline replay of the lookup expects; the
    dispatcher passes that name to the backend (aiter/ops/gemm_op_a8w8.py,
    _gemm_mxscale_bpreshuffle). Every "main" record found no row, so it ran the
    batched-GEMM heuristic. Relative error against the dequantised float
    reference: 1.67e-03 for main and 1.67e-03 for the rows variant, on both
    devices.
  • Unrelated shapes: the table is main's table with 204 lines inserted. Every
    line of main's file is in this head's file byte for byte and in the same
    order, and this is the only file the PR touches. For the three new groups
    the padded-M lookup was replayed for M = 1 to 40000 on main's table (no row
    at any M) and on this table (a row at every M, except N = 3200 above
    M = 32768).
  • python3 -m unittest op_tests.tuning_tests.test_csv_validation op_tests.tuning_tests.test_config_shape_collision:
    52 tests OK on this head and on main.
  • AOT: GPU_ARCHS=gfx950 python -m aiter.aot.flydsl.gemm --csv on
    a table with the 204 new rows: 204 ok, 0 failed, 0 refused by the runtime; the size bisect inside the rows' M ranges compiled 347 sizes, 0 failed. Run on both devices.
  • The vLLM lines named in Motivation were read again at vLLM main f2f9edcac:
    is_mxfp8_block32_bpreshuffle_gemm_tuned makes the same check and
    engram.py is unchanged.

Not run / unverified: end-to-end serving and accuracy; a tuner run on current
main (the rows were tuned before #8296, so the A/B shows that they are not
slower than main, not that they are the best kernels main has now); M above 40000 except M = 83000 to 84000 at N = 12800, see Breaking Changes;
gfx942 and gfx1250 (no rows for them here).

PR-specific question

Keys consumed: gfx950, cu_num 256, w_scale_block 32x32, K = 6144, N in {12800,
6400, 3200}, M in the 68-value grid. Four readers use them. (1) 2-D
gemm_a8w8_blockscale_bpreshuffle calls with e8m0 scales, through
get_mxscale_bpreshuffle_config. (2) vLLM's routing check
is_mxfp8_block32_bpreshuffle_gemm_tuned, which calls the same function at
M = 1 and M = 8192 and, when both return a row, runs a layer of that (N, K) on
AITER and no longer on its Triton GEMM. (3) The AOT replay
aiter/aot/flydsl/gemm.py, which compiles the kernels the rows name. (4) The
tuner, which in --mxscale_table mode reads kernelId=bmm rows of the same N
and K as seeds. The lookup key contains N and K unpadded, so a row can only
serve calls with its own N and K; these three (N, K) had no row before, so no
call that used a row changes. Evidence: the other rows of the file are
unchanged byte for byte (merge check), the rows of every other group of the
table family are identical in main and head, and the lookup replay for the
three new groups is named above. Within the new (N, K), M values without a row
of their own pad to a neighbour: 2049 to 4096 use the M = 4096 row; for
N = 12800 and 6400 most M above 4096 use the M = 8192 row; for N = 3200, M
above 8192 uses the next power of two and M above 32768 keeps the heuristic.
The off-grid A/B times 29 such M per N.

Changed op tests

None.

@iraj465
iraj465 requested a review from a team November 18, 2026 04:05
@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 8159 --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.

@iraj465

iraj465 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

@yzhou103 this is a config-only pull request from a fork: one CSV file, 204 new rows, no code and no change to an existing row. Seven workflow runs wait for approval (Aiter Test, Checks, Triton Test, OPUS Test, Atom Test, Sglang Downstream Test and Windows Smoke Test show action_required). Could you approve them, or name the reviewer for this table? The measurements and the checks are in the description. Thank you.

@iraj465

iraj465 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

@demonsan (cc @yifehuan) could you approve the workflow runs on this one? It only adds rows to one tuned-config CSV (204 gfx950 rows for the DeepSeek-V4.1 shard GEMMs, N = 12800 / 6400 / 3200 at K = 6144), no code change. The runs are waiting on "Approve and run workflows" since it is a fork PR. Thanks!

@aiter-bot

aiter-bot commented Nov 19, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision faf3e7f9990a · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior and intent

Configuration only. For gfx950 with 256 CUs, a 2-D
`gemm_a8w8_blockscale_bpreshuffle` call with 32x32 e8m0 weight scales, K = 6144
and N = 12800, 6400 or 3200 found no tuned row at any M and ran the FlyDSL
batched GEMM with its heuristic kernel. These N are N = 25600 / P for P = 2, 4
and 8, the per-rank shards of the N = 25600 weight that the table already tunes
(vLLM's sharding under tensor parallel without sequence parallelism). With the
204 rows the lookup returns a measured mxpsh, 8-wave or batched-GEMM kernel for
every M (exact M or the existing padded-M walk), except N = 3200 above
M = 32768, which keeps the heuristic. No dispatch code changes. One effect
outside AITER is intended and stated: with AITER enabled, vLLM keeps its own
Triton GEMM for a 32x32 layer unless rows exist at M = 1 and M = 8192, so these
rows also move vLLM's layers with these shapes to AITER.

Validation and unverified scope

Main `82b6b4f19` was merged on 24 November. Since the earlier base main had changed this table in three commits (#7827, #7868, #8296) without touching these keys, #8296 had reworked the FlyDSL MXFP8 kernels that the rows name, and main had moved from FlyDSL 0.5.0 to 0.5.3. So all 204 rows were measured again on current main, on an MI350X and on an MI355X. The 186 rows from M = 48 kept their gain on both devices. Of the 18 rows for M up to 32, nine no longer reached 1.03x over the heuristic's kernel on both devices; the worst, M = 16 at N = 6400, was 0.87x on the MI355X and 0.97x on the MI350X. Those nine rows now name the kernel that main's heuristic picks, with the values the tuner profiled for that kernel, and the table in Performance is the measurement of the table as it is in this revision. The rows are kept because vLLM's check needs a row at M = 1, and because a row at M = 16 or 32 keeps the M below it off the M = 48 row.

Tuned with
`python3 csrc/gemm_a8w8_mxfp8_bpreshuffle/gemm_a8w8_mxfp8_bpreshuffle_tune.py --mxscale_table -i <M,N,K,w_scale_block shape list> -o <scratch csv> -o2 <profile csv> --timeout 14400`
on an MI350X (gfx950, 256 CUs), default
`--errRatio 0.05`,
AITER main `7c2fa4dae` Python sources and configs on an amd-aiter 0.1.25 install, FlyDSL 0.5.0, torch 2.12.0+rocm10.0.0. 617,082 candidates were timed (594,818 mxpsh, 2,448 8-wave, 19,816 batched-GEMM). The 204 rows have errRatio at
most 0.0012. The rows were tuned at main
`7c2fa4dae`; the A/B and the checks below ran at main `82b6b4f19`. The
OPUS kernels that #6696 added in between are tuner candidates for 128x128 scale
blocks only, so they do not compete for these 32x32 rows.

One thing differs from the stock tuner. For an (N, K) with no rows of its own,
`--mxscale_table` takes batched-GEMM candidates only from the heuristic pick and
its split-K neighbours, so that family would be 2 or 3 kernels per shape. We ran
the tuner with a local 16-line change, not part of this PR, that makes it also
time the `kernelId=bmm` kernel names of the table's other (N, K) with the same
block at M/2 to 2M, as the tuner's 1x32 mode does with its
pool, and, for M up to 32, the kernel names of the 10 rows in the closed PR
#6994. The heuristic kernel stays a candidate for every shape, so no row can
be slower than main in the tuner's own timing.

Twelve rows are not the tuner's winner: the nine of 24 November named above, and three from the first selection. The tuner gives every timed call another
copy of the weight; the A/B in Performance replays one weight. At M = 32 for
N = 12800 and for N = 3200 and at M = 64 for N = 6400 the tuner's winner, a
kernel with non-temporal weight loads, was 1.10x, 1.03x and 1.09x faster than
the heuristic kernel in the tuner's timing, and in two replay A/B runs it was
0.93x to 0.97x, 0.92x to 0.94x and 0.99x to 1.00x against main. For these three
shapes seven candidates were timed both ways (the tuner's first three, the
heuristic kernel and the fastest candidates without non-temporal loads), and
the row holds the candidate whose smaller gain of the two is the largest. At
the two M = 32 shapes that is the heuristic kernel itself: the row keeps
M = 17 to 32 on it, where these M would otherwise pad to the M = 48 row. At
M = 64 for N = 6400 it is `flydsl_mxpsh_32x64x512_F8_F8_B16_w4_x4_sk1_pf`
(1.04x in the tuner's timing; 1.07x on the MI350X and 1.06x on the MI355X
in the A/B above). The other 192 rows are the tuner's winners of 18 November.

Checks:

- Paired A/B through the public operator, see Performance: 204 tuned shapes and
  87 off-grid shapes, 4 rounds each (the reducer refuses a run that lacks a
  shape or a round). For every record of the "rows" variant the lookup returned
  the kernel of the row that an offline replay of the lookup expects; the
  dispatcher passes that name to the backend (`aiter/ops/gemm_op_a8w8.py`,
  `_gemm_mxscale_bpreshuffle`). Every "main" record found no row, so it ran the
  batched-GEMM heuristic. Relative error

[truncated in readiness report; see the PR description for the full answer]

PR-specific question

Keys consumed: gfx950, cu_num 256, w_scale_block 32x32, K = 6144, N in {12800,
6400, 3200}, M in the 68-value grid. Four readers use them. (1) 2-D
`gemm_a8w8_blockscale_bpreshuffle` calls with e8m0 scales, through
`get_mxscale_bpreshuffle_config`. (2) vLLM's routing check
`is_mxfp8_block32_bpreshuffle_gemm_tuned`, which calls the same function at
M = 1 and M = 8192 and, when both return a row, runs a layer of that (N, K) on
AITER and no longer on its Triton GEMM. (3) The AOT replay
`aiter/aot/flydsl/gemm.py`, which compiles the kernels the rows name. (4) The
tuner, which in `--mxscale_table` mode reads `kernelId=bmm` rows of the same N
and K as seeds. The lookup key contains N and K unpadded, so a row can only
serve calls with its own N and K; these three (N, K) had no row before, so no
call that used a row changes. Evidence: the other rows of the file are
unchanged byte for byte (merge check), the rows of every other group of the
table family are identical in main and head, and the lookup replay for the
three new groups is named above. Within the new (N, K), M values without a row
of their own pad to a neighbour: 2049 to 4096 use the M = 4096 row; for
N = 12800 and 6400 most M above 4096 use the M = 8192 row; for N = 3200, M
above 8192 uses the next power of two and M above 32768 keeps the heuristic.
The off-grid A/B times 29 such M per N.

Changed op tests

None.

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply
  • ADVISORY — Copilot did not review the current head SHA

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed
  • PASS — Aiter Test Gate: passed

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

… and 3200 (K = 6144)

Add 204 gfx950 rows (cu_num 256, w_scale_block 32x32) for N = 12800, 6400
and 3200 at K = 6144 to
aiter/configs/model_configs/dsv41_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv,
at the 68 M values the table already uses. These N are N = 25600 / P for
P = 2, 4 and 8: the per-rank shards, in vLLM under tensor parallel without
sequence parallelism, of the N = 25600, K = 6144 weight the table already
tunes. They had no row. A direct gemm_a8w8_blockscale_bpreshuffle call ran
the FlyDSL batched-GEMM heuristic, and vLLM kept its own Triton GEMM for
these layers, because it routes a 32x32 layer to AITER only when rows exist
at M = 1 and M = 8192.

Rows only. No existing row changes.

Signed-off-by: Saptarshi Majumder <[email protected]>
@iraj465
iraj465 force-pushed the config/dsv41-mxfp8-gemm-tp-shard-rows branch from 92609b2 to 8f4ae39 Compare November 20, 2026 06:26
@iraj465
iraj465 marked this pull request as draft November 20, 2026 20:05
@iraj465
iraj465 marked this pull request as ready for review November 20, 2026 20:05
@iraj465

iraj465 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@yifehuan this one is config-only as well: 204 new gfx950 rows for the DeepSeek-V4.1 shard GEMMs (N = 12800 / 6400 / 3200 at K = 6144), and no existing row is changed. Could you approve the workflows so that CI can run? Thanks!

@iraj465
iraj465 marked this pull request as draft November 24, 2026 05:53
Measured again on main 82b6b4f (after ROCm#8296 reworked the FlyDSL MXFP8
kernels, with FlyDSL 0.5.3) on an MI355X and an MI350X. The 186 rows from
M = 48 keep their gain on both. Of the 18 rows for M up to 32, nine no
longer reach 1.03x over the kernel the heuristic picks on both devices, one
of them (N = 6400, M = 16) is slower on both. Those nine now name that
kernel, with the values the tuner profiled for it, as the rows for M = 32 at
N = 12800 and 3200 already do. The rows stay because vLLM routes these
layers to AITER only when a row exists at M = 1 and at M = 8192.

Signed-off-by: Saptarshi Majumder <[email protected]>
@iraj465
iraj465 marked this pull request as ready for review November 24, 2026 06:43
@iraj465

iraj465 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@yifehuan @demonsan an update, because main changed under these rows. #8296 reworked the FlyDSL MXFP8 kernels that the rows name, and main moved from FlyDSL 0.5.0 to 0.5.3. So I measured all 204 rows again on current main (82b6b4f19), on an MI350X and on an MI355X, and pushed the result with main merged (head faf3e7f99):

  • The 186 rows from M = 48 keep their gain on both devices.
  • Of the 18 rows for M up to 32, nine no longer reached 1.03x over the heuristic's kernel on both devices; the worst, M = 16 at N = 6400, was 0.87x on the MI355X and 0.97x on the MI350X. Those nine rows now name the kernel that the heuristic picks. They stay in the table because vLLM routes these layers to AITER only when a row exists at M = 1 (with the 18 rows left out, vLLM stays on its Triton GEMM).
  • With the table as it is now, 193 of the 204 shapes are 1.04x to 2.17x over main on the MI350X and 1.03x to 2.37x on the MI355X, none of them slower in any round; the other 11 run main's kernel. Through vLLM's operator the rows are 1.11x to 2.67x faster than its Triton GEMM, none slower.

The description has the new tables for both devices. One thing I have not done is a tuner run on current main: the rows were tuned before #8296, so the measurement shows that they are not slower than main, not that they are the best kernels main has now. The workflows need an approval on the new head.

@demonsan demonsan 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

@iraj465

iraj465 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@demonsan thanks for the review, and @yifehuan thanks for starting the workflows. The one red shard of the Aiter Test (Standard Tests 8/1) did not fail in a test: its runner dropped out at 17:59 UTC ("The self-hosted runner lost communication with the server"), in the same minute as shards of other pull requests, so there is no log for it. The other seven shards, Checks, Triton Test and OPUS Test passed. Could one of you re-run the failed job? Nothing needs to change in the branch.

@iraj465

iraj465 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@demonsan @yifehuan thanks for the re-run. It is green now: all eight standard shards and the gate have passed, next to Checks, Triton Test and OPUS Test. Could one of you help merge it?

@yifehuan
yifehuan merged commit 72ebef9 into ROCm:main Nov 26, 2026
109 of 123 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants