Skip to content

[benchmarks] Publish and exercise the B200 CuTe Flash MLA preset in CI - #4764

Open
choijon5 wants to merge 1 commit into
choijon5/helion-b200/mla/4from
choijon5/helion-b200/mla/5
Open

choijon5 wants to merge 1 commit into
choijon5/helion-b200/mla/4from
choijon5/helion-b200/mla/5

Conversation

@choijon5

@choijon5 choijon5 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Stacked PRs:


[benchmarks] Publish and exercise the B200 CuTe Flash MLA preset in CI

Add an opt-in DeepSeek-V3 MLA decode preset for one request, one query,
16 heads and a (1, 1024) int32 page table. It wraps the same DSL function
as Triton, with a persistent eight-stage gathered-page pipeline. The
shipped Triton kernel and configuration stay available.

Check real/fake geometry, actual query/KV alignment and int32 index
eligibility, including the KV pool's element count. Refuse unresolved
negative views on the raw-storage path. Context lengths and signed page
IDs remain runtime data, including on graph replay.

Report CuTe as its own B200 nightly benchmark against both the shipped
Triton preset and FlashInfer. Keep inputs, outputs and provider-owned
workspace alive until timing finishes, and verify all three graphs against
the FP32 reference before and after timing. The Triton row keeps its kernel
and configuration and benefits from the corrected capture lifetimes.
On GitHub's SM100 CuTe lane, missing NVRTC/cooperative groups support
fails the preset's numerical test rather than silently skipping it.

Testing: scripts/run_tests.py on B200 4 passed the two CuTe signed-replay
and fullgraph/Inductor alignment tests, including the slow one. A fresh
cache run of the PR-tier signed numerical on that device took 5.58 s
in the test body. The scoped CuTe CPU lane passed six metadata,
prerequisite, reference and dashboard tests; the Triton CPU lane passed
three with two CuTe-only skips. Strict lint and Pyrefly passed.
The actual nightly CLI at context 1024 reported CuTe 16.22 us, Triton
16.26 us and FlashInfer 18.18 us for complete CUDA graph replay (B200 4,
PyTorch 2.15.0.dev20260814, CuTe DSL 4.8.1, FlashInfer 0.7.0.post1).
CuTe/Triton are effectively tied in this sample. Separately, cold-L2 CUPTI
device spans at the published setup were 9.760/9.856 us for CuTe versus
10.432/10.416 for Triton and 14.048/14.016 for FlashInfer in reversed
capture orders; those numbers do not measure complete graph replay.

Review notes:

  • Deferred: upstream CPP_FAKETENSOR=1 cannot bind with the Python cache
    hook. KNOWN_GAPS.md, cpp-fake-mode-tile-provenance. Simply omitting
    the hook loses three tile IDs; using a private Python mode passes six
    eager controls but outer strict C++ fakes still reach raw pointer
    queries in real captures and alias keys, so that constructor-only
    workaround does not safely support the process-wide mode.
  • Deferred: shipped raw-pointer dispatch can ignore lazy-negative
    operands on origin/main. KNOWN_GAPS.md, triton-raw-storage-lazy-negative-inputs.
    The new explicit CuTe preset always rejects these views. A general
    policy for aliased inputs, in-place writes and graph dispatch would
    change other kernels' public contract.
    The verified entry includes the original four tensors and scale and the
    caller-side resolve_neg workaround. An attempted selector-only guard
    still returned the wrong value in both warm compile and disabled modes.
    A local source-body normalization is a change to the shared authored
    function; the new CuTe entry is guarded without changing that function.

autoreview passed: claude, codex

choijon5 added a commit that referenced this pull request Nov 26, 2026
Keep the shipped flash_mla Triton entry. Publish flash_mla_cute from the
same DSL function for one query, 16 heads and a (1, 1024) int32 block
table. The CuTe config uses a persistent launch and an eight-stage page
ring. The key checks the actual SM100 cooperative-grid compiler leaf and
the physical query/KV alignment. Reject lazy negative views: the raw
launch reads storage, so accepting a negated view would give the unchanged
result. Context lengths and page IDs are still read at execution.

