0

YuE2 doesn't work without changing the code

@cocktailpeanutposted Fri, 18 Sep 2026 18:54:29 GMT·0 replies

By the way YuE2 is failing for me by default and i had to make a change to get it to work.

Pinokio by default sets PYTORCH_ENABLE_MPS_FALLBACK: 1 when launching all apps so even when some operations don't support MPS it can fall back to CPU. It's normally harmless. But in this case it looks like the code has hard coded handling of PYTORCH_ENABLE_MPS_FALLBACK and it fails when i run YuE2.

So I had to set PYTORCH_ENABLE_MPS_FALLBACK: "0" in start.js to get YuE2 to work.

Here's what the agent said:

The last run was a Compose job (j-1a0b0538f96-001). YuE2 loaded, then exited in about two seconds. Nothing was written.

The engine refused to start because Pinokio had PYTORCH_ENABLE_MPS_FALLBACK=1 in the process environment. YuE2 is an MLX path, not PyTorch, and vanch007’s pipeline treats that flag as an invalid execution path:

        for name in ("PYTORCH_ENABLE_MPS_FALLBACK", "PYTORCH_MPS_FAST_MATH"):
            if os.environ.get(name) == "1":
                raise RuntimeError(f"Unset {name}; fallback/fast-math is not a validated execution path")

The wording is easy to misread: “Unset …” means “this variable is set; turn it off.” It is not asking you to add the flag.

Where it came from: Pinokio injects PYTORCH_ENABLE_MPS_FALLBACK=1 for every app (it is in the Pinokio kernel env, for PyTorch-on-Metal apps like Comfy). Phosphene then starts YuE2 with {**os.environ, "PYTHONUNBUFFERED": "1"}, so the flag rides along. The same value is on the running panel process right now.

The install itself succeeded. Lyrics, weights, and RAM were fine. Every song will fail the same way until the music subprocess drops those two variables (or Pinokio stops exporting them).

I can patch the spawn so Compose ignores Pinokio’s PyTorch flags and retry. Say if you want that.

The solution is either to override the PYTORCH_MPS_ENABLE_MPS_FALLBACK in the start.js script, or if the code doesn't really need this get rid of this handling in the above code

Replies (0)
Up to 10 files, 25MB each. Images are optimized; GIFs -> MP4; videos 720p (max 120s).
YuE2 doesn't work without changing the code · Pinokio