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

Error of using ssp as activation function #49

Open
Skyinner opened this issue Jun 16, 2023 · 3 comments
Open

Error of using ssp as activation function #49

Skyinner opened this issue Jun 16, 2023 · 3 comments

Comments

@Skyinner
Copy link

I use ssp as activation function. However, the following error exists. I found that removing @torch.jit.script of ssp function in nequip can help run smoothly.

Traceback (most recent call last):
  File "/Users/shipengjie/anaconda3/lib/python3.10/site-packages/nequip/utils/auto_init.py", line 232, in instantiate
    instance = builder(positional_args, final_optional_args)
  File "/Users/shipengjie/anaconda3/lib/python3.10/site-packages/allegro/nn/allegro.py", line 316, in __init__
    two_body_latent(
  File "/Users/shipengjie/anaconda3/lib/python3.10/site-packages/allegro/nn/_fc.py", line 153, in __init__
    features = nonlinearity(features)
RuntimeError: ShiftedSoftPlus() Expected a value of type 'Tensor (inferred)' for argument 'x' but instead found type 'Proxy'.
Inferred 'x' to be of type 'Tensor' because it was not annotated with an explicit type.
Position: 0
Value: Proxy(matmul)
Declaration: ShiftedSoftPlus(Tensor x) -> (Tensor)
Cast error details: Unable to cast Proxy(matmul) to Tensor

The system I am running is macos.

@Linux-cpp-lisp
Copy link
Collaborator

Hi @Skyinner ,

Out of curiosity, why do you need to use SSP instead of SiLU? Have you found better accuracy on some system?

This is I think because SSP needs to be rewritten as a function rather than a module...

@Skyinner
Copy link
Author

Hi @Linux-cpp-lisp ,
I just tested the SSP activation function and found the error. After using SSP, I did not find any significant performance advantages.

@Linux-cpp-lisp
Copy link
Collaborator

Got it, I'll keep this issue open since it is techincaly a bug, but hopefully you can just move forward with your work with SiLU. Thanks!

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

2 participants