Dynamo binds fake tensors to infer the result before storage exists. Give
that speculative bind a separate key and check any concrete operand in a
mixed bind normally. Eager execution checks the actual pointer; Inductor
may realign graph inputs before invoking the launch.

The benchmark keeps inputs, outputs and provider-owned workspace alive
until timing finishes. Replay each provider against the FP32 reference
before timing and once more after the thermal warmup and timed sweep.

Testing: batch 1/context 1024 on B200 4. On the integrated eight-stage
preset after the core rename and graph input-lifetime fixes, 160 interleaved
cold-L2 CUPTI samples per provider and capture order gave CuTe
9.760/9.856 us, shipped Triton 10.432/10.416 us and FlashInfer
14.048/14.016 us. These are device kernel spans. Both runs used stock
Torch 2.15.0.dev20260814, CuTe DSL 4.8.1 and FlashInfer 0.7.0.post1.
The program was checked at nine context lengths with changed/restored
signed pages (-1 and -extent) in the same capture; max absolute error
was 0.00390625. A host-zeroed eight-stage control took 11.040/11.136 us,
slower than Triton in both orders.

For complete graph replay, run
python pretuned_kernels/megakernels/flash_mla/flash_mla.py --cute.
With the capture owners retained through warmup and timing, the three
CUDA-event comparisons (CuTe / Triton / FlashInfer, us) were
16.16 / 16.16 / 18.18, 16.29 / 16.29 / 18.27 and
14.21 / 16.16 / 16.38 on B200 4. All three provider outputs passed
before and after each timed sweep. Complete replay ranged from parity
to 1.14x against Triton; the CUPTI spans are kernel time only.
The old benchmark released the query, KV, sequence lengths, block table
and FlashInfer callable before warmup. Do not use its event timings.

26,237 CuTe CPU and 16,148 GPU tests (B200 1/2), 4,904 Triton CPU
and 3,394 GPU tests (B200 3), and 269 Pallas interpreter tests (44
skipped) passed on the integration preceding the direct-ConfigSpec probe and
host-loader changes; that Triton run also includes an isolated host-test device model.
Public graph, eager HOP and
Inductor alignment/signed-page tests passed. The graph lifetime repair
was checked separately on B200 4 and did not change kernel generation
or dispatch. Lint and Pyrefly passed.

Review notes:
- Deferred: upstream CPP_FAKETENSOR=1 cannot bind with the Python cache
  hook. KNOWN_GAPS.md, cpp-fake-mode-tile-provenance. Simply omitting
  the hook loses three tile IDs; using a private Python mode passes six
  eager controls but outer strict C++ fakes still reach raw pointer
  queries in real captures and alias keys, so that constructor-only
  workaround does not safely support the process-wide mode.
- Deferred: shipped raw-pointer dispatch can ignore lazy-negative
  operands on origin/main. KNOWN_GAPS.md, triton-raw-storage-lazy-negative-inputs.
  The new explicit CuTe preset always rejects these views. A general
  policy for aliased inputs, in-place writes and graph dispatch would
  change other kernels' public contract.
  The verified entry includes the original four tensors and scale and the
  caller-side resolve_neg workaround. An attempted selector-only guard
  still returned the wrong value in both warm compile and disabled modes.
  A local source-body normalization is a change to the shared authored
  function; the new CuTe entry is guarded without changing that function.

autoreview passed: claude, codex

stack-info: PR: #4764, branch: choijon5/helion-b200/mla/5
@choijon5
choijon5 force-pushed the choijon5/helion-b200/mla/4 branch from bf985ae to b4b38de Compare November 26, 2026 16:25
@choijon5
choijon5 force-pushed the choijon5/helion-b200/mla/5 branch from 18ae744 to 8c0456a Compare November 26, 2026 16:25
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 26, 2026
@choijon5
choijon5 marked this pull request as draft November 26, 2026 17:05
@choijon5
choijon5 changed the base branch from choijon5/helion-b200/mla/4 to choijon5/helion-b200/shared/11 November 26, 2026 17:05
choijon5 added a commit that referenced this pull request Nov 26, 2026
Keep the shipped flash_mla Triton entry. Publish flash_mla_cute from the
same DSL function for one query, 16 heads and a (1, 1024) int32 block
table. The CuTe config uses a persistent launch and an eight-stage page
ring. The key checks the actual SM100 cooperative-grid compiler leaf and
the physical query/KV alignment. Reject lazy negative views: the raw
launch reads storage, so accepting a negated view would give the unchanged
result. Context lengths and page IDs are still read at execution.

Dynamo binds fake tensors to infer the result before storage exists. Give
that speculative bind a separate key and check any concrete operand in a
mixed bind normally. Eager execution checks the actual pointer; Inductor
may realign graph inputs before invoking the launch.

The benchmark keeps inputs, outputs and provider-owned workspace alive
until timing finishes. Replay each provider against the FP32 reference
before timing and once more after the thermal warmup and timed sweep.

Testing: batch 1/context 1024 on B200 4. On the integrated eight-stage
preset after the core rename and graph input-lifetime fixes, 160 interleaved
cold-L2 CUPTI samples per provider and capture order gave CuTe
9.760/9.856 us, shipped Triton 10.432/10.416 us and FlashInfer
14.048/14.016 us. These are device kernel spans. Both runs used stock
Torch 2.15.0.dev20260814, CuTe DSL 4.8.1 and FlashInfer 0.7.0.post1.
The program was checked at nine context lengths with changed/restored
signed pages (-1 and -extent) in the same capture; max absolute error
was 0.00390625. A host-zeroed eight-stage control took 11.040/11.136 us,
slower than Triton in both orders.

For complete graph replay, run
python pretuned_kernels/megakernels/flash_mla/flash_mla.py --cute.
With the capture owners retained through warmup and timing, the three
CUDA-event comparisons (CuTe / Triton / FlashInfer, us) were
16.16 / 16.16 / 18.18, 16.29 / 16.29 / 18.27 and
14.21 / 16.16 / 16.38 on B200 4. All three provider outputs passed
before and after each timed sweep. Complete replay ranged from parity
to 1.14x against Triton; the CUPTI spans are kernel time only.
The old benchmark released the query, KV, sequence lengths, block table
and FlashInfer callable before warmup. Do not use its event timings.

26,237 CuTe CPU and 16,148 GPU tests (B200 1/2), 4,904 Triton CPU
and 3,394 GPU tests (B200 3), and 269 Pallas interpreter tests (44
skipped) passed on the integration preceding the direct-ConfigSpec probe and
host-loader changes; that Triton run also includes an isolated host-test device model.
Public graph, eager HOP and
Inductor alignment/signed-page tests passed. The graph lifetime repair
was checked separately on B200 4 and did not change kernel generation
or dispatch. Lint and Pyrefly passed.

Review notes:
- Deferred: upstream CPP_FAKETENSOR=1 cannot bind with the Python cache
  hook. KNOWN_GAPS.md, cpp-fake-mode-tile-provenance. Simply omitting
  the hook loses three tile IDs; using a private Python mode passes six
  eager controls but outer strict C++ fakes still reach raw pointer
  queries in real captures and alias keys, so that constructor-only
  workaround does not safely support the process-wide mode.
- Deferred: shipped raw-pointer dispatch can ignore lazy-negative
  operands on origin/main. KNOWN_GAPS.md, triton-raw-storage-lazy-negative-inputs.
  The new explicit CuTe preset always rejects these views. A general
  policy for aliased inputs, in-place writes and graph dispatch would
  change other kernels' public contract.
  The verified entry includes the original four tensors and scale and the
  caller-side resolve_neg workaround. An attempted selector-only guard
  still returned the wrong value in both warm compile and disabled modes.
  A local source-body normalization is a change to the shared authored
  function; the new CuTe entry is guarded without changing that function.

autoreview passed: claude, codex

