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

set FLUSH_TO_ZERO ON by default #11906

Closed
wants to merge 1 commit into from

Conversation

crazydemo
Copy link
Contributor

This PR aims to start a discussion on how to enable a set_flush_to_zero interface that is user friendly.
(The initial solution is provided.)
The interface is supposed to meet the following requirements:

  1. Target should be checked. This solution can only be applied to CPU.
  2. Developers can easily set flust_to_zero on or off.
  3. The function can only be called once.

Copy link
Contributor

@tkonolige tkonolige left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not that experienced with flush to zero. @AndrewZhaoLuo I know has done some experiments with it. Maybe he could comment.

Also, if this is a large change, the best way to get some discussion on this would be to submit a RFC to tvm-rfcs (https://github.com/apache/tvm-rfcs).

Comment on lines +58 to +64
if (target->kind->name == "llvm" && !(_mm_getcsr() & 0x8040)) {
LOG(WARNING) << "Set FLUSH_TO_ZERO ON by default in Build on LLVM."<< std::endl;
//DAZ
_mm_setcsr( _mm_getcsr() | 0x0040 );
//FTZ
_mm_setcsr( _mm_getcsr() | 0x8000 );
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this should be in the runtime not the build. What happens if someone builds remotely and then uploads the compiled artifact? Seems like flush to zero would not be changed.

Copy link
Contributor

@AndrewZhaoLuo AndrewZhaoLuo Jun 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this portable? Also can we just leverage LLVM through like a flag or something like #9223?

@areusch areusch added needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it and removed needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it labels Oct 19, 2022
@crazydemo crazydemo closed this Dec 19, 2022
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.

4 participants