-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Refactor GELU and Sigmoid epilogue to use a common template (and add SiLu, Hardswish epilogue) #379
Conversation
ok I've pushed two activation using this common template. |
Thanks for helping clean this up! Can you add documentation with a short description and links to resources to the SiLu and HardSwish structs for future reference? |
@d-k-b Thanks for the feedback, the doc is updated. |
Overall, looks good to me. I think just change |
Oops thanks for spotting this, fixed. |
Not sure why Ci has failed |
These 4 activations look expensive to me. You can try to set If you setting them to |
My patch respects the current choice for the existing epilogues:
false . cutlass/include/cutlass/epilogue/threadblock/epilogue_base.h Lines 73 to 76 in 80e8fe7
For the two new activations, my reasoning was |
SGTM.
|
Making sigmoid and silu |
Vectorized one has less instruction and less burden to I$. |
You can update your TVM PR now. :) |
Since Sigmoid and GeLU epilogue functors are almost identical, I propose to refactor them. The motivation is to make it easy to add another functors.
Now Sigmoid and GeLU epilogue functors are defined as:
I'm going to add two new functors for
SiLU
andHardSwish
activation, which can be implemented in the same manner.What do you think? @hwu36