Open gardiens opened 6 months ago
This is currently expected, since the custom ops by torch-scatter
are not supported in torch.compile
. There exists two options:
compile
for certain opsFor this, we added utils.scatter
, which will pick up the best computation path depending on your input arguments. Also works with torch.compile
.
For this, we added
utils.scatter
, which will pick up the best computation path depending on your input arguments. Also works withtorch.compile
.
If I understand correctly, you suggest that instead of using torch_sum or torch_scatter, we should use by default utils.scatter instead of directly calling scatter_min or scatter_max ?
Yes, if you want torch.compile
support, then this is the recommended way.
They are simply not supported. It seems to be a long term goal, but it is somehow stale: https://github.com/pyg-team/pytorch_geometric/issues/8890.
This is really confusing, because pyg documents suggest that "there exists a few operations in PyG that will currently lead to graph breaks (but workaround exists)" in https://pytorch-geometric.readthedocs.io/en/latest/advanced/compile.html, but they do not mention that all scatter type ops, such as scatter_softmax, are not supported.
Hello,
I can't compile any model that includes scatter or scatter min from torch_scatter. For example in this beautiful script
The code fails with :
My torch version is 2.2.0 torch_geometric 2.5.2 and torch_scatter is 2.1.2,