Skip to content

Conversation

@zhiqiu
Copy link
Contributor

@zhiqiu zhiqiu commented Jul 30, 2021

PR types

Bug fixes

PR changes

Others

Describe

CheckNumerics is very slow, we first call ResuceMean and then check one float variable.

@gongweibao gongweibao self-requested a review July 30, 2021 09:10
Copy link
Contributor

@gongweibao gongweibao left a comment

Choose a reason for hiding this comment

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

LGTM

TensorToVector(mean, exe_ctx.device_context(), &vec);

return found_inf_data;
if (std::isnan(static_cast<float>(vec[0]))) {
Copy link
Contributor

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;
}
Copy link
Contributor

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";
}

axes.push_back(i);
}
const auto& runner_mean = NpuOpRunner("ReduceMeanD", {*in}, {mean},
{{"axes", axes}, {"keep_dims", false}});
Copy link
Contributor

Choose a reason for hiding this comment

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

我们不用 "Div" + "ReduceSumD"?

@gongweibao gongweibao merged commit 393a0b1 into PaddlePaddle:develop Aug 2, 2021
gongweibao added a commit that referenced this pull request Aug 2, 2021
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.

2 participants