Skip to content

[job] GB10: raise the Atlas tensor-core GEMM ceiling (29-39 vs cuBLAS 75-206 TFLOP/s) #71

Open

Description

@AzeezIsh

Status (updated 2026-09-29 12:22Z)

State: a template rewrite is still open. The cuBLASLt route is measured as the interim.

  • Measured (reiner 622/623, main 10d4ec718, n=3):

    • 27B with ATLAS_CUBLAS_GEMM=1: TTFT −33% at 10k (15.71 → 10.47 s) and −31% at 31.5k (53.00 → 36.83 s). ppl is +0.047% below the QSA bound and flat above it, and greedy output is identical.
    • Flash-Next: no change; the route doesn't engage on its projections.
    • ATLAS_CUBLAS_FP8=1: broken on the 27B (AlgoGetHeuristic status 15, 0-token responses).
  • ATLAS_CUBLAS_GEMM=1 can't boot the 27B DFlash2 recipes (reiner 644, main b03dc7363). The lever reserves 15.6 GB for lazy BF16 weight copies, and there isn't room for it:

    • util 0.70 (the concurrency sweep): 73.9 GB consumed + 15.6 GB = 90.1 GB committed, against an 83.7 GB budget;
    • util 0.80 (the ST-995 recipe): 108.3 GB against 95.7 GB.

    Both refuse with "No memory left for KV cache". So step 1 below ends here: the lever can't ship on by default for the 27B while the DFlash2 drafter is loaded, unless the BF16 copies shrink (for example, only the GEMMs cuBLAS actually wins on).

  • Next:

    1. Fix or remove the FP8 route (AlgoGetHeuristic status 15).
    2. The real job: dense_gemm_bf16_pipelined and the MoE grouped GEMM at ≥ 60 TFLOP/s. That would make the BF16 copies unnecessary.

Kind

Feature for a model we already support

Model

all GB10 targets (measured on Qwen3.8-Flash-Next and 27B)

What's the job?

Raise the ceiling of Atlas's tensor-core GEMM templates. On an idle GB10 at the shapes a 29.7k prefill launches, every Atlas TC kernel lands at 29-39 TFLOP/s while cuBLAS does 75-99 (BF16) and 135-206 (FP8) on the same shapes (roofline.py). The template is 2-stage cp.async, 128-thread CTAs, M_TILE 64, barrier-separated dequant. Reference implementations: FlashInfer / CUTLASS SM120 block-scaled grouped GEMM, vLLM cutlass_moe_fp4. Done = dense_gemm_bf16_pipelined and the MoE grouped GEMM ≥ 60 TFLOP/s at those shapes, byte-identical greedy + ppl within noise.

Impact radius

Shared code, other models could change

What else could it touch?

Every model's prefill: dense_gemm, w4a16_gemm, the MoE grouped GEMM (symlinked across 7 targets).

Who's waiting or willing to test?

@AzeezIsh (GB10)

