Skip to content

Instantly share code, notes, and snippets.

@corajr
Created September 3, 2022 04:36
Show Gist options
  • Save corajr/d18c3dfbbf54541fe029784d25a1c465 to your computer and use it in GitHub Desktop.
Save corajr/d18c3dfbbf54541fe029784d25a1c465 to your computer and use it in GitHub Desktop.
Comparison between pytorch-nightly and pytorch 1.12.1 on 2022 Macbook M2 Air, 24 GB, 10-core GPU
$ conda list  | grep pytorch                                                                                                                                    ✔  00:35:30
pytorch                   1.12.1                 py3.10_0    pytorch
pytorch-lightning         1.6.5              pyhd8ed1ab_0    conda-forge
torchvision               0.13.1                py310_cpu    pytorch

$ python scripts/dream.py --full_precision
>> cuda not available, using device mps
>> Loading model from models/ldm/stable-diffusion-v1/model.ckpt
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla' with 512 in_channels
Using slower but more accurate full-precision math (--full_precision)
>> Setting Sampler to k_lms
>> model loaded in 7.68s

* Initialization done! Awaiting your command (-h for help, 'q' to quit)
dream> "clouds"
Generating:   0%|                                                                                                                                                                         | 0/1 [00:00<?, ?it/s]/Users/corajr/Documents/lstein-fork/ldm/modules/embedding_manager.py:152: UserWarning: The operator 'aten::nonzero' is not currently supported on the MPS backend and will fall back to run on the CPU. This may have performance implications. (Triggered internally at  /Users/runner/work/_temp/anaconda/conda-bld/pytorch_1659484612588/work/aten/src/ATen/mps/MPSFallback.mm:11.)
  placeholder_idx = torch.where(
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 50/50 [01:27<00:00,  1.76s/it]
Generating: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [01:29<00:00, 89.75s/it]
>> Usage stats:
>>   1 image(s) generated in 89.91s
>>   Max VRAM used for this generation: 0.00G
Outputs:
outputs/img-samples/000001.2740908200.png: "clouds" -s50 -W512 -H512 -C7.5 -Ak_lms -F -S2740908200
$ conda list | grep pytorch                                                                                                                              ✔  21:30:25
pytorch                   1.13.0.dev20220902        py3.10_0    pytorch-nightly
pytorch-lightning         1.6.5              pyhd8ed1ab_0    conda-forge
torchvision               0.14.0.dev20220902       py310_cpu    pytorch-nightly

$ python scripts/dream.py --full_precision
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla' with 512 in_channels
Using slower but more accurate full-precision math (--full_precision)
>> Setting Sampler to k_lms
>> model loaded in 9.89s

* Initialization done! Awaiting your command (-h for help, 'q' to quit)
dream> "clouds"
Generating:   0%|                                                                                                                                                                         | 0/1 [00:00<?, ?it/s]
/Users/corajr/Documents/lstein-nightly/ldm/modules/embedding_manager.py:152: UserWarning: The operator 'aten::nonzero' is not currently supported on the MPS backend and will fall back to run on the CPU. This may have performance implications. (Triggered internally at /Users/runner/work/_temp/anaconda/conda-bld/pytorch_1662102684790/work/aten/src/ATen/mps/MPSFallback.mm:11.)
  placeholder_idx = torch.where(
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 50/50 [02:00<00:00,  2.41s/it]
Generating: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [02:02<00:00, 122.33s/it]
>> Usage stats:
>>   1 image(s) generated in 122.43s
>>   Max VRAM used for this generation: 0.00G
Outputs:
outputs/img-samples/000001.4140611674.png: "clouds" -s50 -W512 -H512 -C7.5 -Ak_lms -F -S4140611674
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment