InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[bug]: Error: MLIR pass manager failed

Open joselael opened this issue 1 year ago • 9 comments

Is there an existing issue for this problem?

  • [x] I have searched the existing issues

Operating system

macOS

GPU vendor

Apple Silicon (MPS)

GPU model

M2 Ultra

GPU VRAM

128GB

Version number

v5.6.2

Browser

Invoke Community Edition

Python dependencies

No response

What happened

Invoke crashes while generating image:

Starting up...
Started Invoke process with PID: 17420
>> patchmatch.patch_match: INFO - Compiling and loading c extensions from "/Users/jose_louis/Applications/.venv/lib/python3.11/site-packages/patchmatch".
>> patchmatch.patch_match: ERROR - patchmatch failed to load or compile (Command 'make clean && make' returned non-zero exit status 2.).
>> patchmatch.patch_match: INFO - Refer to https://invoke-ai.github.io/InvokeAI/installation/060_INSTALL_PATCHMATCH/ for installation instructions.
[2025-02-21 12:48:55,100]::[InvokeAI]::INFO --> Patchmatch not loaded (nonfatal)
[2025-02-21 12:48:55,582]::[InvokeAI]::INFO --> Using torch device: MPS
[2025-02-21 12:48:55,704]::[InvokeAI]::INFO --> InvokeAI version 5.6.2
[2025-02-21 12:48:55,704]::[InvokeAI]::INFO --> Root directory = /Users/jose_louis/Applications
[2025-02-21 12:48:55,704]::[InvokeAI]::INFO --> Initializing database at /Users/jose_louis/Applications/databases/invokeai.db
[2025-02-21 12:48:55,705]::[InvokeAI]::INFO --> Database update needed
[2025-02-21 12:48:55,705]::[InvokeAI]::INFO --> Backing up database to /Users/jose_louis/Applications/databases/invokeai_backup_20250221-124855.db
[2025-02-21 12:48:55,707]::[InvokeAI]::INFO --> Database updated successfully
[2025-02-21 12:48:55,709]::[ModelManagerService]::INFO --> [MODEL CACHE] Calculated model RAM cache size: 32768.00 MB. Heuristics applied: [1, 2].
[2025-02-21 12:48:55,711]::[InvokeAI]::INFO --> Pruned 1 finished queue items
[2025-02-21 12:48:55,735]::[InvokeAI]::INFO --> Cleaned database (freed 0.01MB)
[2025-02-21 12:48:55,735]::[InvokeAI]::INFO --> Invoke running on http://127.0.0.1:9090/ (Press CTRL+C to quit)
[2025-02-21 12:48:58,511]::[InvokeAI]::INFO --> Executing queue item 12, session 9df489c5-3100-40b8-b123-5df524de9c95

Loading checkpoint shards:   0%|          | 0/2 [00:00<?, ?it/s]
Loading checkpoint shards:  50%|█████     | 1/2 [00:00<00:00,  2.50it/s]
Loading checkpoint shards: 100%|██████████| 2/2 [00:00<00:00,  2.67it/s]
Loading checkpoint shards: 100%|██████████| 2/2 [00:00<00:00,  2.64it/s]
[2025-02-21 12:49:01,726]::[ModelManagerService]::INFO --> [MODEL CACHE] Loaded model '7e59db0b-6548-4426-8a0c-9da82e2f47a1:text_encoder_2' (T5EncoderModel) onto mps device in 2.28s. Total model size: 9083.39MB, VRAM: 9083.39MB (100.0%)
[2025-02-21 12:49:01,813]::[ModelManagerService]::INFO --> [MODEL CACHE] Loaded model '7e59db0b-6548-4426-8a0c-9da82e2f47a1:tokenizer_2' (T5Tokenizer) onto mps device in 0.00s. Total model size: 0.03MB, VRAM: 0.00MB (0.0%)
[2025-02-21 12:49:02,893]::[ModelManagerService]::INFO --> [MODEL CACHE] Loaded model '24b521c5-06a2-4b38-8207-df478ca17a6b:text_encoder' (CLIPTextModel) onto mps device in 0.08s. Total model size: 469.44MB, VRAM: 469.44MB (100.0%)
[2025-02-21 12:49:02,941]::[ModelManagerService]::INFO --> [MODEL CACHE] Loaded model '24b521c5-06a2-4b38-8207-df478ca17a6b:tokenizer' (CLIPTokenizer) onto mps device in 0.00s. Total model size: 0.00MB, VRAM: 0.00MB (0.0%)
/AppleInternal/Library/BuildRoots/27093e68-e5c4-11ef-8448-fe9e33ca05fa/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphExecutable.mm:3532: failed assertion `Error: MLIR pass manager failed'
/Users/jose_louis/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/multiprocessing/resource_tracker.py:254: 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 '
Process exited with code: 0

What you expected to happen

The image be generated

How to reproduce the problem

No response

Additional context

Using unquantized Flux dev version from Invoke

Discord username

No response

joselael avatar Feb 21 '25 20:02 joselael

Is the new beta causing it, 15.4?

mystikal1000 avatar Feb 24 '25 02:02 mystikal1000

I have samilar issue, but not for this project. It happened from several days ago. Maybe something about MacOS cause this.

lcytzk avatar Feb 24 '25 08:02 lcytzk

Same on beta 15.4... across invoke + comfyui

discordinated avatar Feb 24 '25 14:02 discordinated

Same on beta 15.4... across invoke + comfyui

comfyui as well!

lcytzk avatar Feb 25 '25 01:02 lcytzk

Unfortunately I we cannot do anything if the issue only occurs on specific macOS versions. We'll need to wait for pytorch to fix it (or macOS to get a fix).

psychedelicious avatar Feb 25 '25 06:02 psychedelicious

Same for me - i updated to latest 15.4 and got the bug afterwards ;(..

Update:

  • rechecked with 15.4 Beta (24E5222f) -> still broken
  • rechecked with 15.4 Beta (24E5228e) -> still broken

steffenr avatar Feb 26 '25 10:02 steffenr

With the latest 15.4 Beta (24E5238a) the error seems to be fixed. I just run a few of my comfyUI workflows and got no errors.

steffenr avatar Mar 18 '25 07:03 steffenr

Confirmed ^^^ MacOS 15.4 Beta 4 Build 24E5238a fixes this error.

miabchdave avatar Mar 19 '25 00:03 miabchdave

confirmed 15.4 Beta (24E5238a) works perfectly.

lcytzk avatar Mar 19 '25 04:03 lcytzk

I have macos 15.5 and get the same bug. How can I install 15.4 Beta (24E5238a)?

mschneider1711 avatar Jun 04 '25 09:06 mschneider1711