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

change for sd torch graph compile #10317

Merged
merged 6 commits into from
Aug 22, 2023
Merged

change for sd torch graph compile #10317

merged 6 commits into from
Aug 22, 2023

Conversation

strint
Copy link
Contributor

@strint strint commented Aug 18, 2023

No description provided.

@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.

@github-actions
Copy link
Contributor

Speed stats:

strint and others added 2 commits August 18, 2023 15:42
Co-authored-by: Houjiang Chen <chenhoujiangcug@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.

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce RTX 3080 Ti 

❌ OneFlow resnet50 time: 43.4ms (= 4335.2ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 62.0ms (= 6201.8ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.43 (= 62.0ms / 43.4ms)

OneFlow resnet50 time: 25.9ms (= 2587.8ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 37.5ms (= 3749.4ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.45 (= 37.5ms / 25.9ms)

OneFlow resnet50 time: 19.4ms (= 3876.4ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 36.0ms (= 7192.5ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.86 (= 36.0ms / 19.4ms)

OneFlow resnet50 time: 18.1ms (= 3610.1ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 33.9ms (= 6774.9ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.88 (= 33.9ms / 18.1ms)

OneFlow resnet50 time: 18.2ms (= 3630.3ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 28.9ms (= 5778.1ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.59 (= 28.9ms / 18.2ms)

OneFlow swin dataloader time: 0.201s (= 40.267s / 200, num_workers=1)
PyTorch swin dataloader time: 0.130s (= 25.957s / 200, num_workers=1)
Relative speed: 0.645 (= 0.130s / 0.201s)

OneFlow swin dataloader time: 0.055s (= 11.087s / 200, num_workers=4)
PyTorch swin dataloader time: 0.033s (= 6.504s / 200, num_workers=4)
Relative speed: 0.587 (= 0.033s / 0.055s)

OneFlow swin dataloader time: 0.032s (= 6.352s / 200, num_workers=8)
PyTorch swin dataloader time: 0.016s (= 3.293s / 200, num_workers=8)
Relative speed: 0.518 (= 0.016s / 0.032s)

❌ OneFlow resnet50 time: 48.0ms (= 4800.8ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 63.6ms (= 6355.9ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.32 (= 63.6ms / 48.0ms)

OneFlow resnet50 time: 32.0ms (= 3203.4ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 46.1ms (= 4606.7ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.44 (= 46.1ms / 32.0ms)

OneFlow resnet50 time: 24.3ms (= 4853.4ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 40.9ms (= 8187.2ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.69 (= 40.9ms / 24.3ms)

OneFlow resnet50 time: 21.7ms (= 4332.9ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 36.9ms (= 7384.6ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.70 (= 36.9ms / 21.7ms)

OneFlow resnet50 time: 20.6ms (= 4120.2ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 35.4ms (= 7076.7ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.72 (= 35.4ms / 20.6ms)

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce RTX 3080 Ti 

❌ OneFlow resnet50 time: 43.6ms (= 4357.8ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 57.4ms (= 5744.9ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.32 (= 57.4ms / 43.6ms)

OneFlow resnet50 time: 26.5ms (= 2646.2ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 37.7ms (= 3766.3ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.42 (= 37.7ms / 26.5ms)

OneFlow resnet50 time: 18.7ms (= 3733.1ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 35.7ms (= 7141.9ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.91 (= 35.7ms / 18.7ms)

OneFlow resnet50 time: 19.0ms (= 3792.1ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 31.4ms (= 6282.2ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.66 (= 31.4ms / 19.0ms)

OneFlow resnet50 time: 17.2ms (= 3440.0ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 28.6ms (= 5728.5ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.67 (= 28.6ms / 17.2ms)

OneFlow swin dataloader time: 0.203s (= 40.526s / 200, num_workers=1)
PyTorch swin dataloader time: 0.129s (= 25.782s / 200, num_workers=1)
Relative speed: 0.636 (= 0.129s / 0.203s)

OneFlow swin dataloader time: 0.055s (= 11.016s / 200, num_workers=4)
PyTorch swin dataloader time: 0.033s (= 6.559s / 200, num_workers=4)
Relative speed: 0.595 (= 0.033s / 0.055s)

OneFlow swin dataloader time: 0.031s (= 6.163s / 200, num_workers=8)
PyTorch swin dataloader time: 0.017s (= 3.317s / 200, num_workers=8)
Relative speed: 0.538 (= 0.017s / 0.031s)

❌ OneFlow resnet50 time: 47.6ms (= 4756.4ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 63.1ms (= 6305.6ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.33 (= 63.1ms / 47.6ms)

OneFlow resnet50 time: 31.3ms (= 3127.2ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 45.5ms (= 4551.6ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.46 (= 45.5ms / 31.3ms)

OneFlow resnet50 time: 24.2ms (= 4849.2ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 41.4ms (= 8289.8ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.71 (= 41.4ms / 24.2ms)

OneFlow resnet50 time: 21.9ms (= 4374.2ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 36.6ms (= 7316.2ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.67 (= 36.6ms / 21.9ms)

OneFlow resnet50 time: 21.6ms (= 4311.9ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 36.0ms (= 7194.3ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.67 (= 36.0ms / 21.6ms)

@github-actions
Copy link
Contributor

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

@strint strint requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 21, 2023 07:42
@hjchen2 hjchen2 enabled auto-merge (squash) August 22, 2023 13:14
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce RTX 3080 Ti 

❌ OneFlow resnet50 time: 43.9ms (= 4385.6ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 61.7ms (= 6165.6ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.41 (= 61.7ms / 43.9ms)

OneFlow resnet50 time: 26.0ms (= 2600.1ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 38.3ms (= 3828.8ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.47 (= 38.3ms / 26.0ms)

OneFlow resnet50 time: 18.9ms (= 3773.3ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 34.7ms (= 6939.7ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.84 (= 34.7ms / 18.9ms)

OneFlow resnet50 time: 17.8ms (= 3569.8ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 32.0ms (= 6395.5ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.79 (= 32.0ms / 17.8ms)

OneFlow resnet50 time: 17.4ms (= 3473.2ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 29.8ms (= 5965.7ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.72 (= 29.8ms / 17.4ms)

OneFlow swin dataloader time: 0.202s (= 40.420s / 200, num_workers=1)
PyTorch swin dataloader time: 0.129s (= 25.839s / 200, num_workers=1)
Relative speed: 0.639 (= 0.129s / 0.202s)

OneFlow swin dataloader time: 0.056s (= 11.267s / 200, num_workers=4)
PyTorch swin dataloader time: 0.033s (= 6.613s / 200, num_workers=4)
Relative speed: 0.587 (= 0.033s / 0.056s)

OneFlow swin dataloader time: 0.030s (= 6.073s / 200, num_workers=8)
PyTorch swin dataloader time: 0.016s (= 3.296s / 200, num_workers=8)
Relative speed: 0.543 (= 0.016s / 0.030s)

❌ OneFlow resnet50 time: 47.7ms (= 4773.0ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 62.9ms (= 6292.5ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.32 (= 62.9ms / 47.7ms)

OneFlow resnet50 time: 31.2ms (= 3123.7ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 46.3ms (= 4627.3ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.48 (= 46.3ms / 31.2ms)

OneFlow resnet50 time: 24.0ms (= 4808.8ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 41.0ms (= 8209.0ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.71 (= 41.0ms / 24.0ms)

OneFlow resnet50 time: 21.5ms (= 4303.3ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 39.7ms (= 7939.3ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.84 (= 39.7ms / 21.5ms)

OneFlow resnet50 time: 21.8ms (= 4368.0ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 34.6ms (= 6914.1ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.58 (= 34.6ms / 21.8ms)

@hjchen2 hjchen2 merged commit 0aab78e into master Aug 22, 2023
21 checks passed
@hjchen2 hjchen2 deleted the support_sd_torch_compile branch August 22, 2023 14:15
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