From e0ba311026f9840b98f1a6bfa856be9d2ae010d7 Mon Sep 17 00:00:00 2001 From: Brayden Zhong Date: Sat, 1 Aug 2026 13:48:58 -0700 Subject: [PATCH] Disable breakable CUDA graph for NemotronH (#33130) --- python/sglang/srt/configs/model_config.py | 8 ++++++++ python/sglang/srt/server_args.py | 13 ++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/configs/model_config.py b/python/sglang/srt/configs/model_config.py index c0fd8f6c5..a5a3da05b 100644 --- a/python/sglang/srt/configs/model_config.py +++ b/python/sglang/srt/configs/model_config.py @@ -129,6 +129,14 @@ def is_deepseek_v4(config) -> bool: ) +def is_nemotron_h(config) -> bool: + return _hf_arch(config) in ( + "NemotronHForCausalLM", + "NemotronHPuzzleForCausalLM", + "NemotronHForCausalLMMTP", + ) + + def get_dsa_index_head_dim(config: PretrainedConfig) -> int: assert is_deepseek_dsa(config) or is_deepseek_v4(config) return config.index_head_dim diff --git a/python/sglang/srt/server_args.py b/python/sglang/srt/server_args.py index 3a344dfe4..d7d1b1156 100644 --- a/python/sglang/srt/server_args.py +++ b/python/sglang/srt/server_args.py @@ -4426,7 +4426,11 @@ class ServerArgs: memory-saver rejection in its own __init__; config-time rules can be added here as they're discovered. """ - from sglang.srt.configs.model_config import is_deepseek_dsa, is_deepseek_v4 + from sglang.srt.configs.model_config import ( + is_deepseek_dsa, + is_deepseek_v4, + is_nemotron_h, + ) rules = [ # MLA prefill under BCG takes forward_mha, which has no eager @@ -4437,6 +4441,13 @@ class ServerArgs: lambda: self.use_mla_backend() and not is_deepseek_dsa(self.get_model_config().hf_config), ), + # NemotronH's hybrid Mamba2 prefill is not BCG-safe: the mamba + # state-track write is not wired into the captured buffers, so a + # replay can commit a cache slot it never wrote. + ( + "NemotronH (hybrid Mamba2 prefill)", + lambda: is_nemotron_h(self.get_model_config().hf_config), + ), # DSV4 is BCG-compatible but introduces heavy memory pressure: the # c4 indexer scratch is pinned in the capture pool and OOMs. Disable. (