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

add Half support for unary ops on CPU #98493

Closed
wants to merge 30 commits into from

Conversation

jiayisunx
Copy link
Collaborator

@jiayisunx jiayisunx commented Apr 6, 2023

Stack from ghstack (oldest at bottom):

Add Half support for log_sigmoid and some unary ops on CPU, including sinc, acosh, asinh, atanh, digamma, trigamma, rsqrt, acos, asin, atan, ceil, cos, erf, erfc, erfinv, exp, expml, floor, log, log10, log1p, log2, i0, round, sin, sqrt, tan, tanh, trunc, lgamma.

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @soumith @voznesenskym @penguinwu @anijain2305 @EikanWang @Guobing-Chen @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @peterbell10 @desertfire

@pytorch-bot
Copy link

pytorch-bot bot commented Apr 6, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/98493

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 86c38e3:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

jiayisunx added a commit that referenced this pull request Apr 6, 2023
…on CPU

ghstack-source-id: 4537bb0bebc9bec0aa3b46d3c854dcf731316f15
Pull Request resolved: #98493
@github-actions github-actions bot added the module: cpu CPU specific problem (e.g., perf, algorithm) label Apr 6, 2023
@jiayisunx jiayisunx marked this pull request as draft April 6, 2023 10:53
jiayisunx added a commit that referenced this pull request Apr 10, 2023
ghstack-source-id: a031839f7c22e9d7c4ccf8aca863eaffa1fc7817
Pull Request resolved: #98493
…d trigamma on CPU"

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10

[ghstack-poisoned]
@jiayisunx
Copy link
Collaborator Author

@pytorchbot label "topic: not user facing"

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Apr 10, 2023
jiayisunx added a commit that referenced this pull request Apr 10, 2023
ghstack-source-id: 1c0c982cf30f8ec89a1fc3d6800798b280572917
Pull Request resolved: #98493
…d trigamma on CPU"

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10

[ghstack-poisoned]
jiayisunx added a commit that referenced this pull request Apr 10, 2023
ghstack-source-id: 58c1333ea4477f8f70dad1dfa133718db2965cc4
Pull Request resolved: #98493
…d trigamma on CPU"

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10

[ghstack-poisoned]
jiayisunx added a commit that referenced this pull request Apr 10, 2023
ghstack-source-id: da7d1142edc7ecda11bc9c03c092b193fb78c4dd
Pull Request resolved: #98493
…d trigamma on CPU"

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10

[ghstack-poisoned]
@mingfeima mingfeima added the module: half Related to float16 half-precision floats label Apr 11, 2023
jiayisunx added a commit that referenced this pull request Apr 11, 2023
ghstack-source-id: b0af864fe5c4d7a54a996fba3ebf8fd816ca8de5
Pull Request resolved: #98493
…d trigamma on CPU"

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10

[ghstack-poisoned]
jiayisunx added a commit that referenced this pull request Apr 12, 2023
ghstack-source-id: d279cc3d3d679ba78c91f63b53644ae330d7fcae
Pull Request resolved: #98493
…d trigamma on CPU"

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10

[ghstack-poisoned]
@jiayisunx jiayisunx marked this pull request as ready for review April 12, 2023 09:37
@jiayisunx jiayisunx changed the title add Half support for sinc, acosh, asinh, atanh, digamma and trigamma on CPU add Half support for unary ops on CPU Apr 12, 2023


Add Half support for log_sigmoid and some unary ops on CPU, including sinc, acosh, asinh, atanh, digamma, trigamma, rsqrt, acos, asin, atan, ceil, cos, erf, erfc, erfinv, exp, expml, floor, log, log10, log1p, log2, i0, round, sin, sqrt, tan, tanh, trunc, lgamma.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 soumith voznesenskym penguinwu anijain2305 EikanWang Guobing-Chen zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv peterbell10 desertfire

[ghstack-poisoned]


Add Half support for log_sigmoid and some unary ops on CPU, including sinc, acosh, asinh, atanh, digamma, trigamma, rsqrt, acos, asin, atan, ceil, cos, erf, erfc, erfinv, exp, expml, floor, log, log10, log1p, log2, i0, round, sin, sqrt, tan, tanh, trunc, lgamma.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 soumith voznesenskym penguinwu anijain2305 EikanWang Guobing-Chen zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv peterbell10 desertfire

[ghstack-poisoned]


Add Half support for log_sigmoid and some unary ops on CPU, including sinc, acosh, asinh, atanh, digamma, trigamma, rsqrt, acos, asin, atan, ceil, cos, erf, erfc, erfinv, exp, expml, floor, log, log10, log1p, log2, i0, round, sin, sqrt, tan, tanh, trunc, lgamma.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 soumith voznesenskym penguinwu anijain2305 EikanWang Guobing-Chen zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv peterbell10 desertfire

[ghstack-poisoned]


Add Half support for log_sigmoid and some unary ops on CPU, including sinc, acosh, asinh, atanh, digamma, trigamma, rsqrt, acos, asin, atan, ceil, cos, erf, erfc, erfinv, exp, expml, floor, log, log10, log1p, log2, i0, round, sin, sqrt, tan, tanh, trunc, lgamma.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 soumith voznesenskym penguinwu anijain2305 EikanWang Guobing-Chen zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv peterbell10 desertfire

[ghstack-poisoned]


Add Half support for log_sigmoid and some unary ops on CPU, including sinc, acosh, asinh, atanh, digamma, trigamma, rsqrt, acos, asin, atan, ceil, cos, erf, erfc, erfinv, exp, expml, floor, log, log10, log1p, log2, i0, round, sin, sqrt, tan, tanh, trunc, lgamma.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 soumith voznesenskym penguinwu anijain2305 EikanWang Guobing-Chen zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv peterbell10 desertfire

[ghstack-poisoned]
jiayisunx added a commit to jiayisunx/pytorch that referenced this pull request May 8, 2023
ghstack-source-id: 05bba47d049fc8799420495994097628e1ba6576
Pull Request resolved: pytorch#98493


Add Half support for log_sigmoid and some unary ops on CPU, including sinc, acosh, asinh, atanh, digamma, trigamma, rsqrt, acos, asin, atan, ceil, cos, erf, erfc, erfinv, exp, expml, floor, log, log10, log1p, log2, i0, round, sin, sqrt, tan, tanh, trunc, lgamma.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 soumith voznesenskym penguinwu anijain2305 EikanWang Guobing-Chen zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv peterbell10 desertfire

[ghstack-poisoned]


Add Half support for log_sigmoid and some unary ops on CPU, including sinc, acosh, asinh, atanh, digamma, trigamma, rsqrt, acos, asin, atan, ceil, cos, erf, erfc, erfinv, exp, expml, floor, log, log10, log1p, log2, i0, round, sin, sqrt, tan, tanh, trunc, lgamma.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 soumith voznesenskym penguinwu anijain2305 EikanWang Guobing-Chen zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv peterbell10 desertfire

[ghstack-poisoned]


Add Half support for log_sigmoid and some unary ops on CPU, including sinc, acosh, asinh, atanh, digamma, trigamma, rsqrt, acos, asin, atan, ceil, cos, erf, erfc, erfinv, exp, expml, floor, log, log10, log1p, log2, i0, round, sin, sqrt, tan, tanh, trunc, lgamma.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 soumith voznesenskym penguinwu anijain2305 EikanWang Guobing-Chen zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv peterbell10 desertfire

[ghstack-poisoned]


Add Half support for log_sigmoid and some unary ops on CPU, including sinc, acosh, asinh, atanh, digamma, trigamma, rsqrt, acos, asin, atan, ceil, cos, erf, erfc, erfinv, exp, expml, floor, log, log10, log1p, log2, i0, round, sin, sqrt, tan, tanh, trunc, lgamma.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 soumith voznesenskym penguinwu anijain2305 EikanWang Guobing-Chen zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv peterbell10 desertfire

[ghstack-poisoned]


Add Half support for log_sigmoid and some unary ops on CPU, including sinc, acosh, asinh, atanh, digamma, trigamma, rsqrt, acos, asin, atan, ceil, cos, erf, erfc, erfinv, exp, expml, floor, log, log10, log1p, log2, i0, round, sin, sqrt, tan, tanh, trunc, lgamma.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 soumith voznesenskym penguinwu anijain2305 EikanWang Guobing-Chen zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv peterbell10 desertfire

[ghstack-poisoned]
@jiayisunx
Copy link
Collaborator Author

I found that torch.round float16 calculation are incorrect in mps backend, and I have to add 'round' into expected fail list as workarround, and I have reported a bug issue to pytorch: #101167

@jiayisunx jiayisunx requested a review from mingfeima May 11, 2023 11:42
@jiayisunx
Copy link
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: Approval needed from one of the following:
michaelay, mcr229, orionr, chandlerzuo, Mortimerp9, ...

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@jiayisunx
Copy link
Collaborator Author

@ngimel, can you please review this PR? thanks!

@jiayisunx
Copy link
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@Pitenager
Copy link

Hi team,

Do you plan to publish a new release soon?

I'm developing my MSc thesis and I'm facing this same issue RuntimeError: "clamp_scalar_cpu" not implemented for 'Half'

If not, is there any workaround? Downgrading is not a good one because I have other dependencies that require PyTorch >= 2.0.0

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request Merged module: cpu CPU specific problem (e.g., perf, algorithm) module: half Related to float16 half-precision floats module: inductor open source topic: not user facing topic category
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

8 participants