Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TORCH_COMPILE_DEBUG=1 work again #112917

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/inductor/test_torchinductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3111,6 +3111,7 @@ def forward(self, l_input_: torch.Tensor):
o2 = torch.compile(mod)(inp)
self.assertEqual(o1, o2)

@patch.object(config.trace, "enabled", True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add a test with "TORCH_COMPILE_DEBUG=1". It seems that we don't have any test coverage for "TORCH_COMPILE_DEBUG=1" for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably just make a separate sanity test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chillee Where do you suggest to put this sanity test?

def test_layer_norm(self):
m = torch.nn.Sequential(
torch.nn.LayerNorm(32),
Expand Down
4 changes: 2 additions & 2 deletions torch/_inductor/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@
# NB: No need to call super().__init__() because we don't need to re-use any of its logic.
self.snodes = snodes
self.scheduler = scheduler
self.node: ir.Buffer
self.node: ir.Buffer = None

Check failure on line 782 in torch/_inductor/scheduler.py

View workflow job for this annotation

GitHub Actions / lintrunner / linux-job

MYPYNOFOLLOW [assignment]

Incompatible types in assignment (expression has type "None", variable has type "Buffer")
self.users: List[NodeUser] = []
self.inverse_users = []
self.node_users = []
Expand Down Expand Up @@ -1017,7 +1017,7 @@
else:
self.scheduler = scheduler
self.snodes = nodes
self.node: ir.Buffer
self.node: ir.Buffer = None

Check failure on line 1020 in torch/_inductor/scheduler.py

View workflow job for this annotation

GitHub Actions / lintrunner / linux-job

MYPYNOFOLLOW [assignment]

Incompatible types in assignment (expression has type "None", variable has type "Buffer")
self.users: List[NodeUser] = []

self.set_read_writes(
Expand Down
Loading