[upstream_ut] test/dynamo/test_activation_checkpointing.py::ActivationCheckpointingViaTagsTestsXPU::test_pattern_matcher failed with IndexError
- Dominant language
- Python
- Stars
- 113
- Forks
- 128
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 107
Description
### 🐛 Describe the bug
### Error Message
```
==================================== RERUNS ====================================
2026-04-17T07:59:11.2674022Z _______ ActivationCheckpointingViaTagsTestsXPU.test_pattern_matcher_xpu ________
2026-04-17T07:59:11.2675288Z Traceback (most recent call last):
2026-04-17T07:59:11.2699950Z File "/var/lib/jenkins/pytorch/test/dynamo/test_activation_checkpointing.py", line 1950, in test_pattern_matcher
2026-04-17T07:59:11.2702177Z self.assertTrue(count_ops(bwd_graph, [], freq=0, op=torch.ops.aten.sin.default))
2026-04-17T07:59:11.2704098Z File "/var/lib/jenkins/pytorch/test/dynamo/test_activation_checkpointing.py", line 116, in count_ops
2026-04-17T07:59:11.2705591Z raise AssertionError(err_msg)
2026-04-17T07:59:11.2706460Z AssertionError: In graph GraphModule()
2026-04-17T07:59:11.2707036Z
2026-04-17T07:59:11.2707052Z
2026-04-17T07:59:11.2707064Z
2026-04-17T07:59:11.2707761Z def forward(self, primals_1, primals_2, primals_3, rng_state_output_0, tangents_1):
2026-04-17T07:59:11.2710059Z full_default = torch.ops.aten.full.default([4, 2, 16, 64], 0, dtype = torch.float16, layout = torch.strided, device = device(type='xpu', index=0), pin_memory = False)
2026-04-17T07:59:11.2713135Z slice_scatter_default_1 = torch.ops.aten.slice_scatter.default(full_default, tangents_1, -1, 0, 32); full_default = tangents_1 = None
2026-04-17T07:59:11.2714942Z sin = torch.ops.aten.sin.default(primals_1)
2026-04-17T07:59:11.2716341Z constant_pad_nd_default = torch.ops.aten.constant_pad_nd.default(sin, [0, 32], 0.0); sin = None
2026-04-17T07:59:11.2718249Z constant_pad_nd_default_1 = torch.ops.aten.constant_pad_nd.default(primals_2, [0, 32], 0.0); primals_2 = None
2026-04-17T07:59:11.2720275Z constant_pad_nd_default_2 = torch.ops.aten.constant_pad_nd.default(primals_3, [0, 32], 0.0); primals_3 = None
2026-04-17T07:59:11.2723887Z run_with_rng_state = torch.ops.higher_order.run_with_rng_state(rng_state_output_0, torch.ops.aten._scaled_dot_product_flash_attention.default, constant_pad_nd_default, constant_pad_nd_default_1, constant_pad_nd_default_2, scale = 0.17677669529663687); rng_state_output_0 = None
2026-04-17T07:59:11.2726947Z getitem = run_with_rng_state[0]
2026-04-17T07:59:11.2727771Z getitem_1 = run_with_rng_state[1]
2026-04-17T07:59:11.2728586Z getitem_2 = run_with_rng_state[6]
2026-04-17T07:59:11.2730049Z getitem_3 = run_with_rng_state[7]; run_with_rng_state = None
2026-04-17T07:59:11.2735034Z _scaled_dot_product_flash_attention_backward_default = torch.ops.aten._scaled_dot_product_flash_attention_backward.default(slice_scatter_default_1, constant_pad_nd_default, constant_pad_nd_default_1, constant_pad_nd_default_2, getitem, getitem_1, None, None, 16, 16, 0.0, False, getitem_2, getitem_3, scale = 0.17677669529663687); slice_scatter_default_1 = constant_pad_nd_default = constant_pad_nd_default_1 = constant_pad_nd_default_2 = getitem = getitem_1 = getitem_2 = getitem_3 = None
2026-04-17T07:59:11.2739962Z getitem_4 = _scaled_dot_product_flash_attention_backward_default[0]
2026-04-17T07:59:11.2741244Z getitem_5 = _scaled_dot_product_flash_attention_backward_default[1]
2026-04-17T07:59:11.2743055Z getitem_6 = _scaled_dot_product_flash_attention_backward_default[2]; _scaled_dot_product_flash_attention_backward_default = None
2026-04-17T07:59:11.2745262Z constant_pad_nd_default_3 = torch.ops.aten.constant_pad_nd.default(getitem_6, [0, -32]); getitem_6 = None
2026-04-17T07:59:11.2747227Z constant_pad_nd_default_4 = torch.ops.aten.constant_pad_nd.default(getitem_5, [0, -32]); getitem_5 = None
2026-04-17T07:59:11.2749178Z constant_pad_nd_default_5 = torch.ops.aten.constant_pad_nd.default(getitem_4, [0, -32]); getitem_4 = None
2026-04-17T07:59:11.2750787Z cos = torch.ops.aten.cos.default(primals_1); primals_1 = None
2026-04-17T07:59:11.2752586Z mul_3 = torch.ops.aten.mul.Tensor(constant_pad_nd_default_5, cos); constant_pad_nd_default_5 = cos = None
2026-04-17T07:59:11.2754218Z return (mul_3, constant_pad_nd_default_4, constant_pad_nd_default_3)
2026-04-17T07:59:11.2755431Z
2026-04-17T07:59:11.2756969Z # To see more debug info, please use `graph_module.print_readable()`, expected aten.sin.default to have occurred 0 times in the graph, but got 1.
2026-04-17T07:59:11.2758325Z
2026-04-17T07:59:11.2758788Z To execute this test, run the following from the base repo dir:
2026-04-17T07:59:11.2760450Z python test/dynamo/test_activation_checkpointing.py ActivationCheckpointingViaTagsTestsXPU.test_pattern_matcher_xpu
2026-04-17T07:59:11.2761652Z
2026-04-17T07:59:11.2762178Z This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
2026-04-17T07:59:11.2763546Z _______ ActivationCheckpointingViaTagsTestsXPU.test_pattern_matcher_xpu ________
2026-04-17T07:59:11.2764678Z Traceback (most recent call last):
2026-04-17T07:59:11.2766095Z File "/var/lib/jenkins/pytorch/test/dynamo/test_activation_checkpointing.py", line 1933, in test_pattern_matcher
2026-04-17T07:59:11.2767483Z fwd_graph = aot_graphs[0]
2026-04-17T07:59:11.2768212Z IndexError: list index out of range
2026-04-17T07:59:11.2768690Z
2026-04-17T07:59:11.2769122Z To execute this test, run the following from the base repo dir:
2026-04-17T07:59:11.2770729Z python test/dynamo/test_activation_checkpointing.py ActivationCheckpointingViaTagsTestsXPU.test_pattern_matcher_xpu
2026-04-17T07:59:11.2771917Z
2026-04-17T07:59:11.2772435Z This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
2026-04-17T07:59:11.2773526Z =================================== FAILURES ===================================
2026-04-17T07:59:11.2774727Z _______ ActivationCheckpointingViaTagsTestsXPU.test_pattern_matcher_xpu ________
2026-04-17T07:59:11.2775824Z Traceback (most recent call last):
2026-04-17T07:59:11.2777187Z File "/var/lib/jenkins/pytorch/test/dynamo/test_activation_checkpointing.py", line 1933, in test_pattern_matcher
2026-04-17T07:59:11.2778533Z fwd_graph = aot_graphs[0]
2026-04-17T07:59:11.2779220Z IndexError: list index out of range
2026-04-17T07:59:11.2779701Z
2026-04-17T07:59:11.2780130Z To execute this test, run the following from the base repo dir:
2026-04-17T07:59:11.2781709Z python test/dynamo/test_activation_checkpointing.py ActivationCheckpointingViaTagsTestsXPU.test_pattern_matcher_xpu
2026-04-17T07:59:11.2782908Z
2026-04-17T07:59:11.2783581Z This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
```
### ToDo
https://github.com/pytorch/pytorch/pull/169241
### Versions
2.12.0a0
Contributor guide
Assessment
This issue has not been assessed yet.