Closed vashat closed 10 months ago
@vashat, I too am getting this error. Any progress? I'm diving into it now, will post any resolution.
Hi! Unfortunately still getting the same error after pulling latest code and removing quantize parameters @haotian-liu :
env PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 python3 -m llava.serve.cli --model-path /Volumes/M1\ Macmini\ backup/scripts/llava-v1.5-13b --image-file /Users/admin/Downloads/Gustav\ Vasa-1.jpg --device=mps
Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [07:19<00:00, 146.38s/it]
USER: What is in the image?
/Users/admin/scripts/miniconda3/envs/llava/lib/python3.10/site-packages/transformers/generation/utils.py:725: UserWarning: MPS: no support for int64 repeats mask, casting it to int32 (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Repeat.mm:236.)
input_ids = input_ids.repeat_interleave(expand_size, dim=0)
loc("varianceEps"("(mpsFileLoc): /AppleInternal/Library/BuildRoots/c2cb9645-dafc-11ed-aa26-6ec1e3b3f7b3/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphUtilities.mm":228:0)): error: input types 'tensor<1x577x1xf16>' and 'tensor<1xf32>' are not broadcast compatible
LLVM ERROR: Failed to infer result type(s).
zsh: abort env PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 python3 -m llava.serve.cli
(llava) admin@Minisomistrator LLaVA % /Users/admin/scripts/miniconda3/envs/llava/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 '
Have you reinstalled PyTorch pip install torch==2.1.0 torchvision==0.16.0
Yes it works when I reinstall to these versions. Thank you for the assistance!
Thanks a lot, Working after having pip install torch==2.1.0 torchvision==0.16.0
Describe the issue
Issue: It seams Llava is not working on M1 with MPS backend.
Command:
Log:
Also tried it with Gradio UI. When trying to run it with the Gradio UI, it crashes when submitting an image through the UI:
Command:
Log: