Skip to content

Capture NemotronH hybrid prefill CUDA graphs on SM100 - #105

Merged
micahtyong merged 1 commit into
spindle-sglang-v0.5.23from
micah/nemotron-h-sm100-prefill-graph
Nov 23, 2026
Merged

micahtyong merged 1 commit into
spindle-sglang-v0.5.23from
micah/nemotron-h-sm100-prefill-graph

Conversation

@micahtyong

@micahtyong micahtyong commented Nov 20, 2026 •

Copy link
Copy Markdown

Summary

NemotronH only captured hybrid prefill CUDA graphs on SM120, so every prefill on B200 ran eagerly. Prefill for this hybrid model is bound by kernel launches on the host. This enables the same breakable prefill graph on SM100: Mamba layers still run eagerly between graph segments, and attention, MoE and LoRA run inside the graph.

The change is one condition in NemotronHModel.supports_hybrid_prefill_graph: is_sm100_supported() or is_sm120() instead of is_sm120().

E2E

Nemotron 3.5 Lightning 30B-A3B BF16 on one B200, LoRA enabled (rank 32, virtual experts), NEXTN MTP with 3 steps, 64K context. Two eval batches sent through the Tinker SDK: IFEval (128 prompts, greedy, up to 1,280 tokens) and MATH-500 (64 problems x 4 samples, temperature 0.6, up to 2,048 tokens), at 32 and 64 sequences in flight. Wall time per batch, mean of two passes per run.

batch before after
IFEval, 32 in flight 18.0 s 16.7 s
IFEval, 64 in flight 13.1 s 12.2 s
MATH-500, 32 in flight 50.1 s 49.3 s
MATH-500, 64 in flight 30.4 s 28.7 s

"Before" is c4182b2 and "after" is this branch, so the after image also carries #95, #99, #100 and #104. A clean A/B, c4182b2 with only this property flipped, gave the same picture over two runs of each (four passes each): IFEval at 32 in flight 20.7 s -> 15.9 s, IFEval at 64 13.4 -> 12.9 s, MATH-500 at 32 53.1 -> 50.3 s, MATH-500 at 64 31.5 -> 30.1 s.

  • Prefill passes report cuda graph: True. Capturing the prefill graph takes 59 s and 3.4 GB at startup. Total startup time to a healthy server didn't change (163 s vs 169 s), because the verify graph capture no longer pays for the first Triton compiles.
  • Logprob parity, 96 MATH prompts at temperature 1.0 and up to 2,048 tokens. Sampler logprobs vs the trainer's forward pass on the same tokens: mean |diff| 0.0121 base and 0.0113 with a trained rank-32 adapter, vs 0.0121 and 0.0122 before. Sampler vs sampler across the two images: mean |diff| 0.0115, at the 0.0118 noise floor of one image against itself.
  • Scope: the breakable prefill graph is already the default backend on CUDA. Once an image includes this commit, every NemotronH MoE model on compute capability 10.x captures it without a flag, including B300/GB200/GB300 and Nano, Super, Puzzle and Omni V3. Only Nemotron 3.5 Lightning on B200 at 64K context was run. Opt out with --cuda-graph-backend-prefill disabled. Recipes on B300, or for other NemotronH models, need a run of their own before they move to an image with this commit.
  • Accuracy is unchanged: IFEval prompt-level strict 75-77%, MATH-500 83-84% on both images.

🤖 Generated with Claude Code

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