Skip to content

[Bug Skip] XPU Dynamo Graph Lowering - stream_index None#10

Draft
Stonepia wants to merge 1 commit into
mainfrom
agent/issue-3388
Draft

[Bug Skip] XPU Dynamo Graph Lowering - stream_index None#10
Stonepia wants to merge 1 commit into
mainfrom
agent/issue-3388

Conversation

@Stonepia

@Stonepia Stonepia commented May 12, 2026

Copy link
Copy Markdown
Collaborator

[Bug Skip] XPU Dynamo Graph Lowering - stream_index None

Fixes intel/torch-xpu-ops#3388

Root Cause: In torch/_dynamo/variables/builder.py wrap_fx_proxy_cls (line 3547-3559), when a StreamVariable is created from a proxy whose target is device_interface.current_stream rather than get_external_object_by_index, user_object_index is set to None. Subsequently, when record_event() or wait_event() is called on this StreamVariable, None is passed as stream_index to torch.ops.streams.record_event/wait_stream, causing the RuntimeError since those ops require an int.

Failed Tests:

  • third_party/torch-xpu-ops/test/xpu/dynamo/test_ctx_manager_xpu.py::CtxManagerTests::test_cuda_event_method

Diff stat:

torch/_dynamo/variables/builder.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

[upstream_ut] test/dynamo/test_higher_order_ops.py test_dropout failed with RuntimeError: CUDA not available
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Skip] XPU Dynamo Graph Lowering - stream_index None

1 participant