-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[TensorExpr] Fast sigmoid for LLVM #39717
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
Conversation
[ghstack-poisoned]
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.
Overall looks good, but please add some tests for this change.
| } | ||
| // TODO: fast exp | ||
| // TODO: fast erf | ||
| // TODO: fast sigmoid |
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.
Nit: remove the finished "TODO" please.
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.
Done
| const std::vector<CodeGen::BufferArg>& params, | ||
| at::Device device = at::kCPU); | ||
|
|
||
| class TORCH_API GenericIntrinsicsExpander : public IRMutator { |
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.
Nit: we're creating an entire class (+ derived from it) just to redefine a single function. We could've get away with just a single free-standing function here.
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.
This class and function is invoked implicity through accept_mutator. Unless we come up with more magic wrappers here, there is no easy way to call into this in our current infrastructure with a free standing function.
Differential Revision: [D21949849](https://our.internmc.facebook.com/intern/diff/D21949849) [ghstack-poisoned]
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.
Looks good if the tests are there!
Stack from ghstack:
Differential Revision: D21949849