diff --git a/python/sglang/srt/model_executor/runner/prefill_cuda_graph_runner.py b/python/sglang/srt/model_executor/runner/prefill_cuda_graph_runner.py index 63f477fc3..aa50b7255 100644 --- a/python/sglang/srt/model_executor/runner/prefill_cuda_graph_runner.py +++ b/python/sglang/srt/model_executor/runner/prefill_cuda_graph_runner.py @@ -1392,7 +1392,11 @@ class PrefillCudaGraphRunner(BaseCudaGraphRunner): run_once, # DP padding can install capture-only tensors on this dummy batch; # BCG retains it so their recorded addresses remain valid. - capture_inputs=forward_batch, + capture_inputs=( + forward_batch + if forward_batch.global_num_tokens_gpu is not None + else None + ), post_warmup_hook=post_warmup_hook, )