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

refine_error_info_with_diff_device_input_and_fix_typo #8054

Merged
merged 54 commits into from
Apr 29, 2022

Conversation

clackhan
Copy link
Contributor

当遇到 多个 input placement 或则不一致时,报错信息对齐pytorch

Comment on lines 878 to 884
CHECK_OR_RETURN(device_tag == JUST(GetDeviceTagOfTensor(input_tensor)))
<< Error::RuntimeError() << "Lazy nn.Graph name: " << graph_name
<< " encountered ERROR in module/op_name: " << new_op_name
<< ". Expected all tensors to be on the same device, but found at least two devices, "
<< JUST(inputs.at(0)->device())->ToString() << " and "
<< JUST(inputs.at(i)->device())->ToString()
<< "! Please use tensor.to() to synchronize all the input with the same device.";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里是要保留graph信息还是完全和eager对齐?需要 @strint 确认一下

Copy link
Contributor

Choose a reason for hiding this comment

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

这里还提供了graph op信息、提供了修改建议。

这样部分对齐就挺好。

@hjchen2 hjchen2 requested a review from oneflow-ci-bot April 20, 2022 01:49
@hjchen2 hjchen2 enabled auto-merge (squash) April 20, 2022 01:49
@hjchen2
Copy link
Contributor

hjchen2 commented Apr 20, 2022

@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot April 20, 2022 04:45
@github-actions
Copy link
Contributor

Speed stats:

mergify bot added 18 commits April 26, 2022 23:52
@github-actions
Copy link
Contributor

CI failed when running job: Build cu102_xla. PR label automerge has been removed

@clackhan clackhan requested review from oneflow-ci-bot and removed request for oneflow-ci-bot April 29, 2022 11:36
@github-actions
Copy link
Contributor

View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/8054/

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce GTX 1080 

❌ OneFlow resnet50 time: 129.7ms (= 12969.0ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 149.1ms (= 14905.1ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.15 (= 149.1ms / 129.7ms)

OneFlow resnet50 time: 78.5ms (= 7849.5ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 83.3ms (= 8333.4ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.06 (= 83.3ms / 78.5ms)

OneFlow resnet50 time: 54.1ms (= 10821.7ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 59.3ms (= 11859.0ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.10 (= 59.3ms / 54.1ms)

OneFlow resnet50 time: 42.1ms (= 8414.4ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 40.8ms (= 8155.0ms / 200, input_shape=[2, 3, 224, 224])
❌ Relative speed: 0.97 (= 40.8ms / 42.1ms)

OneFlow resnet50 time: 38.7ms (= 7732.8ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 37.1ms (= 7426.7ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 0.96 (= 37.1ms / 38.7ms)

OneFlow swin dataloader time: 0.253s (= 50.601s / 200, num_workers=1)
PyTorch swin dataloader time: 0.151s (= 30.174s / 200, num_workers=1)
Relative speed: 0.596 (= 0.151s / 0.253s)

OneFlow swin dataloader time: 0.065s (= 13.014s / 200, num_workers=4)
PyTorch swin dataloader time: 0.042s (= 8.406s / 200, num_workers=4)
Relative speed: 0.646 (= 0.042s / 0.065s)

OneFlow swin dataloader time: 0.037s (= 7.379s / 200, num_workers=8)
PyTorch swin dataloader time: 0.022s (= 4.434s / 200, num_workers=8)
Relative speed: 0.601 (= 0.022s / 0.037s)

❌ OneFlow resnet50 time: 145.4ms (= 14536.6ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 166.0ms (= 16597.6ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.14 (= 166.0ms / 145.4ms)

OneFlow resnet50 time: 97.1ms (= 9707.6ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 113.1ms (= 11313.8ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.17 (= 113.1ms / 97.1ms)

OneFlow resnet50 time: 76.3ms (= 15257.2ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 88.6ms (= 17718.4ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
❌ Relative speed: 1.16 (= 88.6ms / 76.3ms)

OneFlow resnet50 time: 63.8ms (= 12752.7ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 87.1ms (= 17418.5ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.37 (= 87.1ms / 63.8ms)

OneFlow resnet50 time: 56.8ms (= 11367.3ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 79.2ms (= 15830.1ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.39 (= 79.2ms / 56.8ms)

@hjchen2 hjchen2 merged commit 882b38e into master Apr 29, 2022
@hjchen2 hjchen2 deleted the refine_error_info_with_diff_device_input_and_fix_typo branch April 29, 2022 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants