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

Fix naive b2p error #5806

Merged
merged 8 commits into from
Aug 9, 2021
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ Maybe<one::Tensor> NaiveB2PBoxingInterpreter::InterpretImpl(
Symbol<ParallelDesc> in_parallel_desc, Symbol<ParallelDesc> out_parallel_desc) const {
CHECK_EQ_OR_RETURN(in_parallel_desc, out_parallel_desc);
int64_t root = JUST(in_parallel_desc->MachineId4ParallelId(0));
if (root == GlobalProcessCtx::LocalRank()) {
std::string device_type = Device::Type4DeviceTag(in_parallel_desc->device_tag());
return JUST(one::functional::Copy(input, device_type, root));
if (root == GlobalProcessCtx::Rank()) {
return JUST(one::functional::Identity(input));
} else {
return JUST(one::functional::ZerosLike(input));
}
Expand Down