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

Disables denormal floating numbers on ARM CPU #115184

Closed

Conversation

maajidkhann
Copy link
Contributor

@maajidkhann maajidkhann commented Dec 5, 2023

Motivation:
Denormal numbers are used to store extremely small numbers that are close to 0. Denormal numbers can incur extra computational cost. To solve the low performance issue caused by denormal numbers, Pytorch supports flushing denormal numbers and it successfully configures flush denormal mode

Currently set_flush_denormal() is only supported on x86 architectures supporting SSE3 (https://pytorch.org/docs/stable/generated/torch.set_flush_denormal.html (Opens in new window or tab) and now we want to extend this functionality for ARM architecture.

This PR:
->Supports set_flush_denormal() on ARM.
->Datatypes supported and tested: FP64, FP32, BFloat16

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10

->Supports torch.set_flush_denormal(bool)
->Datatypes supported: FP64, FP32, BFloat16

Signed-off-by: maajidkhann <maajidkhan.n@fujitsu.com>
Copy link

pytorch-bot bot commented Dec 5, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit 8b47964 with merge base daf89b4 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@github-actions github-actions bot added the module: cpu CPU specific problem (e.g., perf, algorithm) label Dec 5, 2023
@maajidkhann
Copy link
Contributor Author

Hello @jgong5 . Thanks for reviewing and approving the changes. Can you please trigger the CI Pipelines from your end, so that we can get these changes merged into main while other folks review the changes.

@maajidkhann
Copy link
Contributor Author

Thank you for running the CI pipelines. Looks like all the pipelines have passed with no failures. Can this now be merged if already been reviewed. This would be of great help.

@maajidkhann
Copy link
Contributor Author

Hello @jgong5 Jiong. Can you help us merge this pull request or if it needs additional review, can you please drop a note to the maintainer to have a look at this change and help merging it. Thanks.

@jgong5
Copy link
Collaborator

jgong5 commented Dec 22, 2023

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 22, 2023
@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: This PR needs a release notes: label
If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Details for Dev Infra team Raised by workflow job

@jgong5 jgong5 added the release notes: mobile release notes category label Dec 22, 2023
@jgong5
Copy link
Collaborator

jgong5 commented Dec 22, 2023

@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

maajidkhann added a commit to maajidkhann/pytorch that referenced this pull request Feb 7, 2024
*set_flush_denormal() is now supported on ARM CPU's.
PR:pytorch#115184

Signed-off-by: maajidkhann <maajidkhan.n@fujitsu.com>
maajidkhann added a commit to maajidkhann/pytorch that referenced this pull request Feb 7, 2024
*set_flush_denormal() is now supported on ARM CPU's.
PR:pytorch#115184

Signed-off-by: maajidkhann <maajidkhan.n@fujitsu.com>
pytorchmergebot pushed a commit that referenced this pull request Feb 12, 2024
**Documentation update for set_flush_denormal():**
-> set_flush_denormal() is now supported on ARM CPU's.
-> **PR:** #115184  (Already merged)

**Reference page:** https://pytorch.org/docs/stable/generated/torch.set_flush_denormal.html

Pull Request resolved: #119354
Approved by: https://github.com/drisspg
clee2000 pushed a commit that referenced this pull request Feb 14, 2024
**Documentation update for set_flush_denormal():**
-> set_flush_denormal() is now supported on ARM CPU's.
-> **PR:** #115184  (Already merged)

**Reference page:** https://pytorch.org/docs/stable/generated/torch.set_flush_denormal.html

Pull Request resolved: #119354
Approved by: https://github.com/drisspg
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) open source release notes: mobile release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants