-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[WIP] Implemented hardshrink in ATen with cuda #7695
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
[WIP] Implemented hardshrink in ATen with cuda #7695
Conversation
implement hardshrink with CPU/CUDA_tensor_apply*, similar performance as nn.Hardshrink
…eter for Scalar lambda
| const scalar_t& lambda_t_val, | ||
| const scalar_t& zero_t_val) { | ||
| if (out_t_val >= -lambda_t_val && out_t_val <= lambda_t_val) { | ||
| out_t_val = zero_t_val; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| res = torch.LongTensor((-bignumber,)) | ||
| self.assertGreater(res.abs()[0], 0) | ||
|
|
||
| def test_hardshrink(self): |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
Any updates on this? |
|
For some reasons the compilation of this branch is not working correctly for me. One thing might be related to this was at some point I tried to build using a different version of python. I will close this and create a new PR. |
|
@weiyangfb Not necessary, but it shouldn't be too hard, right? |
Summary:
=> 1 loop, best of 3: 3.99 s per loop
=> 1 loop, best of 3: 4.04 s per loop
=> 1 loop, best of 3: 10 s per loop
=> 1 loop, best of 3: 7.78 s per loop
TODO: