-
Notifications
You must be signed in to change notification settings - Fork 685
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
Stream compute on pinned memory #8486
Conversation
Code got formatted by CI. Please request CI again if you still want to have this PR merged. If the PR is from a forked repo, please download the patch files from the GitHub Actions web page and apply them locally. |
Code got formatted by CI. Please request CI again if you still want to have this PR merged. If the PR is from a forked repo, please download the patch files from the GitHub Actions web page and apply them locally. |
…Inc/oneflow into stream_compute_on_pinned_memory
…Inc/oneflow into stream_compute_on_pinned_memory
if (pin_memory) { | ||
CHECK_OR_RETURN(out_device->type() == "cpu") | ||
<< "empty op only support pin_memory in cpu device but got " << out_device->type(); | ||
auto pin_device = JUST(Device::New("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.
写TODO注释
if (pin_memory) { | ||
CHECK_OR_RETURN(in_device->type() == "cpu") | ||
<< "cast op only support pin_memory in cpu device but got " << in_device->type(); | ||
auto pin_device = JUST(Device::New("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.
TODO注释
} else if (in_device->type() == "cpu" && out_device->type() != "cpu") { | ||
const auto device = JUST(Device::New(out_device->type(), out_device->device_id())); | ||
return Stream::New(device, StreamRole::kHost2Device); | ||
} else if (in_device->type() == "cpu" && out_device->type() == "cpu" && pin_memory) { | ||
auto pin_device = JUST(Device::New("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.
TODO注释
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.
已加
CI failed when running job: Build cu102. PR label automerge has been removed |
…Inc/oneflow into stream_compute_on_pinned_memory
View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/8486/ |
Speed stats:
|
oneflow/oneflow/core/device/cpu_device_context.h
,因为没有地方使用到了