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

Failed assertion `[MPSNDArray initWithDevice:descriptor:] Error: total bytes of NDArray > 2**32 #175

Closed
timojaask opened this issue Jan 22, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@timojaask
Copy link

timojaask commented Jan 22, 2023

I wanted to try this out, so I downloaded the woman with a pearl earring image from the README.md and ran the example command:

imagine --model SD-2.0-depth --init-image girl_with_a_pearl_earring.jpg --init-image-strength 0.05  "professional headshot photo of a woman with a pearl earring" -r 4 -w 1024 -h 1024 --steps 50

Which results in the following output:

 % imagine --model SD-2.0-depth --init-image girl_with_a_pearl_earring.jpg --init-image-strength 0.05  "professional headshot photo of a woman with a pearl earring" -r 4 -w 1024 -h 1024 --steps 50

🤖🧠 imaginAIry received 1 prompt(s) and will repeat them 4 times to create 4 images.
Generating 🖼  1/4: "professional headshot photo of a woman with a pearl earring" 1024x1024px negative-prompt:"Ugly, duplication, duplicates, mutilation, deformed, mutilated, mutation, twisted body, disfigured, bad anatomy, out of frame, extra fingers, mutated hands, poorly drawn hands, extra limbs, malformed limbs, missing arms, extra arms, missing legs, extra legs, mutated hands, extra hands, fused fingers, missing fingers, extra fingers, long neck, small head, closed eyes, rolling eyes, weird eyes, smudged face, blurred face, poorly drawn face, mutation, mutilation, cloned face, strange mouth, grainy, blurred, blurry, writing, calligraphy, signature, text, watermark, bad art," seed:104916828 prompt-strength:7.5 steps:50 sampler-type:k_dpmpp_2m
Loading model /Users/timojaaskelainen/.cache/huggingface/hub/models--stabilityai--stable-diffusion-2-depth/snapshots/d41a0687231847e8bd55f43fb1f576afaeefef19/512-depth-ema.ckpt onto mps:0 backend...
  0%|                                                                                                                                                                                     | 0/46 [00:00<?, ?it/s]/AppleInternal/Library/BuildRoots/5b8a32f9-5db2-11ed-8aeb-7ef33c48bc85/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MPSCore/Types/MPSNDArray.mm:724: failed assertion `[MPSNDArray initWithDevice:descriptor:] Error: total bytes of NDArray > 2**32'
zsh: abort      imagine --model SD-2.0-depth --init-image girl_with_a_pearl_earring.jpg  0.05
timojaaskelainen@Timos-M1-MBP ~ % /Users/timojaaskelainen/.pyenv/versions/3.10.9/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

Not sure what this is about, but looks like some array allocation goes over the framework limits?
Some other examples that I've tried are working without errors.

I'm running macOS Ventura 13.1, Python 3.10.9, on MacBook Pro, M1 Max, 64 GB RAM.

@brycedrennan
Copy link
Owner

hmm that is strange. Thanks for all the information. will investigate

@brycedrennan
Copy link
Owner

brycedrennan commented Jan 22, 2023

I'm at 35% complete on my Macbook Pro M1 Max 32 GB, Ventura 13.0.1. Says it's gonna take 20 minutes to complete. I certainly ran this originally on the Desktop with a 2080TI graphics card and got it done in a few seconds.

@brycedrennan
Copy link
Owner

yeah worked for me. took 26 minutes. can you provide the output of pip freeze?

@timojaask
Copy link
Author

Sure:

% pip freeze
aiohttp==3.8.3
aiosignal==1.3.1
antlr4-python3-runtime==4.9.3
async-timeout==4.0.2
attrs==22.2.0
certifi==2022.12.7
charset-normalizer==2.1.1
click==8.1.3
click-shell==2.1
contourpy==1.0.7
cycler==0.11.0
diffusers==0.11.1
einops==0.6.0
facexlib==0.2.5
fairscale==0.4.13
filelock==3.9.0
filterpy==1.4.5
fonttools==4.38.0
frozenlist==1.3.3
fsspec==2023.1.0
ftfy==6.1.1
huggingface-hub==0.11.1
idna==3.4
imageio==2.24.0
imaginAIry==8.0.0
importlib-metadata==6.0.0
kiwisolver==1.4.4
kornia==0.6.9
lightning-utilities==0.5.0
llvmlite==0.39.1
matplotlib==3.6.3
multidict==6.0.4
numba==0.56.4
numpy==1.23.5
omegaconf==2.3.0
open-clip-torch==2.9.3
opencv-python==4.7.0.68
packaging==23.0
Pillow==9.4.0
protobuf==3.20.3
psutil==5.9.4
pyparsing==3.0.9
python-dateutil==2.8.2
pytorch-lightning==1.9.0
PyYAML==6.0
regex==2022.10.31
requests==2.28.2
safetensors==0.2.8
scipy==1.10.0
semantic-version==2.10.0
sentencepiece==0.1.97
setuptools-rust==1.5.2
six==1.16.0
timm==0.6.12
tokenizers==0.13.2
torch==1.13.1
torchdiffeq==0.2.3
torchmetrics==0.11.0
torchvision==0.14.1
tqdm==4.64.1
transformers==4.25.1
typing_extensions==4.4.0
urllib3==1.26.14
wcwidth==0.2.6
yarl==1.8.2
zipp==3.11.0

@brycedrennan
Copy link
Owner

Please confirm this is fixed in just release 8.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants