From 70c71ba183d9ea46b8514ec57bc84bf07672760c Mon Sep 17 00:00:00 2001 From: Cheng Wan <54331508+ch-wan@users.noreply.github.com> Date: Wed, 10 Jun 2026 01:15:50 -0700 Subject: [PATCH] [NPU] Fix dead patch_model monkey-patch breaking NPU torch.compile capture (#27774) --- .../srt/model_executor/runner/decode_cuda_graph_runner.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/python/sglang/srt/model_executor/runner/decode_cuda_graph_runner.py b/python/sglang/srt/model_executor/runner/decode_cuda_graph_runner.py index aa14563b1..601274ee6 100644 --- a/python/sglang/srt/model_executor/runner/decode_cuda_graph_runner.py +++ b/python/sglang/srt/model_executor/runner/decode_cuda_graph_runner.py @@ -35,10 +35,8 @@ import torch import tqdm from torch.profiler import ProfilerActivity, profile -from sglang.srt.compilation.torch_compile_decoration import ( - patch_model, - set_torch_compile_config, -) +from sglang.srt.compilation import torch_compile_decoration +from sglang.srt.compilation.torch_compile_decoration import set_torch_compile_config from sglang.srt.distributed import get_tensor_model_parallel_rank from sglang.srt.distributed.parallel_state import ( graph_capture, @@ -815,7 +813,7 @@ class DecodeCudaGraphRunner(BaseCudaGraphRunner): for variant_label, _variant_has_lora in lora_variants: _set_capture_lora_variant(variant_label) - with patch_model( + with torch_compile_decoration.patch_model( self.model_runner.model, bs in self.compile_bs, num_tokens=bs * self.num_tokens_per_bs,