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 formula of CombinedMarginLoss #8206

Merged
merged 9 commits into from
Jul 1, 2022
Merged

Conversation

marigoold
Copy link
Contributor

此PR完成了:
给CombinedMarginLoss增加了公式,来表明每个参数的作用,并且增加了ArcFace、CosFace和A-Softmax的note

WX20220512-223358@2x

@doombeaker
Copy link
Contributor

doombeaker commented May 12, 2022

@kevinJhz 麻烦江同学 review 这个PR。中间有疑问可以和作者 @marigoold 交流请教。

需要先弄懂这个算子的功能,可能前置条件本身就一定挑战(比如可能需要去看下 kernel 实现)

@marigoold marigoold requested a review from oneflow-ci-bot July 1, 2022 05:59
@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2022

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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2022

Speed stats:
GPU Name: NVIDIA GeForce GTX 1080 

❌ OneFlow resnet50 time: 129.3ms (= 12926.7ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 146.3ms (= 14628.4ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.13 (= 146.3ms / 129.3ms)

OneFlow resnet50 time: 75.5ms (= 7550.4ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 84.3ms (= 8433.3ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.12 (= 84.3ms / 75.5ms)

OneFlow resnet50 time: 48.7ms (= 9742.2ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 61.1ms (= 12210.9ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.25 (= 61.1ms / 48.7ms)

OneFlow resnet50 time: 39.5ms (= 7897.1ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 42.6ms (= 8518.0ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.08 (= 42.6ms / 39.5ms)

OneFlow resnet50 time: 34.4ms (= 6871.2ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 35.4ms (= 7071.9ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.03 (= 35.4ms / 34.4ms)

OneFlow swin dataloader time: 0.277s (= 55.401s / 200, num_workers=1)
PyTorch swin dataloader time: 0.154s (= 30.788s / 200, num_workers=1)
Relative speed: 0.556 (= 0.154s / 0.277s)

OneFlow swin dataloader time: 0.081s (= 16.198s / 200, num_workers=4)
PyTorch swin dataloader time: 0.041s (= 8.116s / 200, num_workers=4)
Relative speed: 0.501 (= 0.041s / 0.081s)

OneFlow swin dataloader time: 0.045s (= 9.016s / 200, num_workers=8)
PyTorch swin dataloader time: 0.022s (= 4.462s / 200, num_workers=8)
Relative speed: 0.495 (= 0.022s / 0.045s)

❌ OneFlow resnet50 time: 144.8ms (= 14481.4ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 168.7ms (= 16866.7ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.16 (= 168.7ms / 144.8ms)

OneFlow resnet50 time: 93.9ms (= 9386.0ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 112.4ms (= 11244.3ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.20 (= 112.4ms / 93.9ms)

OneFlow resnet50 time: 70.7ms (= 14133.3ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 85.0ms (= 16995.7ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.20 (= 85.0ms / 70.7ms)

OneFlow resnet50 time: 57.1ms (= 11421.7ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 76.0ms (= 15198.9ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.33 (= 76.0ms / 57.1ms)

OneFlow resnet50 time: 51.7ms (= 10343.3ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 74.2ms (= 14842.6ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.43 (= 74.2ms / 51.7ms)

@mergify mergify bot merged commit 6eda847 into master Jul 1, 2022
@mergify mergify bot deleted the doc-add_CombinedMarginLoss_doc branch July 1, 2022 14:41
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