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

[docs] torch.set_flush_denormal(...) to mention default mode #19652

Open
vadimkantorov opened this issue Apr 24, 2019 · 1 comment
Open

[docs] torch.set_flush_denormal(...) to mention default mode #19652

vadimkantorov opened this issue Apr 24, 2019 · 1 comment
Labels
module: docs Related to our documentation, both in docs/ and docblocks triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@vadimkantorov
Copy link
Contributor

Currently the torch.set_flush_denormal docs do not mention what is the default mode.

It would also be nice if they mentioned the FTZ / DAZ flags and a link to some reference page (like intel's?) - like that this method would show up for google queries like pytorch ftz.

Also, a note on whether denormals are flushed on GPU would be helpful.

@vishwakftw vishwakftw added the module: docs Related to our documentation, both in docs/ and docblocks label Apr 24, 2019
@pietern pietern added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Apr 24, 2019
@colesbury
Copy link
Member

These seem like good things to mention in the docs.

Currently the torch.set_flush_denormal docs do not mention what is the default mode.

Usually denormals are not flushed-to-zero, but it's dependent on the compiler (and potentially OS and CPU). For example, Intel's compiler reportedly sets FTZ when optimization is turned on.

It would also be nice if they mentioned the FTZ / DAZ flags and a link to some reference page (like intel's?)

The linked page is for Intel's compiler (ICC). I don't think we should link to that since we don't generally use it. I don't know of a great reference, but wikipedia is OK and Intel's manual is the authoritative reference for Intel CPUs.

https://en.wikipedia.org/wiki/Denormal_number
Intel® 64 and IA-32 Architectures Software Developer’s Manuals - authoritative, but dense

Also, a note on whether denormals are flushed on GPU would be helpful.

No - they're not flushed to zero. The immediate reasons is that it would require recompilation instead of something we could change at runtime. It also tends not to be as much of an issue. I think FMA (fused multiply-add) operate at full throughput with denormals on recent GPUs (this blog post hints at it).

Other operations (division, sqrt, etc.) might be slower but we tend not to use them in the super compute-heavy ops like convolution/gemm. They're more likely to be part of an element-wise computation, which tends to be memory bound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: docs Related to our documentation, both in docs/ and docblocks triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

4 participants