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

move logical op dostring, and refine docstr file #8297

Merged
merged 15 commits into from
May 27, 2022
Merged

Conversation

doombeaker
Copy link
Contributor

@doombeaker doombeaker commented May 25, 2022

这个 #8064 增加 docstr 文件时,忘记在 __init__.py 中导入新的文件了。导致 docstr 没有生效:https://oneflow.readthedocs.io/en/master/oneflow.html#oneflow.logical_xor

image

本 PR 在 __init__.py 里添加了导入。顺便修改了一些细节(给 oneflow._C.xxx 添加 docstr 是以前没有讲究的做法,后来看到其它PR要求,直接给面向用户的 API 添加 docstring),把另外文件的 logical op 集中到了一起。

@doombeaker doombeaker changed the title remove duplicated dostring, and refine docstr file move logical op dostring, and refine docstr file May 25, 2022
@hjchen2 hjchen2 enabled auto-merge (squash) May 25, 2022 02:57
@doombeaker doombeaker requested a review from oneflow-ci-bot May 27, 2022 01:28
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce GTX 1080 

❌ OneFlow resnet50 time: 130.4ms (= 13044.9ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 144.2ms (= 14416.0ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.11 (= 144.2ms / 130.4ms)

OneFlow resnet50 time: 78.6ms (= 7860.9ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 91.0ms (= 9100.4ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.16 (= 91.0ms / 78.6ms)

OneFlow resnet50 time: 55.0ms (= 10996.7ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 58.4ms (= 11672.7ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.06 (= 58.4ms / 55.0ms)

OneFlow resnet50 time: 40.3ms (= 8061.5ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 43.6ms (= 8712.6ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.08 (= 43.6ms / 40.3ms)

OneFlow resnet50 time: 34.6ms (= 6914.8ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 36.7ms (= 7342.9ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.06 (= 36.7ms / 34.6ms)

OneFlow swin dataloader time: 0.246s (= 49.168s / 200, num_workers=1)
PyTorch swin dataloader time: 0.151s (= 30.276s / 200, num_workers=1)
Relative speed: 0.616 (= 0.151s / 0.246s)

OneFlow swin dataloader time: 0.066s (= 13.129s / 200, num_workers=4)
PyTorch swin dataloader time: 0.041s (= 8.246s / 200, num_workers=4)
Relative speed: 0.628 (= 0.041s / 0.066s)

OneFlow swin dataloader time: 0.037s (= 7.441s / 200, num_workers=8)
PyTorch swin dataloader time: 0.022s (= 4.394s / 200, num_workers=8)
Relative speed: 0.590 (= 0.022s / 0.037s)

❌ OneFlow resnet50 time: 147.3ms (= 14729.6ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 174.5ms (= 17447.6ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.18 (= 174.5ms / 147.3ms)

OneFlow resnet50 time: 97.5ms (= 9752.6ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 113.7ms (= 11365.7ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.17 (= 113.7ms / 97.5ms)

OneFlow resnet50 time: 71.6ms (= 14320.3ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 88.1ms (= 17615.8ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.23 (= 88.1ms / 71.6ms)

OneFlow resnet50 time: 59.1ms (= 11828.2ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 73.7ms (= 14748.4ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.25 (= 73.7ms / 59.1ms)

OneFlow resnet50 time: 54.5ms (= 10899.9ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 76.2ms (= 15233.3ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.40 (= 76.2ms / 54.5ms)

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce GTX 1080 

❌ OneFlow resnet50 time: 130.5ms (= 13046.5ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 143.8ms (= 14381.9ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.10 (= 143.8ms / 130.5ms)

OneFlow resnet50 time: 76.9ms (= 7687.9ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 89.0ms (= 8899.2ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.16 (= 89.0ms / 76.9ms)

OneFlow resnet50 time: 54.8ms (= 10963.0ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 62.6ms (= 12515.2ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.14 (= 62.6ms / 54.8ms)

OneFlow resnet50 time: 41.5ms (= 8292.4ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 44.6ms (= 8927.9ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.08 (= 44.6ms / 41.5ms)

OneFlow resnet50 time: 36.9ms (= 7371.5ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 40.6ms (= 8121.8ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.10 (= 40.6ms / 36.9ms)

OneFlow swin dataloader time: 0.245s (= 48.965s / 200, num_workers=1)
PyTorch swin dataloader time: 0.152s (= 30.416s / 200, num_workers=1)
Relative speed: 0.621 (= 0.152s / 0.245s)

OneFlow swin dataloader time: 0.104s (= 20.821s / 200, num_workers=4)
PyTorch swin dataloader time: 0.041s (= 8.260s / 200, num_workers=4)
Relative speed: 0.397 (= 0.041s / 0.104s)

OneFlow swin dataloader time: 0.035s (= 7.076s / 200, num_workers=8)
PyTorch swin dataloader time: 0.024s (= 4.700s / 200, num_workers=8)
Relative speed: 0.664 (= 0.024s / 0.035s)

❌ OneFlow resnet50 time: 146.2ms (= 14615.9ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 173.6ms (= 17356.1ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.19 (= 173.6ms / 146.2ms)

OneFlow resnet50 time: 97.2ms (= 9723.1ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 113.9ms (= 11390.2ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.17 (= 113.9ms / 97.2ms)

OneFlow resnet50 time: 73.4ms (= 14685.9ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 88.1ms (= 17616.2ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.20 (= 88.1ms / 73.4ms)

OneFlow resnet50 time: 60.9ms (= 12188.0ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 74.7ms (= 14930.8ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.23 (= 74.7ms / 60.9ms)

OneFlow resnet50 time: 56.3ms (= 11257.5ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 70.7ms (= 14141.7ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.26 (= 70.7ms / 56.3ms)

@hjchen2 hjchen2 merged commit 07e9f2c into master May 27, 2022
@hjchen2 hjchen2 deleted the fix_non_docstr branch May 27, 2022 15:43
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