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

fix: inplace operation and avoid for loop #72

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jintonic3561
Copy link

Nice to meet you. Thanks for the great work and sharing.
I have been using your SCINet and have found a few bugs and inefficient implementations.
I have been using it with local fixes, but I thought I would contribute to the community. If you would like to make use of it, please feel free to do so.
There are two areas that need to be fixed.
The first is to fix the use of in-place operation in the Tensor calculation.
Pytorch does not allow in-place operations such as +=, but they were being used in several places.
This operation is only used when the model has certain arguments and may have been missed during testing.
The second is the implementation of SCINet_Tree.zip_up_the_pants.
This implementation uses a for loop for the Tensor operation, which does not take advantage of the GPU's computational efficiency.
Therefore, I modified the implementation to use only matrix operations without changing the calculation result.
In my experiments on my local GPU, this modification resulted in a speedup of about 30~40 times.

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.

1 participant