Skip to content

[Perf] beam: Add optional cuTile BF16x3 router GEMM - #45361

Draft
Jiminator wants to merge 8 commits into
beam-stack-deps-tileirasfrom
beam-stack-06-cutile-router
Draft

Jiminator wants to merge 8 commits into
beam-stack-deps-tileirasfrom
beam-stack-06-cutile-router

Conversation

@Jiminator

@Jiminator Jiminator commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Beam's router multiplies BF16 hidden states by an FP32 gate in each of its 49 MoE layers. #45256 runs it with the tiny FP32 GEMM, the GEMV and the cuBLAS BF16x3 GEMM. This part adds the cuTile BF16x3 router GEMM from #44747 and makes it Beam's default router on Hopper and SM10x Blackwell.

It's optional: without it, Beam serves on the cuBLAS router. It needs the tileiras compiler, which is #45290. Position 7 of 7 in the merge order below. It is based on #45290's branch (beam-stack-deps-tileiras), so its diff shows only this part.

Modifications

  • kernels/ops/gemm/router_gemm_cutile.py: BF16 activations × FP32 router weights → FP32 logits. It uses a three-part BF16 split of the weight prepared at load time, and combines K tiles with explicit FP32 rounding. Small batches use split-K plus a reduction.
  • models/beam.py:
    • BeamRouterLinearMethod refreshes the split weight in place after weight loading, so captured graphs see updated weights.
    • Above the tiny FP32 GEMM's 16 tokens, the router uses cuTile.
    • FP8 and NVFP4 checkpoints also keep the tiny FP32 GEMM when cuTile is on.
  • Shared splitter ownership: Beam and the cuBLAS wrapper import split_fp32_to_bf16x3 from ops.quantization.bf16x3_split, registered as quantization.split_fp32_to_bf16x3. The old inline splitter, GEMM inventory entry and shared split scratch are removed. This branch carries the canonical module from [Feat] kernels: Beam model support #45254 until its later restack; the existing out=parts use is unchanged.
  • SGLANG_BEAM_ROUTER_BACKEND chooses cutile (default), cublas or torch.
  • The kernel is registered in the kernel inventory as gemm.router_gemm_bf16x3, with a new cutile KernelBackend provenance value (and the matching forward_cutile stub in BaseFusedOp), for SM90 through SM10x.

This part adds no test code. The recorded GB300 serving runs below belong to earlier revisions.

This part changes 9 files (+340 / -64) relative to its #45290 base branch.

Validation

The splitter migration in 4a8c0cde40 has not been reverified, as requested. No tests, lint, pre-commit, import/compilation smoke, GPU checks or benchmarks were run for that update. CuTile arithmetic and model dispatch are unchanged; this was a targeted ownership migration, not a full stack restack.

Historical results

The results below come from earlier revisions, before 4a8c0cde40. They do not establish verification of the latest update.

Merge order

Each part is based on the one before it, so its diff shows only its own changes. Merge bottom-up; after each part merges, the next part is retargeted to main and main is merged into it. #44747 stays open, unchanged, as the full reference. Merge in this order:

  1. [Chore] docker: Add Beam CUDA image (1/8) #45253 — Beam CUDA Docker image (merged)
  2. [Chore] deps: Bump the OpenAI SDK to 2.8.0 for Responses shell tools (2/8) #45291 — OpenAI SDK 2.8.0, needed by the Responses shell tools in [Feat] parser: Add Beam reasoning, tool calls and response templates (5/7) #45257 (merged)
  3. [Feat] kernels: Beam model support #45254 — Kernels
  4. [Feat] beam: Add Beam model, runtime support and checkpoints (4/7) #45256 — Attention, memory and DFlash DP support, and the Beam model ([Feat] srt: Add attention, memory and DFlash DP support for Beam (4/8) #45255 folded in; also after [Fix] nccl: Disable graph buffer registration whenever a captured graph can hold a collective #43216)
  5. [Feat] parser: Add Beam reasoning, tool calls and response templates (5/7) #45257 — Beam reasoning, tool calls, response templates and the Beam E2E test (merged into [Feat] beam: Add Beam model, runtime support and checkpoints (4/7) #45256)
  6. [Chore] deps: Add nvidia-cuda-tileiras for the optional cuTile router #45290 — nvidia-cuda-tileiras, needed by [Perf] beam: Add optional cuTile BF16x3 router GEMM #45361
  7. [Perf] beam: Add optional cuTile BF16x3 router GEMM #45361 — cuTile BF16x3 router GEMM (optional: without it Beam uses the cuBLAS router)

#45292 (Dynamo and grpcio-tools pins for the Beam image) is not in the merge order for now.


CI States

Latest PR Test (Base): ❌ Run #40183433366
Latest PR Test (Extra): ❌ Run #40183433293
Latest PR Test (AMD ROCm 10): ❌ Run #40183433398

Add the cuTile BF16x3 router GEMM with load-time split weights and
make it Beam's default router on Hopper and Blackwell, with
SGLANG_BEAM_ROUTER_BACKEND=cublas|cutile|torch to choose. FP8 and
NVFP4 checkpoints keep the tiny FP32 GEMM when cuTile is on. Needs
the tileiras compiler.
@Jiminator Jiminator changed the title [Perf] beam: Use the cuTile BF16x3 router GEMM (8/8) [Perf] beam: Use the cuTile BF16x3 router GEMM (7/7) Oct 21, 2026
@mintlify

mintlify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
sglang-doc 🟢 Ready View Preview Oct 21, 2026, 7:56 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file labels Oct 21, 2026
@Jiminator
Jiminator changed the base branch from main to beam-stack-deps-tileiras October 21, 2026 19:51
@Jiminator Jiminator changed the title [Perf] beam: Use the cuTile BF16x3 router GEMM (7/7) [Perf] beam: Add optional cuTile BF16x3 router GEMM Oct 26, 2026

This branch was successfully deployed

1 active (outdated) deployment
staging - docs — 0dac8bde Deployed Oct 21, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blackwell SM100/SM120 dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation hicache Hierarchical Caching for SGLang jit-kernel memory-pool quant LLM Quantization speculative-decoding unified-radix-cache

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant