diff --git a/docker/xpu.Dockerfile b/docker/xpu.Dockerfile index 67fc21b4d..c249f0d06 100644 --- a/docker/xpu.Dockerfile +++ b/docker/xpu.Dockerfile @@ -74,6 +74,7 @@ RUN pip install --no-cache-dir torch==2.13.0+xpu torchvision==0.28.0+xpu torchau RUN echo "Cloning ${SG_LANG_BRANCH} from ${SG_LANG_REPO}" && \ git clone --branch ${SG_LANG_BRANCH} --single-branch ${SG_LANG_REPO} sglang && \ + git -C sglang fetch --tags --force origin && \ cd sglang && cd python && \ cp pyproject_xpu.toml pyproject.toml && \ pip install --no-cache-dir ".[dev,diffusion]" --extra-index-url https://download.pytorch.org/whl/xpu && \ 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 835c85899..6f27a0594 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 @@ -467,9 +467,11 @@ class DecodeCudaGraphRunner(BaseCudaGraphRunner): def _record_in_graph_metadata_prep_done(self): # Purely a marker at this point in the graph; where the shared reads # actually end is the attn backend's call. - if not torch.cuda.is_current_stream_capturing(): + if not self.device_module.is_current_stream_capturing(): # Warmup shares this body. Breakable capture still plants: it opens # segment 1 on context entry and every segment re-arms the node. + # Routed through device_module so XPU (torch.xpu) is picked up + # instead of hitting torch.cuda dummy stubs on non-CUDA builds. return if self.in_graph_metadata_prep_done is None: self.in_graph_metadata_prep_done = make_external_event(self.device_module)