[XPU] Fix decode graph runner is_current_stream_capturing on non-CUDA devices (#35050)
This commit is contained in:
@@ -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 && \
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user