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

add_npu_support for goup_norm #10496

Merged
merged 3 commits into from
May 20, 2024
Merged

Conversation

woaixiaoxiao
Copy link
Contributor

原来的实现中只考虑了cuda作为底层实现,而没考虑npu,mlu等其他硬件

@CLAassistant
Copy link

CLAassistant commented Apr 22, 2024

CLA assistant check
All committers have signed the CLA.

@woaixiaoxiao woaixiaoxiao enabled auto-merge (squash) April 23, 2024 02:45
Copy link
Contributor

Copy link
Contributor

1 similar comment
Copy link
Contributor

Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce RTX 3080 Ti 

❌ OneFlow resnet50 time: 43.7ms (= 4373.8ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 57.7ms (= 5772.1ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.32 (= 57.7ms / 43.7ms)

OneFlow resnet50 time: 26.1ms (= 2612.8ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 38.1ms (= 3805.6ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.46 (= 38.1ms / 26.1ms)

OneFlow resnet50 time: 18.6ms (= 3724.1ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 35.6ms (= 7111.7ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.91 (= 35.6ms / 18.6ms)

OneFlow resnet50 time: 17.2ms (= 3438.0ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 30.9ms (= 6178.6ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.80 (= 30.9ms / 17.2ms)

OneFlow resnet50 time: 17.3ms (= 3469.3ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 27.9ms (= 5589.4ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.61 (= 27.9ms / 17.3ms)

OneFlow swin dataloader time: 0.201s (= 40.146s / 200, num_workers=1)
PyTorch swin dataloader time: 0.127s (= 25.471s / 200, num_workers=1)
Relative speed: 0.634 (= 0.127s / 0.201s)

OneFlow swin dataloader time: 0.057s (= 11.462s / 200, num_workers=4)
PyTorch swin dataloader time: 0.032s (= 6.445s / 200, num_workers=4)
Relative speed: 0.562 (= 0.032s / 0.057s)

OneFlow swin dataloader time: 0.032s (= 6.326s / 200, num_workers=8)
PyTorch swin dataloader time: 0.017s (= 3.340s / 200, num_workers=8)
Relative speed: 0.528 (= 0.017s / 0.032s)

❌ OneFlow resnet50 time: 49.2ms (= 4918.7ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 66.6ms (= 6660.1ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.35 (= 66.6ms / 49.2ms)

OneFlow resnet50 time: 36.5ms (= 3647.7ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 45.8ms (= 4578.7ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.26 (= 45.8ms / 36.5ms)

OneFlow resnet50 time: 27.8ms (= 5556.5ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 38.4ms (= 7671.1ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.38 (= 38.4ms / 27.8ms)

OneFlow resnet50 time: 25.3ms (= 5065.0ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 38.5ms (= 7697.2ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.52 (= 38.5ms / 25.3ms)

OneFlow resnet50 time: 24.5ms (= 4898.0ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 35.9ms (= 7175.3ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.46 (= 35.9ms / 24.5ms)

@woaixiaoxiao woaixiaoxiao merged commit 57951e4 into master May 20, 2024
20 checks passed
@woaixiaoxiao woaixiaoxiao deleted the add_npu_support_for_group_norm branch May 20, 2024 22:28
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

4 participants