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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added SmeLU #263
Merged
Merged
Added SmeLU #263
Changes from 2 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
2b9c64e
Added SmeLU
kashif 7bc8ef6
added pytorch class
kashif bbbf95f
tl.constexpr annotated arguments
kashif 1982d2a
Merge remote-tracking branch 'upstream/main' into smooth-relu
kashif 1afc663
do not change constant beta
kashif 07d4241
triton 2.0 fixes
kashif e992661
Merge remote-tracking branch 'upstream/main' into smooth-relu
kashif 3ccf685
make smelu beta=2.0 default
kashif 3813fcb
use buffer for beta
kashif 8591819
ignore mypy
kashif a47ab38
revert buffer
kashif 83f1078
Merge remote-tracking branch 'upstream/main' into smooth-relu
kashif 94ed71b
use beta=2.0 for now
kashif b7209fd
Merge remote-tracking branch 'upstream/main' into smooth-relu
kashif a70661e
Merge remote-tracking branch 'upstream/main' into smooth-relu
kashif 4ddf413
Merge remote-tracking branch 'upstream/main' into smooth-relu
kashif File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that you can pass a default param with triton actually, it only works with a subset of the python syntax and my guess is that this is out of it (cc @ptillet). Something could be worth trying, having a getter for this kernel, like the following
def get_smelu_kernel(beta: float = 2.0): @triton.jit def smelu(x): pass # use beta here, but maybe that this will fail at the JIT phase
If that does not work,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @blefaudeux I'll give it a try... a bit late here so wanted to give it a shot in the morning 馃槾
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checking this with Philippe, the default value should work actually, maybe that it needs to be : float ? or similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok! cool let me check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear, what should work (for now) is default arguments for tl.constexpr annotated arguments, and with triton 2.0 :p I'm not too sure about Triton 1.x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah right... i'm on triton 1.x at the moment...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to update to triton2.. CI is blocking right now, I hope to get that sorted out this week end