-
Couldn't load subscription status.
- Fork 700
[EE/BE] add float variant to unary_ufunc_realhbbf16_to_floathbf16 #12277
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
[EE/BE] add float variant to unary_ufunc_realhbbf16_to_floathbf16 #12277
Conversation
Differential Revision: [D77759060](https://our.internmc.facebook.com/intern/diff/D77759060/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/12277
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit c18c05e with merge base ba19c75 ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This pull request was exported from Phabricator. Differential Revision: D77759060 |
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.
accepted with minor revision, see comments
| double rsqrt(double x) { | ||
| template <typename T> | ||
| T rsqrt(T x) { | ||
| return 1.0 / std::sqrt(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.
think this should be T(1.0) otherwise we're forcing computation in double, right?
| double rsqrt(double x) { | ||
| template <typename T> | ||
| T rsqrt(T x) { | ||
| return 1.0 / std::sqrt(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.
ditto T(1.0)
| #define DEFINE_UNARY_UFUNC_REALHBBF16_TO_FLOATHBF16(op_name, fn) \ | ||
| Tensor& op_name(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) { \ | ||
| return internal::unary_ufunc_realhbbf16_to_floathbf16( \ | ||
| fn, fn, ctx, in, out); \ | ||
| } | ||
|
|
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.
why not define this macro to use the full namespace (prefixed with :: so it works from anywhere) so that backends/cadence can use it too?
d146c80
into
gh/manuelcandales/130/base
…2289) This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: #12277 by @manuelcandales ^ Please use this as the source of truth for the PR details, comments, and reviews ghstack PR base: https://github.com/pytorch/executorch/tree/gh/manuelcandales/130/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/manuelcandales/130/head Merge bot PR base: https://github.com/pytorch/executorch/tree/main Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/manuelcandales/130/orig @diff-train-skip-merge Co-authored-by: Manuel Candales <[email protected]>
Stack from ghstack (oldest at bottom):
Differential Revision: D77759060