-
Notifications
You must be signed in to change notification settings - Fork 756
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
consistent_tensor_to_api #5703
consistent_tensor_to_api #5703
Conversation
Speed stats:
|
python/oneflow/nn/modules/to.py
Outdated
input_local_tesnor = input.to_local() | ||
device = flow.device(device) | ||
output_local_tesnor = To(False)(input_local_tesnor, device, None) | ||
return output_local_tesnor.to_consistent(out_placement, sbp) |
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.
input_local_tesnor 和 output_local_tesnor 有 typo
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.
已修改
python/oneflow/nn/modules/to.py
Outdated
"cuda", | ||
"cpu", | ||
), 'consistent tensor only support to("cuda") or to("cpu")' | ||
if (device == "cuda" and input.is_cuda) or (device == "cpu" and not input.is_cuda): |
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.
这里直接判断 device == input.placement.device_type 吧,后续如果加了新设备类型也不用改这里了
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.
已修改
一号进程的输出是不是贴错了 |
是的,粘错了,已更新 |
Speed stats:
|
ConsistentTensor 支持方法 .to("cpu"):
0号进程演示
1号进程演示: