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 RoiAlign sbp infer bug and add eager global test #7794

Merged
merged 62 commits into from
May 10, 2022

Conversation

wyg1997
Copy link
Contributor

@wyg1997 wyg1997 commented Mar 14, 2022

修复 RoiAlign sbp 推导问题,添加 eager global 单测

@github-actions
Copy link
Contributor

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.

@wyg1997 wyg1997 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot March 14, 2022 11:25
@github-actions
Copy link
Contributor

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.

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

CI failed when running job: cuda-module-distributed-rank-1. PR label automerge has been removed

@wyg1997 wyg1997 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot March 30, 2022 02:15
@github-actions
Copy link
Contributor

CI failed when running job: cuda-module-distributed-rank-0. PR label automerge has been removed

@github-actions
Copy link
Contributor

CI failed when running job: cuda-module-distributed-rank-1. PR label automerge has been removed

@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2022

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

Comment on lines +137 to +147
# TODO(wyg): It is a bug in pytorch-1.9.0, torchvision-0.10.0 and python3.7.10.
# Open this test after updating the versions of pytorch in CI.

# @globaltest
# def test_consistent_roi_align(test_case):
# for placement in all_placement():
# # TODO: roi_align only support gpu
# if placement.type == "cpu":
# continue
# for rois_sbp in all_sbp(placement, max_dim=0, except_partial_sum=True):
# _test_roi_align(test_case, placement, rois_sbp)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

在 CI 环境下验证了一下,这个版本的 pytorch 似乎有问题,这里先改成固定数据的单测,之后升级 torch 和 torchvision 可以用上面的单测代码。

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce GTX 1080 

❌ OneFlow resnet50 time: 129.5ms (= 12953.0ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 143.2ms (= 14320.6ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.11 (= 143.2ms / 129.5ms)

OneFlow resnet50 time: 78.3ms (= 7828.2ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 86.8ms (= 8680.8ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.11 (= 86.8ms / 78.3ms)

OneFlow resnet50 time: 53.6ms (= 10713.5ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 52.9ms (= 10583.9ms / 200, input_shape=[4, 3, 224, 224])
❌ Relative speed: 0.99 (= 52.9ms / 53.6ms)

OneFlow resnet50 time: 41.2ms (= 8235.2ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 42.7ms (= 8542.9ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.04 (= 42.7ms / 41.2ms)

OneFlow resnet50 time: 35.8ms (= 7167.9ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 48.0ms (= 9605.8ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.34 (= 48.0ms / 35.8ms)

OneFlow swin dataloader time: 0.441s (= 88.152s / 200, num_workers=1)
PyTorch swin dataloader time: 0.158s (= 31.682s / 200, num_workers=1)
Relative speed: 0.359 (= 0.158s / 0.441s)

OneFlow swin dataloader time: 0.071s (= 14.121s / 200, num_workers=4)
PyTorch swin dataloader time: 0.044s (= 8.749s / 200, num_workers=4)
Relative speed: 0.620 (= 0.044s / 0.071s)

OneFlow swin dataloader time: 0.035s (= 6.994s / 200, num_workers=8)
PyTorch swin dataloader time: 0.022s (= 4.484s / 200, num_workers=8)
Relative speed: 0.641 (= 0.022s / 0.035s)

❌ OneFlow resnet50 time: 145.1ms (= 14508.7ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 168.5ms (= 16847.6ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.16 (= 168.5ms / 145.1ms)

OneFlow resnet50 time: 99.3ms (= 9932.3ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 121.8ms (= 12180.0ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.23 (= 121.8ms / 99.3ms)

OneFlow resnet50 time: 73.1ms (= 14621.9ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 83.6ms (= 16718.3ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
❌ Relative speed: 1.14 (= 83.6ms / 73.1ms)

OneFlow resnet50 time: 63.3ms (= 12651.2ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 98.4ms (= 19674.2ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.56 (= 98.4ms / 63.3ms)

OneFlow resnet50 time: 60.5ms (= 12090.7ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 91.3ms (= 18255.8ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.51 (= 91.3ms / 60.5ms)

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce GTX 1080 

❌ OneFlow resnet50 time: 129.4ms (= 12935.2ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 141.4ms (= 14144.4ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.09 (= 141.4ms / 129.4ms)

OneFlow resnet50 time: 80.3ms (= 8031.5ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 85.5ms (= 8546.4ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.06 (= 85.5ms / 80.3ms)

OneFlow resnet50 time: 54.8ms (= 10955.0ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 56.4ms (= 11288.5ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.03 (= 56.4ms / 54.8ms)

OneFlow resnet50 time: 40.0ms (= 8009.3ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 42.6ms (= 8524.9ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.06 (= 42.6ms / 40.0ms)

OneFlow resnet50 time: 34.3ms (= 6861.1ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 39.6ms (= 7917.9ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.15 (= 39.6ms / 34.3ms)

OneFlow swin dataloader time: 0.252s (= 50.402s / 200, num_workers=1)
PyTorch swin dataloader time: 0.152s (= 30.426s / 200, num_workers=1)
Relative speed: 0.604 (= 0.152s / 0.252s)

OneFlow swin dataloader time: 0.067s (= 13.343s / 200, num_workers=4)
PyTorch swin dataloader time: 0.042s (= 8.383s / 200, num_workers=4)
Relative speed: 0.628 (= 0.042s / 0.067s)

OneFlow swin dataloader time: 0.040s (= 8.064s / 200, num_workers=8)
PyTorch swin dataloader time: 0.023s (= 4.541s / 200, num_workers=8)
Relative speed: 0.563 (= 0.023s / 0.040s)

❌ OneFlow resnet50 time: 144.7ms (= 14470.2ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 167.6ms (= 16764.0ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.16 (= 167.6ms / 144.7ms)

OneFlow resnet50 time: 96.5ms (= 9647.1ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 107.6ms (= 10759.7ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.12 (= 107.6ms / 96.5ms)

OneFlow resnet50 time: 71.2ms (= 14244.7ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 87.6ms (= 17528.7ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.23 (= 87.6ms / 71.2ms)

OneFlow resnet50 time: 62.4ms (= 12470.6ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 73.8ms (= 14757.4ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.18 (= 73.8ms / 62.4ms)

OneFlow resnet50 time: 56.6ms (= 11325.9ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 74.2ms (= 14831.2ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.31 (= 74.2ms / 56.6ms)

@mergify mergify bot merged commit 79824f3 into master May 10, 2022
@mergify mergify bot deleted the test-eager_global_roi_align branch May 10, 2022 14:39
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