Activity

  1. added
    job
    on Sep 25, 2026
  2. changed the title [-][job] Qwen3.8-Flash-Next: decode speed — MTP past the QSA bound, draft-vocab slicing, decode graphs[/-] [+][job] GB10: raise the Atlas tensor-core GEMM ceiling (29-39 vs cuBLAS 75-206 TFLOP/s)[/+] on Sep 25, 2026
  3. AzeezIsh commented on Sep 25, 2026

    @AzeezIsh
    ContributorAuthor

    First concrete piece: #77 — cuBLASLt was building descriptors/layouts and running AlgoGetHeuristic on every BF16 GEMM call; now cached per shape (bit-identical by construction). Validation queued as reiner job 255 (build + clippy + CUTLASS-vs-cuBLASLt GPU tests + 27B greedy identity/TTFT). Same bottleneck class found on Strix (#72): the two prefill GEMMs (w4a16_gemm_t_m128 47 %, w8a16_gemm_n_m128 30 %) run at ~15-16 TFLOP/s, ~27 % of gfx1151 WMMA peak.

  4. AzeezIsh commented on Sep 26, 2026

    @AzeezIsh
    ContributorAuthor

    The ATLAS_CUBLAS_GEMM / ATLAS_CUTLASS_GEMM / ATLAS_FP8_ROWWISE lazy BF16-copy OOM hazard now has a fix: #83. It reserves those copies in the KV budget at boot (routed experts excluded), and a config that cannot fit refuses at boot instead of hanging the box. With the flags off, nothing changes. #77 is closed: it was correct but produced no gain. Validation: reiner job 274, arm C71 (27B at util 0.88, the job 262 case). The GEMM-ceiling work itself stays open here.

  5. added a commit that references this issue on Sep 26, 2026
  6. AzeezIsh commented on Sep 26, 2026

    @AzeezIsh
    ContributorAuthor

    The lazy FP8→BF16 copy hazard that #77 exposed (ATLAS_CUBLAS_GEMM / CUTLASS_GEMM / FP8_ROWWISE materialising BF16 copies outside the KV budget) is fixed by #83, now merged. The reserve is derived from the resident FP8 matrices; routed experts are excluded because they use MoE kernels. With it, the 27B cuBLAS boot at util 0.88 keeps 17.4 GB MemAvailable, where it previously left 2.1 GB and was killed (job 274). The GEMM-ceiling work itself (tensor-core throughput) is still open here.

  7. AzeezIsh commented on Sep 26, 2026

    @AzeezIsh
    ContributorAuthor

    Triage (2026-09-26). This is the most leveraged open job, and the only one with no forward progress yet.

    The same bottleneck class caps three other jobs:

    Proposal: make this the GB10 kernel priority for the next ~3 weeks. The cleanup work ahead of it in the roadmap is done: #68 landed and the train is merged.

    • First deliverable: a microbench of an mxf4nvf4 MoE kernel over the resident [N,K/2] layout (no dequant, no transpose) against cuBLAS on the 29.7k shapes, before any serve integration.
    • Prerequisite (roadmap W0.3): ncu on reiner, which needs NVreg_RestrictProfilingToAdminUsers=0 and a reboot. Is it unblocked yet? Two earlier retractions came from inferred limiters.
  8. AzeezIsh commented on Sep 27, 2026

    @AzeezIsh
    ContributorAuthor

    Design consult (Qwen3.8-Max), checked against our own measurements. This is the first concrete kernel plan for the MoE half of this job.

    Starting point (measured):

    • MoE is 154 TFLOP, 73 % of a 29.7k prefill, running at 26.4 TFLOP/s. cuBLAS does 75.5 (BF16) and 156 (FP8) at the hot expert shape.
    • Stubbing the FP4→e4m3 dequant saves 1.96 s (18.46 → 16.49 s).
    • The mxf4nvf4 twin over the transposed _t table was a wash (gate_up 2678 → 2662 ms, down 1891 → 1975 ms): it pays for a transpose instead of the dequant.
    • The checkpoint's original [N, K/2] e2m1 weights with [N, K/16] e4m3 scales are already resident for decode. That is the block-scaled B / SFB layout the MMA wants.

    Proposed kernel (Qwen's design; I checked the arithmetic):

    • CTA M64×N128×K64, 4 warps, mma.sync … kind::mxf4nvf4.block_scale m16n8k64, f32 accumulate.
    • B read straight from the resident layout: 128 rows × 32 B per K64 step, 16 B cp.async pairs, B-scales [128, 4] alongside, smem rows swizzled to 64 B. No transpose.
    • Per-stage smem: A 2,048 + A-scale 256 + B 4,096 + B-scale 512 = 6.9 KB. 6 stages ≈ 41.5 KB (≈ 45 KB with barriers), so still 2 CTAs/SM.
    • The MMA → barrier → DEQUANT → barrier serialisation goes away; scales arrive in the same stage.
    • Ragged M: a grouped tile list Σ⌈M_e/64⌉ × 10 N-tiles, skipping empty experts. That's the qwen4_exp: land the 2026-08-31 long-context TTFT campaign (QSA tensor cores, mHC grid fix, MoE CTA striding) #68 CTA-striding lesson, done natively instead of 1.1 M empty CTAs. Add an M32 variant for experts under 48 rows. No split-K, since it re-reads weights.
    • Reference: CUTLASS SM120 block-scaled grouped GEMM for the mainloop, vLLM cutlass_moe_fp4 for the permutation, scheduler and epilogue.
    • Qwen's target: 75–90 TFLOP/s effective over the ragged MoE, against 26.4 today. Projection, not measured.

    The real decision here is precision, and Qwen's plan glosses over it.

    Order:

    1. A standalone microbench against cuBLAS on the 29.7k shapes (roofline.py), before any serve integration.
    2. A precision A/B on one layer's real activations.
    3. Then serve.

    This is the single largest structural lever in #74 as well.

  9. AzeezIsh commented on Sep 28, 2026

    @AzeezIsh
    ContributorAuthor

    cuBLASLt prefill on main 10d4ec7, reiner jobs 622 and 623 (2026-09-28).

    Setup: campaign serve with bf16 KV, no prefix cache, thinking off. TTFT is the median of 3 cold prefills. ppl is the paired 8-window check.

    27B NVFP4, default (D) vs ATLAS_CUBLAS_GEMM=1 (C, BF16 cached dequant):

    • TTFT at 10k: 15.71 s → 10.47 s (−33 %).
    • TTFT at 31.5k: 53.00 s → 36.83 s (−31 %).
    • ppl: 3.79930 → 3.80107 below the QSA bound (+0.047 %), and 2.38727 → 2.38729 above it.
    • Greedy output identical on the 3 needle probes.
    • Observed on one fingerprint, n=3 per arm. Before any default change it needs an ST-995 run and a memory/concurrency check.

    Flash-Next: C and F are identical to default in TTFT and ppl; the routes don't engage on its projections.

    ATLAS_CUBLAS_FP8=1 is broken on the 27B.

    • Every prefill fails with Prefill chunk layer 0 failed: cuBLASLt AlgoGetHeuristic failed: status 15 (NOT_SUPPORTED).
    • Requests come back with 0 tokens (job 623 F arm, 35 errors), and the job-622 serve never passed its warmup request.
    • Because it's opt-in, I'd make it fail fast at startup when the heuristic probe refuses, instead of erroring on every request.

    ATLAS_CUBLAS_GEMM=1 with DFlash2 at --gpu-memory-utilization 0.70: refuses to boot (No memory left for KV cache ... + 15.6 GB lazy BF16 reserve). The BF16 copies need a higher utilization in the DFlash2 recipe; not measured yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    job

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions