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

Aligned tensor.add method #8140

Merged
merged 8 commits into from
May 7, 2022
Merged

Aligned tensor.add method #8140

merged 8 commits into from
May 7, 2022

Conversation

EsdeathYZH
Copy link
Contributor

@EsdeathYZH EsdeathYZH commented May 5, 2022

目前master的Tensor.add接口缺少alpha参数,需要对齐pytorch接口

更新后的文档:
image

Pytorch文档链接:https://pytorch.org/docs/stable/generated/torch.add.html

@zhongshsh
Copy link
Contributor

tensor 文档(\python\oneflow\framework\docstr\tensor.py )的 add 和 add_没有定义好方法参数,麻烦统一修改一下。
image

@EsdeathYZH
Copy link
Contributor Author

tensor 文档(\python\oneflow\framework\docstr\tensor.py )的 add 和 add_没有定义好方法参数,麻烦统一修改一下。 image

这个会随着接口的变动自动更新,我这里的doc:
image

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2022

Speed stats:

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2022

Speed stats:

@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2022

Speed stats:
GPU Name: NVIDIA GeForce GTX 1080 

✔️ OneFlow resnet50 time: 129.0ms (= 12902.8ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 143.9ms (= 14387.4ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.12 (= 143.9ms / 129.0ms)

OneFlow resnet50 time: 82.8ms (= 8277.6ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 84.9ms (= 8494.0ms / 100, input_shape=[8, 3, 224, 224])
❌ Relative speed: 1.03 (= 84.9ms / 82.8ms)

OneFlow resnet50 time: 53.6ms (= 10722.9ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 58.7ms (= 11743.2ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.10 (= 58.7ms / 53.6ms)

OneFlow resnet50 time: 43.4ms (= 8674.6ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 45.1ms (= 9010.3ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.04 (= 45.1ms / 43.4ms)

OneFlow resnet50 time: 35.2ms (= 7031.6ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 37.8ms (= 7551.5ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.07 (= 37.8ms / 35.2ms)

OneFlow swin dataloader time: 0.254s (= 50.866s / 200, num_workers=1)
PyTorch swin dataloader time: 0.152s (= 30.392s / 200, num_workers=1)
Relative speed: 0.597 (= 0.152s / 0.254s)

OneFlow swin dataloader time: 0.068s (= 13.519s / 200, num_workers=4)
PyTorch swin dataloader time: 0.043s (= 8.593s / 200, num_workers=4)
Relative speed: 0.636 (= 0.043s / 0.068s)

OneFlow swin dataloader time: 0.037s (= 7.484s / 200, num_workers=8)
PyTorch swin dataloader time: 0.022s (= 4.318s / 200, num_workers=8)
Relative speed: 0.577 (= 0.022s / 0.037s)

❌ OneFlow resnet50 time: 145.2ms (= 14515.8ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 167.7ms (= 16773.0ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.16 (= 167.7ms / 145.2ms)

OneFlow resnet50 time: 99.0ms (= 9900.1ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 111.7ms (= 11171.3ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.13 (= 111.7ms / 99.0ms)

OneFlow resnet50 time: 73.7ms (= 14745.9ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 88.3ms (= 17667.8ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.20 (= 88.3ms / 73.7ms)

OneFlow resnet50 time: 62.1ms (= 12410.8ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 74.9ms (= 14986.7ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.21 (= 74.9ms / 62.1ms)

OneFlow resnet50 time: 55.9ms (= 11175.4ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 77.3ms (= 15461.5ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.38 (= 77.3ms / 55.9ms)

@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2022

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

@mergify mergify bot merged commit 6d8b1b3 into master May 7, 2022
@mergify mergify bot deleted the aligned_tensor_add branch May 7, 2022 01:27
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