Repository navigation
Replies: 4 comments
|
Looks like the problem was the missing |
|
Your # studio/backend/core/inference/diffusion_device.py
def _mps_cap_disabled() -> bool:
...
return os.environ.get("UNSLOTH_DIFFUSION_ALLOW_OVERSIZED_LOAD", "").strip().lower() in (
"1", "true", "yes", "on",
)
That is also why it "does not belong to any flag": it is not a UI setting, it is an environment variable the backend reads directly. What to do on macOSThere is no environment-variable field in the Studio UI, so the options are, in order of least invasive: 1. Launch the app from a shell that has the variable export UNSLOTH_DIFFUSION_ALLOW_OVERSIZED_LOAD=1
open -a "Unsloth Studio"
export UNSLOTH_DIFFUSION_ALLOW_OVERSIZED_LOAD=1
python -m studio # or whatever the entry point is in your install2. Set it for the whole GUI session (macOS) launchctl setenv UNSLOTH_DIFFUSION_ALLOW_OVERSIZED_LOAD 1then fully quit and reopen the app. This writes into 3. A wrapper script #!/bin/bash
export UNSLOTH_DIFFUSION_ALLOW_OVERSIZED_LOAD=1
exec "/Applications/Unsloth Studio.app/Contents/MacOS/<binary>"Save it, What the flag actually changesIt is worth knowing before you enable it, because it disables a guard rather than raising a limit: def _mps_cap_disabled() -> bool:
if MPS_HIGH_WATERMARK_ENV in os.environ and os.environ.get(MPS_HIGH_WATERMARK_ENV) != "0.0":
return True
# The oversized-load opt-in asks to run past the unified-memory guard,
# so it keeps the unbounded allocator too.
return os.environ.get("UNSLOTH_DIFFUSION_ALLOW_OVERSIZED_LOAD", ...) in ("1", "true", "yes", "on")On Apple Silicon, If the model still will not loadThen it is not the guard refusing — it will be an actual allocation failure. Check whether the model fits at all: Qwen-Image-Edit in fp16 needs a multiple of its parameter count in bytes, and quantized variants (Q4/Q8) are the realistic path on a Mac. The oversized-load flag lets the attempt happen; it does not make the memory appear. |
|
One correction worth making before you spend more time on Two ways that do work:
Worth checking first whether you actually need it: the flag only bypasses the MPS oversize guard, so if the model fits after quantisation you're trading correctness margin for nothing. |
|
@gradha — you said in the thread that the fix was the missing Since that resolved it, could you mark the comment above as the answer? One caution from the comment: the flag only bypasses the MPS oversize guard, so it's worth confirming you actually need it rather than leaving it set. |
Uh oh!
There was an error while loading. Please reload this page.
When I try to load an image model like qwen edit on osx I get a popup telling me to set
UNSLOTH_DIFFUSION_ALLOW_OVERSIZED_LOAD=1. I've added that to my.bash_profilebut the app still refuses to load the model. I can add settings to the model itself, butUNSLOTH_DIFFUSION_ALLOW_OVERSIZED_LOAD=1is said to not belong to any flag. I can't find any other environment settings option in the desktop UI.What's the mechanism to set the environment variable then?
All reactions