-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We have a graph break at `hasattr` call in `ModuleDict.to_internal_key`. Repro: ```python import torch from torch_geometric.nn.module_dict import ModuleDict edge_type = ("a", "to", "b") class SomeModel(torch.nn.Module): def __init__(self): super().__init__() self.module_dict = ModuleDict({ edge_type: torch.nn.Linear(1, 1), }) def forward(self, x): # need to convert tuple to string in advance to avoid a graph break # due to pytorch/pytorch#111551 key = ModuleDict.to_internal_key(edge_type) x = self.module_dict[key](x) return x from torch._dynamo.utils import CompileProfiler model = SomeModel() with CompileProfiler() as prof: model = torch.compile(model) model(torch.randn(1, 1)) print(prof.report()) ``` --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: rusty1s <matthias.fey@tu-dortmund.de>
- Loading branch information
1 parent
b1f8535
commit ccbbbdd
Showing
4 changed files
with
13 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters