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 ddp broadcast and add speed/memory test in ci #6044

Merged
merged 7 commits into from
Aug 26, 2021

Conversation

daquexian
Copy link
Contributor

  1. 把 ddp 里的 broadcast 改成 inplace,优化性能
  2. ci 里增加对显存占用量的测试和 ddp 的速度测试

Signed-off-by: daquexian <daquexian566@gmail.com>
Signed-off-by: daquexian <daquexian566@gmail.com>
@daquexian daquexian requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 26, 2021 03:59
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

OneFlow resnet50 time: 127.6ms (= 6381.8ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 139.7ms (= 6986.0ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 1.09 (= 139.7ms / 127.6ms)

OneFlow resnet50 time: 74.2ms (= 3709.4ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 84.7ms (= 4237.0ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 1.14 (= 84.7ms / 74.2ms)

OneFlow resnet50 time: 47.2ms (= 2360.4ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 56.8ms (= 2842.2ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 1.20 (= 56.8ms / 47.2ms)

OneFlow resnet50 time: 39.1ms (= 1954.6ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 48.3ms (= 2417.2ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 1.24 (= 48.3ms / 39.1ms)

OneFlow resnet50 time: 38.4ms (= 1918.8ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 43.6ms (= 2177.6ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 1.13 (= 43.6ms / 38.4ms)

OneFlow resnet50 time: 147.9ms (= 7394.0ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 151.3ms (= 7564.2ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 1.02 (= 151.3ms / 147.9ms)

OneFlow resnet50 time: 94.5ms (= 4722.7ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 91.6ms (= 4578.5ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 0.97 (= 91.6ms / 94.5ms)

OneFlow resnet50 time: 67.6ms (= 3381.5ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 62.8ms (= 3140.0ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 0.93 (= 62.8ms / 67.6ms)

OneFlow resnet50 time: 61.7ms (= 3084.0ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 54.5ms (= 2727.1ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 0.88 (= 54.5ms / 61.7ms)

OneFlow resnet50 time: 60.8ms (= 3041.3ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 46.9ms (= 2344.7ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 0.77 (= 46.9ms / 60.8ms)

@oneflow-ci-bot oneflow-ci-bot removed their request for review August 26, 2021 06:36
@oneflow-ci-bot oneflow-ci-bot self-requested a review August 26, 2021 12:39
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 26, 2021 14:31
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 26, 2021 16:04
@oneflow-ci-bot oneflow-ci-bot self-requested a review August 26, 2021 17:04
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

OneFlow resnet50 time: 127.4ms (= 6372.4ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 145.0ms (= 7249.5ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 1.14 (= 145.0ms / 127.4ms)

OneFlow resnet50 time: 74.2ms (= 3709.1ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 83.8ms (= 4189.8ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 1.13 (= 83.8ms / 74.2ms)

OneFlow resnet50 time: 47.0ms (= 2351.6ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 58.9ms (= 2942.6ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 1.25 (= 58.9ms / 47.0ms)

OneFlow resnet50 time: 40.7ms (= 2033.7ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 48.1ms (= 2406.4ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 1.18 (= 48.1ms / 40.7ms)

OneFlow resnet50 time: 39.1ms (= 1956.5ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 40.9ms (= 2042.5ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 1.04 (= 40.9ms / 39.1ms)

OneFlow resnet50 time: 145.2ms (= 7258.6ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 148.0ms (= 7398.6ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 1.02 (= 148.0ms / 145.2ms)

OneFlow resnet50 time: 94.6ms (= 4729.2ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 93.7ms (= 4687.1ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 0.99 (= 93.7ms / 94.6ms)

OneFlow resnet50 time: 66.0ms (= 3300.3ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 62.0ms (= 3100.1ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 0.94 (= 62.0ms / 66.0ms)

OneFlow resnet50 time: 57.4ms (= 2868.8ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 53.0ms (= 2652.1ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 0.92 (= 53.0ms / 57.4ms)

OneFlow resnet50 time: 59.9ms (= 2992.9ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow GPU used (rank 0): 0 MiB
PyTorch resnet50 time: 48.2ms (= 2409.1ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
PyTorch GPU used (rank 0, estimated): 0 MiB
Relative speed: 0.80 (= 48.2ms / 59.9ms)

@oneflow-ci-bot oneflow-ci-bot removed their request for review August 26, 2021 18:58
@oneflow-ci-bot oneflow-ci-bot merged commit 8ce47b5 into master Aug 26, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the optimize_ddp_broadcast branch August 26, 2021 18:58
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.

None yet

3 participants