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

Disable torch._inductor.config.assert_indirect_indexing in PyTorch 2.2 #8507

Merged
merged 3 commits into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions torch_geometric/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@
model = to_jittable(model)

# Do not generate device asserts which may slow down model execution:
try:
if torch_geometric.typing.WITH_PT22:
torch._inductor.config.assert_indirect_indexing = False

Check warning on line 97 in torch_geometric/compile.py

View check run for this annotation

Codecov / codecov/patch

torch_geometric/compile.py#L97

Added line #L97 was not covered by tests
elif torch_geometric.typing.WITH_PT21:
torch._inductor.config.triton.assert_indirect_indexing = False
except AttributeError: # PyTorch < 2.1:
pass

# Finally, run `torch.compile` to create an optimized version:
out = torch.compile(model, *args, **kwargs)
Expand Down
1 change: 1 addition & 0 deletions torch_geometric/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

WITH_PT20 = int(torch.__version__.split('.')[0]) >= 2
WITH_PT21 = WITH_PT20 and int(torch.__version__.split('.')[1]) >= 1
WITH_PT22 = WITH_PT20 and int(torch.__version__.split('.')[1]) >= 2
WITH_PT111 = WITH_PT20 or int(torch.__version__.split('.')[1]) >= 11
WITH_PT112 = WITH_PT20 or int(torch.__version__.split('.')[1]) >= 12
WITH_PT113 = WITH_PT20 or int(torch.__version__.split('.')[1]) >= 13
Expand Down
Loading