Open
Description
🐛 Describe the bug
One part of test_export_strict_narrow_unbacked_expr isn't testing what it thinks it's testing. In particular the lines:
# Without transforming the unbacked int expression, we can't export.
with self.assertRaisesRegex(
RuntimeError, escape("Could not guard on data-dependent expression")
):
export(Module(identity), inputs, strict=True)
are actually looking for a bug in the fake tensor cache rather than testing some fundamental thing in export.
I'm going to comment out that portion of the test since I'm fixing the fake tensor bug in #152662.
Repro:
(Depending on when you look at this issue, make sure those lines are uncommented)
run the test with the fake tensor cache disabled:
TORCH_FAKE_TENSOR_DISPATCH_CACHE=0 pytest test/export/test_export.py::TestDynamismExpression::test_export_strict_narrow_unbacked_expr
With the fake tensor cache disabled no exception is thrown.
Versions
main branch as of 5/28/25
cc @chauhang @penguinwu @avikchaudhuri @gmagogsfm @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4