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

(Exit code 133) Error when loading large LLM models #285

Open
yushijinhun opened this issue Jan 6, 2025 · 15 comments
Open

(Exit code 133) Error when loading large LLM models #285

yushijinhun opened this issue Jan 6, 2025 · 15 comments
Assignees
Labels
bug Something isn't working

Comments

@yushijinhun
Copy link

When loading large LLMs (for example, Meta-Llama-3.1-70B-Instruct-IQ2_S with context window 32768), I would encounter the error (Exit code: 133). Please check settings and try loading the model again.. My machine has 64G RAM and 16G vRAM, and I can load the model with same configuration with llama.cpp. Therefore, the problem should not be caused by insufficient RAM or vRAM.

Further investigation into the coredump shows that, the application crashes in function _ZN15partition_alloc8internal32PartitionExcessiveAllocationSizeEm, which means the application is trying to allocate an excessive amount of memory using PartitionAlloc in a call to posix_memalign. This explains why the problem occurs only on LM Studio but not on llama.cpp, as Electron uses PartitionAlloc by default. This is tracked in issue electron/electron#44291.

Apart from waiting for upstream to fix this issue, a potential workaround is to use a customized Electron build to disable PartitionAlloc.

@yagil
Copy link
Member

yagil commented Jan 6, 2025

@yushijinhun which operating system are you on? Assuming Linux?

@yushijinhun
Copy link
Author

@yushijinhun which operating system are you on? Assuming Linux?

Yes. I'm on Linux.

@yagil
Copy link
Member

yagil commented Jan 6, 2025

@yushijinhun which operating system are you on? Assuming Linux?

Yes. I'm on Linux.

Thanks. @neilmehta24 from our team is investigating this with priority as we speak.

@yagil yagil added the bug Something isn't working label Jan 6, 2025
@yagil yagil changed the title Error when loading large LLM models (Exit code 133) Error when loading large LLM models Jan 6, 2025
@yushijinhun
Copy link
Author

I built Electron v33.0.2 with use_allocator_shim = false and enable_backup_ref_ptr_support = false. After replacing LM Studio's electron with the one I built, the problem is solved.

@krones9000
Copy link

Could you give a little more specific detail about exactly how you resolved this? I'm in a similar situation, on linux, 16gbVRAM 128GB system RAM, could load models in Oobabooga but getting the 133 error in LM studio. Not sure where to start or how I would "build" Electron or what Electron is and how it relates to the Linux app image of LM Studio that I load.

@laushunyu
Copy link

I run LM Studio v0.3.6 on Ubuntu 24.04, with 7840HS CPU, 96GB RAM and 16GB GPU VRAM, encountered the same issue: small models can be loaded normally but large models cannot be loaded.

I would appreciate it if @yushijinhun share your compiled Electron version.

@yushijinhun
Copy link
Author

Not sure where to start or how I would "build" Electron or what Electron is and how it relates to the Linux app image of LM Studio that I load.

Electron is a UI framework built on Chromium used by LM Studio.

I would appreciate it if @yushijinhun share your compiled Electron version.

Here is my Electron v33.0.2 Linux x86_64 build (without allocator shim): Google Drive

You can also follow Electron's Build Instructions to build it yourself.

To replace LM Studio' stock Electron, first unpack the AppImage:

/path/to/LM-Studio-0.3.6-8-x64.AppImage --appimage-extract

Then you would see a squashfs-root directory. Go into it, extract the Electron distribution zip, and overwrite all existent files. Run the electron executable (you may need to add --no-sandbox flag), and you will see LM Studio starting.

@daxime
Copy link

daxime commented Jan 7, 2025

@yushijinhun Thank you for that :)

@CHesketh76
Copy link

CHesketh76 commented Jan 10, 2025

Why is this not set to default? LMstudio exclusively uses GGUF files which implies most users are limited on Vram.

@yagil
Copy link
Member

yagil commented Jan 10, 2025

This is a new bug in 0.3.6 because we updated our Electron version.
Our recommendation: consider staying on 0.3.5 until we fix it properly in a new release (it's in the works)

@CHesketh76
Copy link

Same issue when downgrading.

@aamir-gmail
Copy link

I am using linux version of LM studio 0 3.6 , with Ubuntu 22.04 LTS , I have two 3090 card and 256 GB RAM and AMD 24 Core CPU , for some reason the Qwen2 VL model not load 7B or 70B I get the following message (Exit code: 133). Please check settings and try loading the model again. I was able to load 7B version of the same model on the windows machine (0.3.6) with 64 GB RAM and 12 GB 4070 card , here neither 72B or 4B does not load my NVidia driver is 550, I thought it was a memory issues , them I tried LLAMA 70B , which loaded just fine , the GPU utilisation was around 15 GB each . Are there any logs collected by LM studion which I can share to help with this problem.

@yagil
Copy link
Member

yagil commented Jan 13, 2025

Thanks @aamir-gmail! We are aware of this issue and we are working on a fix. The recommendation is to stay on 0.3.5 until it's out. Get 0.3.5 from https://lmstudio.ai/download#beta-and-experimental-releases

@aamir-gmail
Copy link

aamir-gmail commented Jan 13, 2025 via email

@aamir-gmail
Copy link

aamir-gmail commented Jan 13, 2025 via email

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

8 participants