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

Warning: graph break when compile model with scatter_add #457

Open
Roy-Kid opened this issue Aug 11, 2024 · 0 comments
Open

Warning: graph break when compile model with scatter_add #457

Roy-Kid opened this issue Aug 11, 2024 · 0 comments

Comments

@Roy-Kid
Copy link

Roy-Kid commented Aug 11, 2024

Hi everyone,
Im new to torch.compile, and I find this warning:

W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0] Graph break from `Tensor.item()`, consider setting:
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]     torch._dynamo.config.capture_scalar_outputs = True
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0] or:
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]     env TORCHDYNAMO_CAPTURE_SCALAR_OUTPUTS=1
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0] to include these operations in the captured graph.
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0] 
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0] Graph break: from user code at:
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]   File "/workspaces/molcrafts/molpot/src/molpot/potential/base.py", line 32, in forward
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]     inputs = module(inputs)
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]   File "/workspaces/molcrafts/molpot/src/molpot/potential/nnp/pinet.py", line 343, in forward
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]     inputs = self.gc_blocks[i](inputs)
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]   File "/workspaces/molcrafts/molpot/src/molpot/potential/nnp/pinet.py", line 207, in forward
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]     p1, i1 = self.p1_layer(pair_i, pair_j, p1, basis)
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]   File "/workspaces/molcrafts/molpot/src/molpot/potential/nnp/pinet.py", line 141, in forward
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]     p1 = self.ip_layer(idx_i, i1)
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]   File "/workspaces/molcrafts/molpot/src/molpot/potential/nnp/pinet.py", line 118, in forward
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]     return scatter_add(inter, idx_i, dim=0)
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]   File "/opt/conda/lib/python3.11/site-packages/torch_scatter/scatter.py", line 29, in scatter_add
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]     return scatter_sum(src, index, dim, out, dim_size)
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]   File "/opt/conda/lib/python3.11/site-packages/torch_scatter/scatter.py", line 19, in scatter_sum
W0811 21:16:49.580000 11928 torch/_dynamo/variables/tensor.py:776] [0/0]     size[dim] = int(index.max()) + 1

Is this warning matter, or how to fix this?

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

No branches or pull requests

1 participant