mlx-vlm icon indicating copy to clipboard operation
mlx-vlm copied to clipboard

Excessive Memory Allocation (56.98GB) on M2 Mac Mini (32GB) Using Qwen2-VL-2B-Instruct-4bit

Open WildKratts opened this issue 1 year ago • 1 comments

Issue Summary: When running a single message + image test pair with the specified setup, the process attempts to allocate 56.98GB of memory, far exceeding the available memory on the machine. This leads to a crash with the following error:

libc++abi: terminating due to uncaught exception of type std::runtime_error: Attempting to allocate 56976077312 bytes which is greater than the maximum allowed buffer size of 17179869184 bytes. zsh: abort python3 -m mlx_vlm.lora --model-path --epochs 2

Environment: • Machine: M2 Mac Mini (32GB RAM) • Model: Qwen2-VL-2B-Instruct-4bit • Framework/Version: Python 3.12

WildKratts avatar Nov 24 '24 00:11 WildKratts

Hey @WildKratts

Could you share a reproducible example?

I know the current trainer has a few bugs to iron out.

Blaizzy avatar Dec 30 '24 00:12 Blaizzy

Closing stale

Blaizzy avatar Nov 10 '25 12:11 Blaizzy