pytorch/test/functorch
Yidi Wu c632e29774 [hop][dynamo] support torch.SymInt inputs (#141524)
Fixes https://github.com/pytorch/pytorch/issues/141305.

```python
        class M(torch.nn.Module):
            def forward(self, x, y, z):
                a = y.shape[0]
                b = z.shape[0]

                def true_fn(x):
                    return x + a

                def false_fn(x):
                    return x + b * z

                # When exporting with non-strict: a and b are symints,
                # so torch.compile need to wrap and trace symint inputs.
                return torch.cond(x.shape[0] > 5, true_fn, false_fn, (x,))
```

In non-strict export, when inputs are annotated with dynamic shape, the a, and b in above example are torch.SymInt type. true_fn and false_fn will have closure that're of torch.SymInt types.  The error is triggered because we didn't handle SymInt inputs in dynamo and ends up using a UserDefinedObjectVariable for it, which doesn't have a proxy. We added support by following how we handle SymBool input previously.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/141524
Approved by: https://github.com/zou3519
ghstack dependencies: #142185
2024-12-11 18:46:58 +00:00
..
attn_ft.py
attn_positional.py
common_utils.py General per-SampleInput xfail / skip system (#140443) 2024-11-19 23:09:38 +00:00
discover_coverage.py
functorch_additional_op_db.py
test_ac.py
test_aotdispatch.py skip test dynamo for aot_dispatch tests on ci (#142185) 2024-12-11 18:46:58 +00:00
test_control_flow.py [hop][dynamo] support torch.SymInt inputs (#141524) 2024-12-11 18:46:58 +00:00
test_dims.py
test_eager_transforms.py
test_logging.py
test_memory_efficient_fusion.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_minifier.py
test_ops.py Run only listed tests on s390x (#140265) 2024-11-20 22:53:09 +00:00
test_parsing.py
test_rearrange.py
test_vmap.py General per-SampleInput xfail / skip system (#140443) 2024-11-19 23:09:38 +00:00
test_vmap_registrations.py
xfail_suggester.py