8000 Buggy test in test/export/test_export.py · Issue #154574 · pytorch/pytorch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Buggy test in test/export/test_export.py #154574
Open
@aorenste

Description

@aorenste

🐛 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0