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

Add support for torch.compile in RGCNConv #8783

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

akihironitta
Copy link
Member

@akihironitta akihironitta commented Jan 17, 2024

Fixes #8467.

@github-actions github-actions bot added the nn label Jan 17, 2024
@akihironitta akihironitta self-assigned this Jan 17, 2024
@akihironitta akihironitta marked this pull request as ready for review January 17, 2024 08:12
test/nn/conv/test_rgcn_conv.py Show resolved Hide resolved
torch_geometric/nn/conv/rgcn_conv.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jan 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b3f0eb3) 89.25% compared to head (691b270) 89.26%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8783   +/-   ##
=======================================
  Coverage   89.25%   89.26%           
=======================================
  Files         467      467           
  Lines       29919    29928    +9     
=======================================
+ Hits        26705    26714    +9     
  Misses       3214     3214           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +383 to +385
@allow_in_graph
def disable_use_segment_matmul() -> None:
torch_geometric.backend.use_segment_matmul = False
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't we need to reset it somewhere?

Comment on lines +224 to +225
if is_compiling():
disable_use_segment_matmul()
Copy link
Member

Choose a reason for hiding this comment

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

Sorry for asking so many questions. What was the reason for the graph break in the first place? Computing the heuristic? Can't we just do

if is_compiling():
    use_segment_matmul = False
else:
    use_segment_matmul = torch_geometric.backend.use_segment_matmul
    if use_segment_matmul is None:
        pass

etc

@akihironitta
Copy link
Member Author

I'll keep this PR on hold, as it makes more sense to first update the segment matmul heuristic (what @puririshi98 did in #8615). I see two graph breaks in the test case due to:

Break Reasons:
  Break Reason 1:
    Reason: call_function BuiltinVariable(int) [TensorVariable()] {}
    User Stack:
      <FrameSummary file /home/akihiro/work/github.com/pyg-team/pytorch_geometric/torch_geometric/nn/conv/rgcn_conv.py, line 235 in forward>
  Break Reason 2:
    Reason: call_function BuiltinVariable(bool) [TensorVariable()] {}
    User Stack:
      <FrameSummary file /home/akihiro/work/github.com/pyg-team/pytorch_geometric/torch_geometric/backend.py, line 55 in use_segment_matmul_heuristic>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RGCNConv has multiple graph breaks
2 participants