stack-info: PR: #4764, branch: choijon5/helion-b200/mla/5
@choijon5
choijon5 force-pushed the choijon5/helion-b200/mla/5 branch from 8c0456a to 25d61de Compare November 26, 2026 17:05
@choijon5
choijon5 changed the base branch from choijon5/helion-b200/shared/11 to choijon5/helion-b200/mla/4 November 26, 2026 17:05
@choijon5
choijon5 marked this pull request as ready for review November 26, 2026 17:06
Add an opt-in DeepSeek-V3 MLA decode preset for one request, one query,
16 heads and a (1, 1024) int32 page table. It wraps the same DSL function
as Triton, with a persistent eight-stage gathered-page pipeline. The
shipped Triton kernel and configuration stay available.

Check real/fake geometry, actual query/KV alignment and int32 index
eligibility, including the KV pool's element count. Refuse unresolved
negative views on the raw-storage path. Context lengths and signed page
IDs remain runtime data, including on graph replay.

Report CuTe as its own B200 nightly benchmark against both the shipped
Triton preset and FlashInfer. Keep inputs, outputs and provider-owned
workspace alive until timing finishes, and verify all three graphs against
the FP32 reference before and after timing. The Triton row keeps its kernel
and configuration and benefits from the corrected capture lifetimes.
On GitHub's SM100 CuTe lane, missing NVRTC/cooperative groups support
fails the preset's numerical test rather than silently skipping it.

Testing: scripts/run_tests.py on B200 4 passed the two CuTe signed-replay
and fullgraph/Inductor alignment tests, including the slow one. A fresh
cache run of the PR-tier signed numerical on that device took 5.58 s
in the test body. The scoped CuTe CPU lane passed six metadata,
prerequisite, reference and dashboard tests; the Triton CPU lane passed
three with two CuTe-only skips. Strict lint and Pyrefly passed.
The actual nightly CLI at context 1024 reported CuTe 16.22 us, Triton
16.26 us and FlashInfer 18.18 us for complete CUDA graph replay (B200 4,
PyTorch 2.15.0.dev20260814, CuTe DSL 4.8.1, FlashInfer 0.7.0.post1).
CuTe/Triton are effectively tied in this sample. Separately, cold-L2 CUPTI
device spans at the published setup were 9.760/9.856 us for CuTe versus
10.432/10.416 for Triton and 14.048/14.016 for FlashInfer in reversed
capture orders; those numbers do not measure complete graph replay.

Review notes:
- Deferred: upstream CPP_FAKETENSOR=1 cannot bind with the Python cache
  hook. KNOWN_GAPS.md, cpp-fake-mode-tile-provenance. Simply omitting
  the hook loses three tile IDs; using a private Python mode passes six
  eager controls but outer strict C++ fakes still reach raw pointer
  queries in real captures and alias keys, so that constructor-only
  workaround does not safely support the process-wide mode.
- Deferred: shipped raw-pointer dispatch can ignore lazy-negative
  operands on origin/main. KNOWN_GAPS.md, triton-raw-storage-lazy-negative-inputs.
  The new explicit CuTe preset always rejects these views. A general
  policy for aliased inputs, in-place writes and graph dispatch would
  change other kernels' public contract.
  The verified entry includes the original four tensors and scale and the
  caller-side resolve_neg workaround. An attempted selector-only guard
  still returned the wrong value in both warm compile and disabled modes.
  A local source-body normalization is a change to the shared authored
  function; the new CuTe entry is guarded without changing that function.

autoreview passed: claude, codex

stack-info: PR: #4764, branch: choijon5/helion-b200/mla/5
@choijon5
choijon5 marked this pull request as draft November 26, 2026 20:01
@choijon5
choijon5 marked this pull request as ready for review November 26, 2026 20:04
@choijon5
choijon5 marked this pull request as draft November 26, 2026 20:05
@choijon5
choijon5 force-pushed the choijon5/helion-b200/mla/5 branch from 25d61de to 574c096 Compare November 26, 2026 20:05
@choijon5 choijon5 changed the title [benchmarks] Publish the B200 CuTe preset for single-query Flash MLA [benchmarks] Publish and exercise the B200 CuTe Flash MLA preset in CI Nov 26, 2026
@choijon5
choijon5 marked this pull request as ready for review November 26, 2026 20:05

This branch has not been deployed

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

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants