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

unset lazy&verbose env var when disabling mock torch by command line #9970

Merged
merged 10 commits into from
Mar 12, 2023

Conversation

daquexian
Copy link
Contributor

@daquexian daquexian commented Mar 10, 2023

  1. 修复通过命令行开启 mock 之后环境变量残留导致 api 方式的 mock 参数错误的问题
  2. 将 scaled_dot_product_attention 加入 lazy mock 的黑名单,让 hasattr(F, "scaled_dot_product_attention") 返回 False

Signed-off-by: daquexian <daquexian566@gmail.com>
daquexian and others added 2 commits March 10, 2023 23:04
Signed-off-by: daquexian <daquexian566@gmail.com>
@github-actions
Copy link
Contributor

Code got formatted by CI. Please request CI again if you still want to have this PR merged. If the PR is from a forked repo, please download the patch files from the GitHub Actions web page and apply them locally.

@daquexian daquexian requested review from oneflow-ci-bot and removed request for oneflow-ci-bot March 10, 2023 15:09
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

❌ OneFlow resnet50 time: 141.2ms (= 14118.7ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 143.1ms (= 14307.7ms / 100, input_shape=[16, 3, 224, 224])
❌ Relative speed: 1.01 (= 143.1ms / 141.2ms)

OneFlow resnet50 time: 82.9ms (= 8285.2ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 88.1ms (= 8809.9ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.06 (= 88.1ms / 82.9ms)

OneFlow resnet50 time: 51.1ms (= 10210.9ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 62.7ms (= 12538.0ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.23 (= 62.7ms / 51.1ms)

OneFlow resnet50 time: 33.7ms (= 6743.7ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 44.0ms (= 8796.4ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.30 (= 44.0ms / 33.7ms)

OneFlow resnet50 time: 25.9ms (= 5171.9ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 43.4ms (= 8679.0ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.68 (= 43.4ms / 25.9ms)

OneFlow swin dataloader time: 0.238s (= 47.574s / 200, num_workers=1)
PyTorch swin dataloader time: 0.148s (= 29.689s / 200, num_workers=1)
Relative speed: 0.624 (= 0.148s / 0.238s)

OneFlow swin dataloader time: 0.068s (= 13.556s / 200, num_workers=4)
PyTorch swin dataloader time: 0.041s (= 8.204s / 200, num_workers=4)
Relative speed: 0.605 (= 0.041s / 0.068s)

OneFlow swin dataloader time: 0.044s (= 8.808s / 200, num_workers=8)
PyTorch swin dataloader time: 0.024s (= 4.719s / 200, num_workers=8)
Relative speed: 0.536 (= 0.024s / 0.044s)

❌ OneFlow resnet50 time: 153.2ms (= 15323.6ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 165.2ms (= 16516.6ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
❌ Relative speed: 1.08 (= 165.2ms / 153.2ms)

OneFlow resnet50 time: 93.6ms (= 9364.0ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 106.0ms (= 10596.8ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.13 (= 106.0ms / 93.6ms)

OneFlow resnet50 time: 60.9ms (= 12174.9ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 83.5ms (= 16692.6ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.37 (= 83.5ms / 60.9ms)

OneFlow resnet50 time: 42.8ms (= 8554.2ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 74.1ms (= 14822.7ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.73 (= 74.1ms / 42.8ms)

OneFlow resnet50 time: 37.3ms (= 7460.3ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 68.7ms (= 13740.4ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.84 (= 68.7ms / 37.3ms)

@github-actions
Copy link
Contributor

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

@daquexian daquexian requested review from oneflow-ci-bot and removed request for oneflow-ci-bot March 12, 2023 06:08
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

❌ OneFlow resnet50 time: 141.2ms (= 14116.5ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 144.4ms (= 14435.6ms / 100, input_shape=[16, 3, 224, 224])
❌ Relative speed: 1.02 (= 144.4ms / 141.2ms)

OneFlow resnet50 time: 82.9ms (= 8290.2ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 89.5ms (= 8945.2ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.08 (= 89.5ms / 82.9ms)

OneFlow resnet50 time: 51.1ms (= 10213.1ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 59.1ms (= 11812.1ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.16 (= 59.1ms / 51.1ms)

OneFlow resnet50 time: 33.9ms (= 6779.4ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 48.8ms (= 9755.5ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.44 (= 48.8ms / 33.9ms)

OneFlow resnet50 time: 26.3ms (= 5266.2ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 34.8ms (= 6953.0ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.32 (= 34.8ms / 26.3ms)

OneFlow swin dataloader time: 0.238s (= 47.600s / 200, num_workers=1)
PyTorch swin dataloader time: 0.149s (= 29.824s / 200, num_workers=1)
Relative speed: 0.627 (= 0.149s / 0.238s)

OneFlow swin dataloader time: 0.067s (= 13.497s / 200, num_workers=4)
PyTorch swin dataloader time: 0.041s (= 8.200s / 200, num_workers=4)
Relative speed: 0.608 (= 0.041s / 0.067s)

OneFlow swin dataloader time: 0.043s (= 8.504s / 200, num_workers=8)
PyTorch swin dataloader time: 0.022s (= 4.456s / 200, num_workers=8)
Relative speed: 0.524 (= 0.022s / 0.043s)

❌ OneFlow resnet50 time: 153.3ms (= 15334.8ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 165.1ms (= 16505.5ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
❌ Relative speed: 1.08 (= 165.1ms / 153.3ms)

OneFlow resnet50 time: 93.8ms (= 9378.4ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 103.6ms (= 10364.1ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.11 (= 103.6ms / 93.8ms)

OneFlow resnet50 time: 60.9ms (= 12178.2ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 79.0ms (= 15793.7ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.30 (= 79.0ms / 60.9ms)

OneFlow resnet50 time: 43.4ms (= 8672.9ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 72.2ms (= 14450.0ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.67 (= 72.2ms / 43.4ms)

OneFlow resnet50 time: 36.6ms (= 7319.9ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 69.5ms (= 13908.7ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.90 (= 69.5ms / 36.6ms)

@github-actions
Copy link
Contributor

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

@mergify mergify bot merged commit 5ab28bb into master Mar 12, 2023
@mergify mergify bot deleted the fix_mock_cli_disable branch March 12, 2023 07:10
@aungmyin1
Copy link

Code got formatted by CI. Please request CI again if you still want to have this PR merged. If the PR is from a forked repo, please download the patch files from the GitHub Actions web page and apply them locally.

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.

5 participants