Skip to content

Swap the cache config for the default cases of gfx1250-GEMM-A8W8_BLOCKSCALE.json#4359

Open
jpvillam-amd wants to merge 1 commit into
mainfrom
jpvillam/gfx1250_triton_defaultcache
Open

Swap the cache config for the default cases of gfx1250-GEMM-A8W8_BLOCKSCALE.json#4359
jpvillam-amd wants to merge 1 commit into
mainfrom
jpvillam/gfx1250_triton_defaultcache

Conversation

@jpvillam-amd

Copy link
Copy Markdown

Motivation

Speed up vLLM DeepseekV4-Flash

Technical Details

ca shows much higher decode throughput

Test Plan

tested on lm_eval with around an 8x improvement e2e and micro benchmark

│  #!/usr/bin/env python3
│  """Micro-benchmark: cache_modifier ".cg" vs ".ca" in aiter's gfx1250 block-scale
│  FP8 GEMM, at decode-sized M. Self-contained (torch + aiter only)."""
│  import time, copy, torch
│  from aiter.ops.triton.gemm.basic.gemm_a8w8_blockscale import gemm_a8w8_blockscale
│
│  N, K, M = 8192, 4096, 8                       # a DeepSeek-V4-Flash wo_a shape, decode M
│  dev = torch.device("cuda")
│
│  A  = torch.randn(M, K, device=dev).to(torch.float8_e4m3fn)
│  B  = torch.randn(N, K, device=dev).to(torch.float8_e4m3fn)
│  As = torch.ones(M, K // 128, device=dev)      # fp32 block scales
│  Bs = torch.ones(N // 128, K // 128, device=dev)
│
│  cfg = dict(BLOCK_SIZE_M=16, BLOCK_SIZE_N=32, BLOCK_SIZE_K=128, GROUP_SIZE_M=1,
│             num_warps=2, num_stages=2, waves_per_eu=1, matrix_instr_nonkdim=16, NUM_KSPLIT=1)
│
│  def bench(cache_modifier, iters=100):
│      c = dict(cfg, cache_modifier=cache_modifier)
│      run = lambda: gemm_a8w8_blockscale(A, B, As, Bs, dtype=torch.bfloat16,
│                                         config=copy.deepcopy(c), backend="gluon")
│      run(); torch.cuda.synchronize()           # warm up / JIT compile
│      t = time.perf_counter()
│      for _ in range(iters): run()
│      torch.cuda.synchronize()
│      return (time.perf_counter() - t) / iters * 1e3   # ms
│
│  cg = bench(".cg")
│  ca = bench(".ca")
│  print(f"shape (M={M}, N={N}, K={K})")
│  print(f".cg : {cg:.3f} ms")
│  print(f".ca : {ca:.3f} ms")
│  print(f"speedup: {cg/ca:.1f}x")

Test Result

.cg : 2.321 ms
.ca : 0.048 ms
speedup: 48.5x

Submission Checklist

@jpvillam-amd jpvillam-amd self-assigned this Jul 23, 2026
@jpvillam-amd
jpvillam-amd requested a review from a team July 23, 2026 20:06
@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:triton-300x Run an additional Triton test job on MI300X in PRs; main branch always runs both MI35X and MI300X
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 4359 --add-label <label>

@azaidy
azaidy requested a review from k50112113 July 23, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant