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

Migrate pixel_shuffle python layer to functor #7745

Merged
merged 9 commits into from
Mar 16, 2022

Conversation

lixiang007666
Copy link
Contributor

@lixiang007666 lixiang007666 commented Mar 10, 2022

This PR is done:

  • The logic of PixelShufflev2 in the Python layer is encapsulated as a Functor.
  • Fix the problem that pixelshuffle's docstr is not displayed properly.

Related: #4936

Docstr:
before
image
after
image
image

@github-actions
Copy link
Contributor

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

@lixiang007666 lixiang007666 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot March 15, 2022 06:13
@lixiang007666 lixiang007666 enabled auto-merge (squash) March 15, 2022 06:14
@lixiang007666 lixiang007666 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot March 15, 2022 07:24
@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

CI failed when running job: cuda-speed-test. PR label automerge has been removed

@lixiang007666 lixiang007666 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot March 16, 2022 09:04
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot March 16, 2022 09:47
@github-actions
Copy link
Contributor

Speed stats:

@github-actions
Copy link
Contributor

CI failed when running job: cuda-speed-test. PR label automerge has been removed

@lixiang007666 lixiang007666 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot March 16, 2022 10:56
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot March 16, 2022 11:32
@github-actions
Copy link
Contributor

Speed stats:

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

Speed stats:

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

Speed stats:

@lixiang007666 lixiang007666 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot March 16, 2022 12:03
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

✔️ OneFlow resnet50 time: 128.4ms (= 12842.1ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 142.1ms (= 14207.4ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.11 (= 142.1ms / 128.4ms)

✔️ OneFlow resnet50 time: 76.1ms (= 7613.0ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 85.9ms (= 8590.3ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.13 (= 85.9ms / 76.1ms)

OneFlow resnet50 time: 53.5ms (= 10701.8ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 55.7ms (= 11139.3ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.04 (= 55.7ms / 53.5ms)

OneFlow resnet50 time: 41.6ms (= 8325.5ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 49.7ms (= 9935.4ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.19 (= 49.7ms / 41.6ms)

OneFlow resnet50 time: 36.5ms (= 7291.6ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 39.8ms (= 7954.8ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.09 (= 39.8ms / 36.5ms)

md5 /home/ci-user/ci-cache/test_cache/onerec_test/nanodataset.zip 7f5cde8b5a6c411107517ac9b00f29db
md5 /home/ci-user/ci-cache/test_cache/onerec_test/nanodataset.zip 7f5cde8b5a6c411107517ac9b00f29db
build_dataset >>>>>> ImageFolder
build_dataset >>>>>> ImageFolder
✔️ Relative speed: 0.99 (= 50.4s / 49.7s)

md5 /home/ci-user/ci-cache/test_cache/onerec_test/nanodataset.zip 7f5cde8b5a6c411107517ac9b00f29db
md5 /home/ci-user/ci-cache/test_cache/onerec_test/nanodataset.zip 7f5cde8b5a6c411107517ac9b00f29db
build_dataset >>>>>> ImageFolder
build_dataset >>>>>> ImageFolder
✔️ Relative speed: 1.02 (= 14.3s / 14.7s)

md5 /home/ci-user/ci-cache/test_cache/onerec_test/nanodataset.zip 7f5cde8b5a6c411107517ac9b00f29db
md5 /home/ci-user/ci-cache/test_cache/onerec_test/nanodataset.zip 7f5cde8b5a6c411107517ac9b00f29db
build_dataset >>>>>> ImageFolder
build_dataset >>>>>> ImageFolder
✔️ Relative speed: 0.99 (= 7.5s / 7.4s)

✔️ OneFlow resnet50 time: 135.6ms (= 13564.1ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 156.7ms (= 15672.6ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.16 (= 156.7ms / 135.6ms)

OneFlow resnet50 time: 87.3ms (= 8732.6ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 101.8ms (= 10175.8ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.17 (= 101.8ms / 87.3ms)

OneFlow resnet50 time: 62.7ms (= 12530.7ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 77.7ms (= 15534.0ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.24 (= 77.7ms / 62.7ms)

OneFlow resnet50 time: 52.1ms (= 10423.7ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 67.0ms (= 13395.6ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.29 (= 67.0ms / 52.1ms)

OneFlow resnet50 time: 47.5ms (= 9491.9ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 62.2ms (= 12432.7ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.31 (= 62.2ms / 47.5ms)

@lixiang007666 lixiang007666 merged commit c4112a3 into master Mar 16, 2022
@lixiang007666 lixiang007666 deleted the Migrate_pixel_shuffle_python_layer_to_functor branch March 16, 2022 12:33
wyg1997 pushed a commit that referenced this pull request Mar 17, 2022
* Migrate pixel_shuffle python layer to functor

* Format

* Format

* Refine, docstr
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