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

[For dev]Sdxl dev #10323

Closed
wants to merge 16 commits into from
Closed

[For dev]Sdxl dev #10323

wants to merge 16 commits into from

Conversation

strint
Copy link
Contributor

@strint strint commented Aug 25, 2023

@hjchen2 hjchen2 enabled auto-merge (squash) August 25, 2023 12:06
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce RTX 3080 Ti 

❌ OneFlow resnet50 time: 43.5ms (= 4350.9ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 61.4ms (= 6136.9ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.41 (= 61.4ms / 43.5ms)

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

OneFlow resnet50 time: 19.1ms (= 3827.3ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 34.8ms (= 6967.0ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.82 (= 34.8ms / 19.1ms)

OneFlow resnet50 time: 19.2ms (= 3846.6ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 32.5ms (= 6495.0ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.69 (= 32.5ms / 19.2ms)

OneFlow resnet50 time: 17.6ms (= 3510.1ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 29.8ms (= 5952.7ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.70 (= 29.8ms / 17.6ms)

OneFlow swin dataloader time: 0.201s (= 40.143s / 200, num_workers=1)
PyTorch swin dataloader time: 0.127s (= 25.405s / 200, num_workers=1)
Relative speed: 0.633 (= 0.127s / 0.201s)

OneFlow swin dataloader time: 0.055s (= 10.984s / 200, num_workers=4)
PyTorch swin dataloader time: 0.033s (= 6.630s / 200, num_workers=4)
Relative speed: 0.604 (= 0.033s / 0.055s)

OneFlow swin dataloader time: 0.031s (= 6.206s / 200, num_workers=8)
PyTorch swin dataloader time: 0.017s (= 3.474s / 200, num_workers=8)
Relative speed: 0.560 (= 0.017s / 0.031s)

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

OneFlow resnet50 time: 31.1ms (= 3108.7ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 43.5ms (= 4347.0ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.40 (= 43.5ms / 31.1ms)

OneFlow resnet50 time: 24.2ms (= 4839.6ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 41.0ms (= 8199.7ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.69 (= 41.0ms / 24.2ms)

OneFlow resnet50 time: 22.6ms (= 4525.8ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 38.1ms (= 7621.2ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.68 (= 38.1ms / 22.6ms)

OneFlow resnet50 time: 20.8ms (= 4150.7ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 34.3ms (= 6850.1ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.65 (= 34.3ms / 20.8ms)

hjchen2 pushed a commit to siliconflow/onediff that referenced this pull request Aug 29, 2023
Depends on 
Oneflow-Inc/oneflow#10323

### unet graph(sd2)
run
```
python examples/unet_torch_interplay.py --model_id=stabilityai/stable-diffusion-xl-base-1.0 --revision=main
```
run and save
```
python examples/unet_torch_interplay.py --model_id=stabilityai/stable-diffusion-xl-base-1.0 --revision=main --save
```
load and run
```
python examples/unet_torch_interplay.py --model_id=stabilityai/stable-diffusion-xl-base-1.0 --revision=main --load
```

### sd2 with unet graph
run torch eager
```
python examples/text_to_image_sdxl_fp16_with_oneflow_compile.py
```

run oneflow graph
```
python examples/text_to_image_sdxl_fp16_with_oneflow_compile.py --compile
```

run oneflow graph save
```
python examples/text_to_image_sdxl_fp16_with_oneflow_compile.py --compile --save
```

run oneflow graph load
```
python examples/text_to_image_sdxl_fp16_with_oneflow_compile.py --compile --load
```
auto-merge was automatically disabled August 29, 2023 12:38

Pull request was closed

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