[Inductor][XPU] control_deps node used before definition in test_barrier_deps_exclude_nodes_defined_after_sync
- Dominant language
- Python
- Stars
- 113
- Forks
- 128
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 107
Description
### 🐛 Describe the bug
`TestUserStreamCompile::test_barrier_deps_exclude_nodes_defined_after_sync` in `test/inductor/test_user_streams.py` fails during AOT graph capture:
```
RuntimeError: Argument '_tensor_constant0' of Node 'control_deps' was used before
it has been defined! Please check that Nodes in the graph are topologically ordered
```
The `control_deps` higher-order op references `%_tensor_constant0`, but the `get_attr[target=_tensor_constant0]` node appears later in the graph, so `fw_module.graph.eliminate_dead_code()` -> `lint()` raises. Graph excerpt:
```
%control_deps : call_function[target=torch.ops.higher_order.control_deps](args = ((%mm, %_tensor_constant0), %subgraph_synchronize_stream, %mm, %_tensor_constant0))
...
%_tensor_constant0 : get_attr[target=_tensor_constant0]
```
### Repro
```
python test/inductor/test_user_streams.py TestUserStreamCompile.test_barrier_deps_exclude_nodes_defined_after_sync
```
### Versions
Device: XPU (`USE_XPU`), Triton Intel backend.
Contributor guide
Research direction
Start with test/inductor/test_user_streams.py and run TestUserStreamCompile.test_barrier_deps_exclude_nodes_defined_after_sync using the provided command. Inspect the AOT graph-capture path around eliminate_dead_code() and lint(); done means the XPU test passes without a control_deps node referencing _tensor_constant0 before its get_attr definition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- backend, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100