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

Feat graph load to new device #10335

Merged
merged 25 commits into from
Oct 6, 2023
Merged

Feat graph load to new device #10335

merged 25 commits into from
Oct 6, 2023

Conversation

strint
Copy link
Contributor

@strint strint commented Sep 22, 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

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce RTX 3080 Ti 

❌ OneFlow resnet50 time: 43.9ms (= 4389.0ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 57.3ms (= 5725.1ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.30 (= 57.3ms / 43.9ms)

OneFlow resnet50 time: 26.4ms (= 2644.1ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 37.6ms (= 3763.5ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.42 (= 37.6ms / 26.4ms)

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

OneFlow resnet50 time: 18.9ms (= 3774.4ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 33.3ms (= 6651.0ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.76 (= 33.3ms / 18.9ms)

OneFlow resnet50 time: 18.0ms (= 3603.4ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 29.3ms (= 5853.9ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.62 (= 29.3ms / 18.0ms)

OneFlow swin dataloader time: 0.202s (= 40.332s / 200, num_workers=1)
PyTorch swin dataloader time: 0.128s (= 25.674s / 200, num_workers=1)
Relative speed: 0.637 (= 0.128s / 0.202s)

OneFlow swin dataloader time: 0.056s (= 11.177s / 200, num_workers=4)
PyTorch swin dataloader time: 0.033s (= 6.591s / 200, num_workers=4)
Relative speed: 0.590 (= 0.033s / 0.056s)

OneFlow swin dataloader time: 0.031s (= 6.174s / 200, num_workers=8)
PyTorch swin dataloader time: 0.018s (= 3.543s / 200, num_workers=8)
Relative speed: 0.574 (= 0.018s / 0.031s)

❌ OneFlow resnet50 time: 47.6ms (= 4760.4ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 65.4ms (= 6540.6ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.37 (= 65.4ms / 47.6ms)

OneFlow resnet50 time: 32.8ms (= 3283.1ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 43.7ms (= 4370.0ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.33 (= 43.7ms / 32.8ms)

OneFlow resnet50 time: 23.8ms (= 4766.5ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 41.3ms (= 8252.5ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.73 (= 41.3ms / 23.8ms)

OneFlow resnet50 time: 22.0ms (= 4404.8ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 36.5ms (= 7307.8ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.66 (= 36.5ms / 22.0ms)

OneFlow resnet50 time: 21.1ms (= 4214.4ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 36.0ms (= 7200.2ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.71 (= 36.0ms / 21.1ms)

@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 strint added graph graph mode feature labels Sep 27, 2023
@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

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce RTX 3080 Ti 

❌ OneFlow resnet50 time: 43.8ms (= 4377.9ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 57.2ms (= 5720.9ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.31 (= 57.2ms / 43.8ms)

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

OneFlow resnet50 time: 18.9ms (= 3782.8ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 36.0ms (= 7191.9ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.90 (= 36.0ms / 18.9ms)

OneFlow resnet50 time: 18.3ms (= 3655.3ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 33.7ms (= 6744.6ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.85 (= 33.7ms / 18.3ms)

OneFlow resnet50 time: 18.0ms (= 3596.9ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 30.0ms (= 5991.6ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.67 (= 30.0ms / 18.0ms)

OneFlow swin dataloader time: 0.202s (= 40.399s / 200, num_workers=1)
PyTorch swin dataloader time: 0.128s (= 25.604s / 200, num_workers=1)
Relative speed: 0.634 (= 0.128s / 0.202s)

OneFlow swin dataloader time: 0.053s (= 10.641s / 200, num_workers=4)
PyTorch swin dataloader time: 0.033s (= 6.613s / 200, num_workers=4)
Relative speed: 0.621 (= 0.033s / 0.053s)

OneFlow swin dataloader time: 0.030s (= 6.048s / 200, num_workers=8)
PyTorch swin dataloader time: 0.017s (= 3.408s / 200, num_workers=8)
Relative speed: 0.563 (= 0.017s / 0.030s)

❌ OneFlow resnet50 time: 47.5ms (= 4751.5ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 64.3ms (= 6432.2ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.35 (= 64.3ms / 47.5ms)

OneFlow resnet50 time: 31.7ms (= 3169.6ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 45.6ms (= 4557.3ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.44 (= 45.6ms / 31.7ms)

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

OneFlow resnet50 time: 22.1ms (= 4423.7ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 36.9ms (= 7372.4ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.67 (= 36.9ms / 22.1ms)

OneFlow resnet50 time: 20.7ms (= 4132.0ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 34.3ms (= 6867.4ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.66 (= 34.3ms / 20.7ms)

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

@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 strint changed the title Feat graph load to non 0 device Feat graph load to new device Oct 4, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

Speed stats:
GPU Name: NVIDIA GeForce RTX 3080 Ti 

❌ OneFlow resnet50 time: 43.2ms (= 4325.0ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 57.3ms (= 5731.7ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.33 (= 57.3ms / 43.2ms)

OneFlow resnet50 time: 26.1ms (= 2614.4ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 38.0ms (= 3799.5ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.45 (= 38.0ms / 26.1ms)

OneFlow resnet50 time: 20.4ms (= 4089.0ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 36.1ms (= 7210.8ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.76 (= 36.1ms / 20.4ms)

OneFlow resnet50 time: 18.1ms (= 3615.9ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 33.2ms (= 6648.9ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.84 (= 33.2ms / 18.1ms)

OneFlow resnet50 time: 17.7ms (= 3541.5ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 29.6ms (= 5921.5ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.67 (= 29.6ms / 17.7ms)

OneFlow swin dataloader time: 0.200s (= 40.085s / 200, num_workers=1)
PyTorch swin dataloader time: 0.128s (= 25.563s / 200, num_workers=1)
Relative speed: 0.638 (= 0.128s / 0.200s)

OneFlow swin dataloader time: 0.053s (= 10.673s / 200, num_workers=4)
PyTorch swin dataloader time: 0.033s (= 6.596s / 200, num_workers=4)
Relative speed: 0.618 (= 0.033s / 0.053s)

OneFlow swin dataloader time: 0.032s (= 6.398s / 200, num_workers=8)
PyTorch swin dataloader time: 0.016s (= 3.300s / 200, num_workers=8)
Relative speed: 0.516 (= 0.016s / 0.032s)

❌ OneFlow resnet50 time: 47.5ms (= 4753.1ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 64.9ms (= 6489.4ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.37 (= 64.9ms / 47.5ms)

OneFlow resnet50 time: 31.6ms (= 3163.2ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 45.7ms (= 4568.7ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.44 (= 45.7ms / 31.6ms)

OneFlow resnet50 time: 23.9ms (= 4771.3ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 42.6ms (= 8516.7ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.78 (= 42.6ms / 23.9ms)

OneFlow resnet50 time: 22.0ms (= 4404.8ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 36.4ms (= 7273.6ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.65 (= 36.4ms / 22.0ms)

OneFlow resnet50 time: 20.9ms (= 4176.5ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 34.5ms (= 6895.4ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.65 (= 34.5ms / 20.9ms)

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

Speed stats:

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

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

github-actions bot commented Oct 4, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

Speed stats:
GPU Name: NVIDIA GeForce RTX 3080 Ti 

❌ OneFlow resnet50 time: 43.5ms (= 4349.4ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 57.8ms (= 5777.1ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.33 (= 57.8ms / 43.5ms)

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

OneFlow resnet50 time: 19.4ms (= 3872.5ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 37.3ms (= 7458.7ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.93 (= 37.3ms / 19.4ms)

OneFlow resnet50 time: 18.4ms (= 3678.1ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 31.5ms (= 6305.2ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.71 (= 31.5ms / 18.4ms)

OneFlow resnet50 time: 18.2ms (= 3638.1ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 30.1ms (= 6024.4ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.66 (= 30.1ms / 18.2ms)

OneFlow swin dataloader time: 0.202s (= 40.338s / 200, num_workers=1)
PyTorch swin dataloader time: 0.128s (= 25.624s / 200, num_workers=1)
Relative speed: 0.635 (= 0.128s / 0.202s)

OneFlow swin dataloader time: 0.055s (= 10.956s / 200, num_workers=4)
PyTorch swin dataloader time: 0.032s (= 6.487s / 200, num_workers=4)
Relative speed: 0.592 (= 0.032s / 0.055s)

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

❌ OneFlow resnet50 time: 47.8ms (= 4784.7ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 65.2ms (= 6524.7ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.36 (= 65.2ms / 47.8ms)

OneFlow resnet50 time: 31.5ms (= 3146.0ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 43.5ms (= 4353.3ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.38 (= 43.5ms / 31.5ms)

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

OneFlow resnet50 time: 21.6ms (= 4312.9ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 36.6ms (= 7318.2ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.70 (= 36.6ms / 21.6ms)

OneFlow resnet50 time: 20.2ms (= 4031.4ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 34.9ms (= 6972.5ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.73 (= 34.9ms / 20.2ms)

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

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

github-actions bot commented Oct 5, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

Speed stats:
GPU Name: NVIDIA GeForce RTX 3080 Ti 

❌ OneFlow resnet50 time: 43.7ms (= 4371.4ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 61.6ms (= 6161.1ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.41 (= 61.6ms / 43.7ms)

OneFlow resnet50 time: 26.1ms (= 2610.2ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 37.6ms (= 3764.3ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.44 (= 37.6ms / 26.1ms)

OneFlow resnet50 time: 19.3ms (= 3856.1ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 34.8ms (= 6957.1ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.80 (= 34.8ms / 19.3ms)

OneFlow resnet50 time: 19.1ms (= 3827.4ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 32.2ms (= 6441.2ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.68 (= 32.2ms / 19.1ms)

OneFlow resnet50 time: 18.6ms (= 3715.5ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 28.2ms (= 5640.4ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.52 (= 28.2ms / 18.6ms)

OneFlow swin dataloader time: 0.201s (= 40.292s / 200, num_workers=1)
PyTorch swin dataloader time: 0.130s (= 25.944s / 200, num_workers=1)
Relative speed: 0.644 (= 0.130s / 0.201s)

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

OneFlow swin dataloader time: 0.030s (= 6.066s / 200, num_workers=8)
PyTorch swin dataloader time: 0.017s (= 3.311s / 200, num_workers=8)
Relative speed: 0.546 (= 0.017s / 0.030s)

❌ OneFlow resnet50 time: 47.6ms (= 4755.7ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 63.6ms (= 6362.2ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.34 (= 63.6ms / 47.6ms)

OneFlow resnet50 time: 31.1ms (= 3109.5ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 45.0ms (= 4502.0ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.45 (= 45.0ms / 31.1ms)

OneFlow resnet50 time: 24.0ms (= 4799.7ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 40.7ms (= 8135.3ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.69 (= 40.7ms / 24.0ms)

OneFlow resnet50 time: 22.5ms (= 4498.4ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 36.7ms (= 7337.2ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.63 (= 36.7ms / 22.5ms)

OneFlow resnet50 time: 21.0ms (= 4208.8ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 35.4ms (= 7081.2ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.68 (= 35.4ms / 21.0ms)

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2023

Speed stats:
GPU Name: NVIDIA GeForce RTX 3080 Ti 

❌ OneFlow resnet50 time: 43.8ms (= 4376.3ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 61.6ms (= 6161.1ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.41 (= 61.6ms / 43.8ms)

OneFlow resnet50 time: 26.1ms (= 2605.9ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 38.5ms (= 3851.8ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.48 (= 38.5ms / 26.1ms)

OneFlow resnet50 time: 18.4ms (= 3689.9ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 36.2ms (= 7238.3ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.96 (= 36.2ms / 18.4ms)

OneFlow resnet50 time: 18.7ms (= 3733.8ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 31.5ms (= 6296.1ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.69 (= 31.5ms / 18.7ms)

OneFlow resnet50 time: 17.4ms (= 3487.0ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 29.6ms (= 5922.9ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.70 (= 29.6ms / 17.4ms)

OneFlow swin dataloader time: 0.203s (= 40.516s / 200, num_workers=1)
PyTorch swin dataloader time: 0.129s (= 25.817s / 200, num_workers=1)
Relative speed: 0.637 (= 0.129s / 0.203s)

OneFlow swin dataloader time: 0.054s (= 10.703s / 200, num_workers=4)
PyTorch swin dataloader time: 0.034s (= 6.708s / 200, num_workers=4)
Relative speed: 0.627 (= 0.034s / 0.054s)

OneFlow swin dataloader time: 0.031s (= 6.152s / 200, num_workers=8)
PyTorch swin dataloader time: 0.017s (= 3.432s / 200, num_workers=8)
Relative speed: 0.558 (= 0.017s / 0.031s)

❌ OneFlow resnet50 time: 47.7ms (= 4766.0ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 64.3ms (= 6431.8ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.35 (= 64.3ms / 47.7ms)

OneFlow resnet50 time: 31.1ms (= 3113.4ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 44.1ms (= 4413.3ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.42 (= 44.1ms / 31.1ms)

OneFlow resnet50 time: 23.9ms (= 4783.7ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 41.4ms (= 8287.9ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.73 (= 41.4ms / 23.9ms)

OneFlow resnet50 time: 22.1ms (= 4417.1ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 37.5ms (= 7505.8ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.70 (= 37.5ms / 22.1ms)

OneFlow resnet50 time: 20.8ms (= 4159.3ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 33.9ms (= 6774.6ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.63 (= 33.9ms / 20.8ms)

@strint strint merged commit dea3f43 into master Oct 6, 2023
@strint strint deleted the feat_graph_to_new_device branch October 6, 2023 07:28
strint added a commit to siliconflow/onediff that referenced this pull request Oct 9, 2023
Support changing runtime_state_dict's device with
`runtime_state_dict_to`
```python
    def warmup_with_load(self, file_path, device=None):
        state_dict = flow.load(file_path)
        if device is not None:
            state_dict = flow.nn.Graph.runtime_state_dict_to(state_dict, device)
        self.load_runtime_state_dict(state_dict)
```


Depends on PR in oneflow:
Oneflow-Inc/oneflow#10335

# Performance check
## save
- speed: 5.99~6.08 it/s
- mem:
  - before compile:  7.4G
  - after compile: 8.6 G
  - run: 15G

## load
- speed: 5.94~6.11 it/s
- mem:
  - before compile: 8.5G
  - after compile: 8.5G
  - run: 15G

## load from cuda 0 to cuda 1
- speed: 6.17~6.22 it/s
- mem:
  - before compile: 7.3G
  - after compile: 8.5G
  - run: 15G

## load from cuda 0 to cuda 0 and cuda 1
- speed: 6.05~6.12 it/s
- mem:
  - before compile: 7.3G
  - after compile: 8.5G
  - run: 15G

---------

Co-authored-by: Shenghang Tsai <[email protected]>
jackalcooper added a commit that referenced this pull request Oct 18, 2023
jackalcooper added a commit that referenced this pull request Dec 20, 2023
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