Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Linux-cpp-lisp
Copy link
Contributor

Description

In recent PyTorch versions, this warning has started coming up a lot:

UserWarning: The TorchScript type system doesn't support instance-level annotations on empty non-base types in `__init__`. Instead, either 1) use a type annotation in the class body, or 2) wrap the type in `torch.jit.Attribute`.

How Has This Been Tested?

All unit tests pass locally, with GPU.

Checklist:

  • [ X ] I have read the CONTRIBUTING document.
  • [ X ] My code follows the code style of this project.
  • [ X ] I have updated the documentation (if relevant).
  • [ X ] I have added tests that cover my changes (if relevant).
  • [ X ] The modified code is cuda compatible (github tests don't test cuda) (if relevant).
  • I have updated the CHANGELOG.

@Linux-cpp-lisp
Copy link
Contributor Author

See also pytorch/pytorch#89064

@mariogeiger
Copy link
Member

Tell me when you want to merge

@Linux-cpp-lisp
Copy link
Contributor Author

Thanks @mariogeiger --- ideally just want to see the tests pass, and if anyone else wants to take a quick look to make sure I didn't make any typos / logical errors in this, since it touches some of the compilation logic that underpins most of the library.

@mitkotak
Copy link
Member

mitkotak commented Jun 22, 2024

Looks good from my side. Thanks for cleaning up the Torch2 stuff

@mariogeiger
Copy link
Member

There is a problem with the tests

@Linux-cpp-lisp
Copy link
Contributor Author

Why does this file exist? https://github.com/e3nn/e3nn/blob/main/examples/conftest.py
It seems like a duplicate of the one in tests/...

@mariogeiger
Copy link
Member

No idea, does it help it you delete it?

@Linux-cpp-lisp
Copy link
Contributor Author

Let's find out 😄

@Linux-cpp-lisp
Copy link
Contributor Author

Linux-cpp-lisp commented Jun 23, 2024

I suspect it's due to a combination of that file and the fact that the GitHub actions are set up run any tests anywhere in the repo:
https://github.com/e3nn/e3nn/blob/main/.github/workflows/tests.yml#L56

instead of only in the tests/ folder. Is that intentional?

(Either way seem to be running fine now)

@mitkotak
Copy link
Member

mitkotak commented Jun 23, 2024

I remember the examples were failing because of torch-cluster, torch-sparse… import issues when I was testing locally.

Hopefully this also fixed that

Update: Yup it did !

@mitkotak
Copy link
Member

mitkotak commented Jun 23, 2024

For the Torch 2 test that is failing its running alright locally when I do

pytest --doctest-modules --ignore=docs/ tests/o3/experimental/test_fulltp.py

so not sure what's happening there

@Linux-cpp-lisp
Copy link
Contributor Author

Is there a way to just not run tests or flake8 on anything in experimental right now?

@Linux-cpp-lisp
Copy link
Contributor Author

Either way, it does look like all failures are unrelated to this PR, so I think we're good to merge, thanks!

@mitkotak
Copy link
Member

mitkotak commented Jun 23, 2024

Do you mind doing a --ignore=tests/o3/experimental or should I put it another PR ?

@mariogeiger
Copy link
Member

Ok let me merge and feel free to make another PR to fix this test problem

@mariogeiger mariogeiger merged commit e203fa0 into e3nn:main Jun 23, 2024
@Linux-cpp-lisp
Copy link
Contributor Author

Great, thanks guys!

@Linux-cpp-lisp Linux-cpp-lisp deleted the fix-torchscript-attr-warning branch June 24, 2024 01:08
@Linux-cpp-lisp Linux-cpp-lisp restored the fix-torchscript-attr-warning branch June 24, 2024 01:08
kavanase added a commit to kavanase/nequip that referenced this pull request Jun 27, 2024
mariogeiger pushed a commit that referenced this pull request Jul 9, 2024
@Linux-cpp-lisp Linux-cpp-lisp deleted the fix-torchscript-attr-warning branch July 22, 2024 01:38
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

Successfully merging this pull request may close these issues.

3 participants