Skip to content
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

[METAL] Fix codegen for inf and erf #8054

Merged
merged 4 commits into from
May 17, 2021

Conversation

echuraev
Copy link
Contributor

Fixed Metal codegen with using inf constant. Constant INFINITY is
used now instead of inf.
Also, Metal doesn't have erf built-in function. So, we are using
fast_erf from tir. User will see warning message when we will
generate fast_erf instead of erf.

Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.

Fixed Metal codegen with using `inf` constant. Constant `INFINITY` is
used now instead of `inf`.
Also, Metal doesn't have `erf` built-in function. So, we are using
`fast_erf` from tir. User will see warning message when we will
generate `fast_erf` instead of `erf`.
src/target/source/codegen_metal.h Outdated Show resolved Hide resolved
src/target/source/intrin_rule_metal.cc Outdated Show resolved Hide resolved
@masahi masahi merged commit 64c1b79 into apache:main May 17, 2021
@masahi
Copy link
Member

masahi commented May 17, 2021

thanks @echuraev @apeskov

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Jun 17, 2021
* [METAL] Fix codegen for inf and erf

Fixed Metal codegen with using `inf` constant. Constant `INFINITY` is
used now instead of `inf`.
Also, Metal doesn't have `erf` built-in function. So, we are using
`fast_erf` from tir. User will see warning message when we will
generate `fast_erf` instead of `erf`.

* Apply comments

* Fix clang-format

* Fix lint
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Jun 17, 2021
* [METAL] Fix codegen for inf and erf

Fixed Metal codegen with using `inf` constant. Constant `INFINITY` is
used now instead of `inf`.
Also, Metal doesn't have `erf` built-in function. So, we are using
`fast_erf` from tir. User will see warning message when we will
generate `fast_erf` instead of `erf`.

* Apply comments

* Fix clang-format

* Fix lint
@echuraev echuraev deleted the echuraev/fix_metal_codegen branch September 24, 2021 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants