Skip to content

Commit

Permalink
Fix torch_geometric.compile for PyTorch < 2.1 (#8240)
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1s authored Oct 21, 2023
1 parent cd6d1f2 commit 7085a3a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion torch_geometric/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ def fn(model: Callable) -> Callable:
model = to_jittable(model)

# Do not generate device asserts which may slow down model execution:
torch._inductor.config.triton.assert_indirect_indexing = False
try:
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

0 comments on commit 7085a3a

Please sign in to comment.