-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[NPU] refine nan check #34508
[NPU] refine nan check #34508
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
return found_inf_data; | ||
if (std::isnan(static_cast<float>(vec[0]))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOG(WARNING) << "deteced Nan";
return found_inf_data; | ||
if (std::isnan(static_cast<float>(vec[0]))) { | ||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (std::isinf(static_cast<float>(vec[0]))){
LOG(WARNING) << "deteced inf";
}
} | ||
const auto& runner_mean = NpuOpRunner("ReduceMeanD", {*in}, {mean}, | ||
{{"axes", axes}, {"keep_dims", false}}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我们不用 "Div" + "ReduceSumD"?
This reverts commit 393a0b1.
PR types
Bug fixes
PR changes
Others
Describe
CheckNumerics is very slow, we first call ResuceMean and then check one float variable.