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

optimize ci speed in expensive eager test #8504

Merged
merged 10 commits into from
Jun 29, 2022

Conversation

BBuf
Copy link
Contributor

@BBuf BBuf commented Jun 28, 2022

  • AutoTest在梯度的数值无法对齐时输出梯度的具体值。
  • 减少 expensive/test_convtranspose.py 运行时间。175s->12s。
  • 减少 expensive/test_einsum.py 运行时间(和德澎确认过)。262s->84s。
  • 减少 expensive/test_sqrt_square_sum.py 运行时间。119s->18s。

以上 expensive 里耗时巨大的Eager Test可以减少到原来总执行时间的 (175 + 262 + 119) / (12 + 84 + 18) = 556 / 114 等于4.8倍。

@BBuf BBuf requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 28, 2022 09:12
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 28, 2022 17:39
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 28, 2022 20:03
@github-actions
Copy link
Contributor

Speed stats:

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce GTX 1080 

❌ OneFlow resnet50 time: 129.1ms (= 12912.2ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 143.9ms (= 14388.5ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.11 (= 143.9ms / 129.1ms)

OneFlow resnet50 time: 75.4ms (= 7543.3ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 84.3ms (= 8425.3ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.12 (= 84.3ms / 75.4ms)

OneFlow resnet50 time: 48.8ms (= 9761.3ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 59.7ms (= 11940.0ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.22 (= 59.7ms / 48.8ms)

OneFlow resnet50 time: 39.9ms (= 7974.4ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 45.2ms (= 9030.7ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.13 (= 45.2ms / 39.9ms)

OneFlow resnet50 time: 35.0ms (= 6997.1ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 39.0ms (= 7794.3ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.11 (= 39.0ms / 35.0ms)

OneFlow swin dataloader time: 0.263s (= 52.554s / 200, num_workers=1)
PyTorch swin dataloader time: 0.157s (= 31.345s / 200, num_workers=1)
Relative speed: 0.596 (= 0.157s / 0.263s)

OneFlow swin dataloader time: 0.083s (= 16.618s / 200, num_workers=4)
PyTorch swin dataloader time: 0.041s (= 8.240s / 200, num_workers=4)
Relative speed: 0.496 (= 0.041s / 0.083s)

OneFlow swin dataloader time: 0.045s (= 8.929s / 200, num_workers=8)
PyTorch swin dataloader time: 0.023s (= 4.672s / 200, num_workers=8)
Relative speed: 0.523 (= 0.023s / 0.045s)

❌ OneFlow resnet50 time: 144.3ms (= 14427.2ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 169.2ms (= 16918.3ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.17 (= 169.2ms / 144.3ms)

OneFlow resnet50 time: 92.5ms (= 9248.7ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 116.5ms (= 11647.8ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.26 (= 116.5ms / 92.5ms)

OneFlow resnet50 time: 68.6ms (= 13720.0ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 89.0ms (= 17791.9ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.30 (= 89.0ms / 68.6ms)

OneFlow resnet50 time: 57.2ms (= 11433.7ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 81.2ms (= 16231.4ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.42 (= 81.2ms / 57.2ms)

OneFlow resnet50 time: 52.9ms (= 10575.2ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 69.3ms (= 13865.8ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.31 (= 69.3ms / 52.9ms)

@github-actions
Copy link
Contributor

Speed stats:

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce GTX 1080 

✔️ OneFlow resnet50 time: 129.0ms (= 12903.4ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 142.9ms (= 14285.3ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.11 (= 142.9ms / 129.0ms)

OneFlow resnet50 time: 75.5ms (= 7552.5ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 84.7ms (= 8471.1ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.12 (= 84.7ms / 75.5ms)

OneFlow resnet50 time: 49.4ms (= 9889.9ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 57.9ms (= 11577.8ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.17 (= 57.9ms / 49.4ms)

OneFlow resnet50 time: 39.9ms (= 7973.7ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 44.6ms (= 8930.0ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.12 (= 44.6ms / 39.9ms)

OneFlow resnet50 time: 36.1ms (= 7215.6ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 37.8ms (= 7567.8ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.05 (= 37.8ms / 36.1ms)

OneFlow swin dataloader time: 0.286s (= 57.147s / 200, num_workers=1)
PyTorch swin dataloader time: 0.155s (= 30.915s / 200, num_workers=1)
Relative speed: 0.541 (= 0.155s / 0.286s)

OneFlow swin dataloader time: 0.082s (= 16.410s / 200, num_workers=4)
PyTorch swin dataloader time: 0.041s (= 8.137s / 200, num_workers=4)
Relative speed: 0.496 (= 0.041s / 0.082s)

OneFlow swin dataloader time: 0.047s (= 9.410s / 200, num_workers=8)
PyTorch swin dataloader time: 0.023s (= 4.560s / 200, num_workers=8)
Relative speed: 0.485 (= 0.023s / 0.047s)

❌ OneFlow resnet50 time: 145.3ms (= 14532.5ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 170.7ms (= 17066.7ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.17 (= 170.7ms / 145.3ms)

OneFlow resnet50 time: 93.8ms (= 9376.9ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 114.0ms (= 11399.1ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.22 (= 114.0ms / 93.8ms)

OneFlow resnet50 time: 70.4ms (= 14070.8ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 95.8ms (= 19164.4ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.36 (= 95.8ms / 70.4ms)

OneFlow resnet50 time: 57.0ms (= 11403.0ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 75.9ms (= 15172.4ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.33 (= 75.9ms / 57.0ms)

OneFlow resnet50 time: 51.0ms (= 10208.4ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 79.1ms (= 15827.4ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.55 (= 79.1ms / 51.0ms)

@mergify mergify bot merged commit 3654513 into master Jun 29, 2022
@mergify mergify bot deleted the optimize_ci_speed_in_expensive_test branch June 29, 2022 10:22
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.

3 participants