Skip to content

Studio: size more audio.cpp music models from measured peaks and show the load estimate in the picker - #16726

Merged
danielhanchen merged 32 commits into
unslothai:mainfrom
oobabooga:music-vram-estimates
Nov 5, 2026
Merged

danielhanchen merged 32 commits into
unslothai:mainfrom
oobabooga:music-vram-estimates

Conversation

@oobabooga

@oobabooga oobabooga commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #16628. Fixes #16627.

On a 10 GB card, the Create music page refused music models that fit. The model list also showed file sizes that never matched the number in the refusal. After #16628 this was still true for YuE2, Stable Audio 3 Medium and MiDashengLM-Gen, which used the generic audio.cpp estimate, weights_GiB * 2.5 + 1.5.

This PR gives the measured music families profiles from their worst observed peaks. The picker now shows the same number the load check compares, and the refusal states how much memory is free when nothing is loaded.

Measurements

Peak GPU memory of the audiocpp_server process on audio.cpp v0.9.3, sampled per process through NVML, or amdgpu fdinfo on the Radeon. Each row is the highest of the RTX 3090 and RTX 6000 Ada on CUDA, the RTX 3090 on Vulkan, and, where it ran, a Radeon 8060S on Vulkan. Values in GiB.

The worst case observed for each family:

  • ACE-Step: a cover of a 240 s clip.
  • YuE2: 19,851 characters of lyrics, forced to its 360 s cap.
  • Stable Audio: 4 batched takes at its cap (Small 120 s, Medium 240 s). Edits peak lower.
  • MiDashengLM-Gen: its 80 s cap. 10 s peaks the same.
  • HeartMuLa: a 240 s song with 20,000 characters of lyrics.
Model Package Worst observed peak Generic estimate New estimate
ACE-Step 1.5 Q8_0 5.76 11.22 15.90 12.17
ACE-Step 1.5 BF16 9.40 15.31 (Vulkan) 24.99 16.36
YuE2 Q4_0 2.73 6.78 8.33 7.73
YuE2 Q8_0 4.22 8.58 (Vulkan) 12.05 9.51
YuE2 BF16 7.01 11.87 (Vulkan) 19.03 12.86
Stable Audio 3 Small Q8_0 1.57 2.24 5.42 3.47
Stable Audio 3 Small F16 2.20 2.80 6.99 4.60
Stable Audio 3 Medium Q8_0 3.34 5.34 (Vulkan) 9.84 6.66
Stable Audio 3 Medium F16 5.43 9.48 (Vulkan) 15.08 10.43
MiDashengLM-Gen Q8_0 3.15 4.42 (Vulkan) 9.37 5.40
HeartMuLa Q8_0 7.13 19.58 (Vulkan) 19.33 20.53

Every new estimate leaves at least 0.9 GiB over its worst observed peak, the same margin as the existing profiles. HeartMuLa's generic estimate was too low on Vulkan. Stable Audio Small SFX peaks the same as Small Music.

Changes

  • Profiles in _MEASURED_PROFILES: stable_audio, midashenglm_gen, heartmula and yue2 are new. ace_step becomes weights * 1.15 + 5.55, so BF16 keeps the margin on Vulkan and Q8_0 stays at about 12.2 GiB.
    • YuE2 keeps the generic formula when any NVIDIA card is older than sm_80, or when an NVIDIA host's compute capabilities can't be read, because Studio: state the audio memory estimate in placement refusals #16628's author measured it 2.5 to 4 GiB higher on a T4 than on an L4.
    • Larger packages than the ones measured get the larger of their profile and the generic formula.
  • The picker uses the load check's number.
    • The variant listing and the audio catalog carry estimated_resident_gb, computed with estimate_resident_gb on each request, off the event loop. They carry it only for loads the placement check sizes: TTS, music and separation on a CUDA or XPU host, with a GPU runtime and quant. Dictation, CPU-only runtimes, CPU-only quants (TQ2_1) and other hosts get none and keep the llama.cpp rule.
    • The quant chooser, single-quant rows and "More models" rows show it as "NGB to run" left of the file size, set like the size, which stays the rightmost column as in the chat and Images pickers. The label and its tooltip are translated in every locale.
    • The fit badge, the "fits on device" filter and the recommended quant judge audio.cpp rows on it. They used the llama.cpp rules, and the filter counted system RAM toward a load that stays on one card.
      • They compare it with the largest card torch sees, since automatic placement takes the GPU with the most free memory. llama.cpp's inventory can add Vulkan-only cards the loader does not use.
      • With "Load model into" set to CPU RAM, they keep the llama.cpp rule, and the rows show no "to run" figure.
      • The Hub's quant menu judges audio.cpp quants the same way.
    • A catalog row also carries its smallest GPU variant's estimate, so the filter and the row badge keep a model when any quant fits. On an 8 GB card YuE2 stays listed (Q8_0 needs 9.51 GiB, Q4_0 7.73 GiB) and opens on Q4_0. ACE-Step stays listed on cards that fit Q8_0 but not the BF16 default.
  • Rows that disagreed with the load.
    • A package's catalog row now counts every file the package loads (YuE2's VAE and sidecars).
    • YuE2's On Device row now lists its three packages. It used to list the raw GGUF files, VAE included.
  • Refusals.
    • With nothing loaded, the refusal now reads the cards' current free memory. It states "and the most free on one GPU is N GB", and the smaller-variant suggestions only list variants that fit. Before, both relied on post-handoff accounting, which is empty in that case.
    • The two figures use two decimals when one decimal would print the same number twice ("needs about 9.51 GB ... 9.50 GB free").

Verification

Live on an RTX 3090 (Ampere, like the 10 GB RTX 3080 in #16627). A blocker process held memory so that Studio saw 9.5 GiB free. Each model was loaded through /api/inference/load and ran its worst workflow through /api/inference/audio/run. The picker number came from /api/models/gguf-variants on the same Studio.

Model main's estimate Picker shows Result at 9.5 GiB free
ACE-Step Q8_0 (turbo, base) 15.90 12.2GB to run Refused, "needs about 12.2 GB ... the most free on one GPU is 9.5 GB"
ACE-Step BF16 24.99 16.4GB to run Refused, "needs about 16.4 GB"
YuE2 Q4_0 8.33 7.7GB to run 360 s song, 6.60 GiB peak
YuE2 Q8_0 12.05 9.5GB to run Refused, "needs about 9.51 GB ... 9.50 GB"; at 9.6 GiB free, 360 s song, 8.09 GiB peak
YuE2 BF16 19.03 12.9GB to run Refused, "needs about 12.9 GB ... the most free on one GPU is 9.5 GB", suggests only Q4_0 (~7.7 GB)
Stable Audio Small Music / SFX Q8_0 5.42 3.5GB to run 4 takes at 120 s, 2.24 GiB peak
Stable Audio Small Music / SFX F16 6.99 4.6GB to run 4 takes at 120 s, 2.80 GiB peak
Stable Audio Medium Q8_0 9.84 6.7GB to run 4 takes at 240 s, 5.27 GiB peak
Stable Audio Medium F16 15.08 10.4GB to run Refused, "needs about 10.4 GB"
HeartMuLa Q8_0 19.33 20.5GB to run Refused, "needs about 20.5 GB"
MiDashengLM-Gen Q8_0 9.37 5.4GB to run 3.93 GiB peak

The picker number matches the refusal on every row.

Before (#16628) and after (this PR) on the Create music page, each from its own fresh install with a Hugging Face cache holding only YuE2. In the picker shots the browser was told the card has 10 GB; the refusal ran on the RTX 3090 with 9.4 GB free.

YuE2 quant chooser on a 10 GB card, before and after

ACE-Step quant chooser on a 10 GB card, before and after

YuE2 in the On Device list, before and after

YuE2 BF16 refused with 9.4 GB free, before and after

Tests:

  • Backend: new tests cover each profile against its measured peak, the YuE2 card rule (including an unreadable capability query), the estimate on variant and catalog rows, the package catalog size and smallest variant, YuE2's On Device listing, the refusal with nothing loaded, the two-decimal message, the catalog estimate read off the event loop, and no estimate for dictation, CPU-only runtimes and quants, or hosts the check does not size. The audio, music, TTS, variant-listing and GPU suites pass, except test_delete_impact_of_a_folder_row_counts_only_its_files, which reads the local Hugging Face cache and fails the same way on main, and two CUDA numerics tests in the diffusion and video suites that don't use the changed code.
  • Frontend: new tests cover the fit from the estimate, the "fits on device" filter and row badge on 6, 8 and 10 GiB cards, the recommended quant, the "to run" token, the largest card on a mixed host, and the CPU RAM fallback. Typecheck passes. The full suite has 7 failures, the same ones main has (context-window-visible, estimate-chat-tokens, memory-estimate-narrow-panel, memory-fit).

Not covered:

  • A real T4, Hopper, Blackwell, a discrete AMD card and Intel GPUs.
  • ControlFoley, the MiniMax Music 3 GGUF, HeartMuLa F16 and MiDashengLM-Gen F32, which keep the generic audio.cpp formula. The native MiniMax Music 3 pipeline keeps its fixed 23 GiB estimate.
  • Pinned-quant rows, which still show only the file size.
  • ROCm hosts where the installed torch has no kernels for one card, and MIG slices. The picker counts the whole card there, and the load check refuses with the variants that fit.

On the Radeon 8060S (an integrated GPU), YuE2 Q4_0 and BF16 hung the GPU ("context is lost ... hard recovery"). That's a separate audio.cpp issue.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T05:16:43.214295Z 29786ca Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@oobabooga

Copy link
Copy Markdown
Member Author

@codex review

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 5, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 5, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 5, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 5, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 5, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 5, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3994403e8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

gpu: { available: boolean; maxDeviceMemoryGb: number },
cpuLoad = false,
): number {
return gpu.available && !cpuLoad ? gpu.maxDeviceMemoryGb : 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude ROCm GPUs rejected by the placement check

On a heterogeneous ROCm host where the larger card lacks kernels in the installed PyTorch wheel, useGpuInfo() still enumerates that card and includes it in maxDeviceMemoryGb. The additional evidence beyond the fixed CUDA/Vulkan-inventory case is auto_select_gpu_ids()'s rocm_gpu_ids_without_torch_kernels() exclusion: it removes those cards before ranking and every fallback, while _probe_backend_visible_gpu_info() does not. With an eligible 8 GiB card and an excluded 16 GiB card, this helper makes YuE2 BF16 (12.86 GiB) read fits and become recommended, but _preflight_native_audio_placement() refuses it; only Q4_0 fits the eligible card. Derive the capacity from the same architecture-filtered device set as the loader.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing this. It needs a mixed-architecture ROCm host whose larger card has no kernels in the installed torch wheel, and main's file-size rule reads YuE2 BF16 as fitting there too, so it is not a regression. The load check stays the authority and refuses with the variants that fit. Mirroring each eligibility filter of auto_select_gpu_ids (kernel coverage, MIG slices, parent visibility) in the picker is out of scope here; the picker sizes on the torch inventory the loader starts from.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: c3994403e8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 29786ca38e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit dcdff7c into unslothai:main Nov 5, 2026
danielhanchen pushed a commit to Etherll/unsloth that referenced this pull request Nov 7, 2026
… peaks on each runtime backend (unslothai#16984)

Most audio.cpp models in the catalog had no measured profile, so Studio
sized them with the generic `weights × 2.5 + 1.5` formula. On NVIDIA
that refuses models that fit (unslothai#16627). On AMD, which runs audio.cpp's
Vulkan build, several popular models peak above it, so Studio lets them
load and they run out of memory partway through generation.

This came from [a Reddit
report](https://www.reddit.com/r/unsloth/comments/1xkfj98/comment/19s7d0d551gcj/?context=1).
After v0.1.915-beta (unslothai#16514) fixed Voxtral and Higgs Audio v3 for that
user, BreezeTTS 2 Q4_0 (3.8 GB) was still refused on their 8 GB card.
Its estimate was 10.3 GB; on CUDA it is now 7.1 GB.

## Changes

- **Profiles from measured peaks** for BreezeTTS 2, Qwen3-TTS, MiniMax
Music 3 GGUF, OmniVoice, CosyVoice3 and MOSS-TTS v1.5. Chatterbox, Higgs
Audio v3, Kokoro, VoxCPM2 and Voxtral TTS are remeasured with every
variant and longer inputs.
- **A profile per runtime backend.** The same input peaks 0.5 to 4 GiB
higher on audio.cpp's Vulkan build than on CUDA. `estimate_resident_gb`
reads the installed runtime's backend and uses the CUDA profile on
NVIDIA and the Vulkan one on AMD. With no runtime installed yet, or
another build, it takes the larger. This also applies to the music
families from unslothai#16628 and unslothai#16726, so YuE2 Q8_0 (9.23 GB) and Stable Audio
3 Medium F16 (9.32 GB) fit the 10 GB card from unslothai#16627 on NVIDIA.
- **A fallback per backend** for families not measured yet. CUDA keeps
`weights × 2.5 + 1.5`, and Vulkan gets `weights × 1.85 + 4.5`.
VibeVoice, whose peak keeps growing with the input, keeps the former
everywhere.
- I chose each line to minimize expected user frustration across common
card sizes, counting a load that runs out of memory as ten refusals. I
checked them by fitting on all the measured families but one and scoring
the held-out one, for each family in turn.
- On Vulkan the new line has fewer crashes and a lower total cost
(held-out cost 0.29 against 0.33).
- On CUDA a lower line would save some refusals but makes one held-out
family run out of memory, so CUDA keeps its fallback.
- Transcription models are untouched: their loads never use this
estimate.

## Measurements

Peak memory of the audio.cpp v0.9.3 server process, with Studio's
default options. CUDA was measured on an RTX 3090 and an RTX 6000 Ada.
Vulkan was measured on the 3090 and on a Radeon 8060S through AMD
DevLab. TTS runs used 30 s references and text past several chunks, or
to the default generation cap (Qwen3-TTS, OmniVoice, Higgs); music ran
each workflow at its cap. A raised token cap can grow caches past these
figures.

Every measured variant, with its package size, values in GiB. "(low)"
marks where main was below the peak plus the 0.9 GiB margin every
profile keeps.

| Model | Package | CUDA peak | Vulkan peak | main | CUDA now | Vulkan
now |
|---|---|---|---|---|---|---|
| ACE-Step 1.5 | 5.76 | 11.19 | 11.22 | 12.18 | 12.11 | 12.18 |
| ACE-Step 1.5 | 9.40 | 14.74 | 15.31 | 16.36 | 15.67 | 16.36 |
| BreezeTTS 2 | 3.53 | 5.50 | 6.83 | 10.33 | 7.12 | 12.10 |
| BreezeTTS 2 | 4.15 | 6.12 | 8.39 | 11.88 | 7.46 | 12.10 |
| BreezeTTS 2 | 4.73 | 6.87 | 11.18 | 13.33 | 7.78 | 12.10 |
| BreezeTTS 2 | 6.84 | 8.00 | 9.79 | 18.60 | 8.94 | 12.10 |
| Chatterbox | 1.95 | 5.16 | 4.82 | 5.45 (low) | 6.08 | 5.74 |
| Chatterbox | 3.49 | 5.23 | 5.19 | 6.99 | 6.15 | 6.12 |
| CosyVoice3 | 2.10 | 3.08 | 4.73 | 6.76 | 4.08 | 5.64 |
| CosyVoice3 | 6.51 | 5.81 | 7.36 | 17.79 | 6.73 | 8.29 |
| HeartMuLa | 7.13 | 18.40 | 19.58 | 20.54 | 19.31 | 20.53 |
| Higgs Audio v3 | 4.75 | 6.19 | 6.47 | 6.75 (low) | 7.14 | 7.45 |
| Higgs Audio v3 | 7.92 | 9.40 | 9.55 | 21.30 | 10.32 | 10.46 |
| Kokoro | 0.18 | 2.41 | 2.99 | 3.68 (low) | 3.65 | 3.91 |
| Kokoro | 0.20 | 2.39 | 2.12 | 3.70 | 3.65 | 3.91 |
| Kokoro | 0.87 | 2.41 | 3.05 | 4.37 | 3.65 | 3.98 |
| MiDashengLM-Gen | 3.15 | 3.93 | 4.42 | 5.40 | 4.84 | 5.40 |
| MiniMax Music 3 | 7.87 | 13.08 | 14.00 | 21.16 | 14.00 | 14.92 |
| MiniMax Music 3 | 12.61 | 16.35 | 17.26 | 33.02 | 17.32 | 18.24 |
| MOSS-TTS v1.5 | 8.62 | 7.79 | 10.34 | 23.05 | 8.93 | 11.25 |
| MOSS-TTS v1.5 | 12.28 | 11.25 | 12.60 | 32.20 | 12.41 | 14.91 |
| MOSS-TTS v1.5 | 19.13 | 18.00 | 20.58 | 49.34 | 18.92 | 21.76 |
| OmniVoice | 1.26 | 4.44 | 6.82 | 4.64 (low) | 5.35 | 7.73 |
| OmniVoice | 1.53 | 3.96 | 4.92 | 5.32 (low) | 5.37 | 7.75 |
| Qwen3-TTS | 1.85 | 5.88 | 9.18 | 6.13 (low) | 7.22 | 10.91 |
| Qwen3-TTS | 2.34 | 6.36 | 9.66 | 7.36 (low) | 7.95 | 11.45 |
| Qwen3-TTS | 2.51 | 6.73 | 9.50 | 7.77 (low) | 8.20 | 11.63 |
| Qwen3-TTS | 2.62 | 7.47 | 10.84 | 8.06 (low) | 8.38 | 11.76 |
| Qwen3-TTS | 3.89 | 8.85 | 12.20 | 11.23 (low) | 10.28 | 13.15 |
| Qwen3-TTS | 3.92 | 8.11 | 12.06 | 11.29 (low) | 10.31 | 13.18 |
| Qwen3-TTS | 4.23 | 8.20 | 11.49 | 12.08 (low) | 10.79 | 13.53 |
| Stable Audio 3 | 1.57 | 2.24 | 2.01 | 3.47 | 3.52 | 3.47 |
| Stable Audio 3 | 2.20 | 2.80 | 2.54 | 4.60 | 4.46 | 4.60 |
| Stable Audio 3 | 3.34 | 5.27 | 5.34 | 6.66 | 6.18 | 6.66 |
| Stable Audio 3 | 5.43 | 7.30 | 9.48 | 10.43 | 9.32 | 10.43 |
| VoxCPM2 | 2.75 | 8.62 | 8.94 | 10.75 | 10.75 | 10.75 |
| VoxCPM2 | 4.45 | 11.09 | 11.15 | 14.48 | 14.48 | 14.48 |
| VoxCPM2 | 4.62 | 11.09 | 13.11 | 14.86 | 14.86 | 14.86 |
| VoxCPM2 | 8.89 | 19.06 | 22.36 | 24.26 | 24.26 | 24.26 |
| Voxtral TTS | 4.40 | 5.31 | 5.92 | 6.40 (low) | 6.40 | 6.84 |
| Voxtral TTS | 7.48 | 8.38 | 11.15 | 20.20 | 9.48 | 12.07 |
| YuE2 | 2.73 | 6.78 | 6.52 | 7.73 | 7.69 | 7.73 |
| YuE2 | 4.22 | 8.27 | 8.58 | 9.52 | 9.23 | 9.52 |
| YuE2 | 7.01 | 11.19 | 11.87 | 12.86 | 12.10 | 12.86 |

Two profiles sit above the tightest fit on purpose:

- **Qwen3-TTS on CUDA** is steeper, so 0.6B Q8_0 stays at 7.2 GB and
loads on an 8 GB card.
- **VoxCPM2 and Kokoro** also cover unslothai#16514's whole-device peaks (VoxCPM2
9.66 and 13.31 GiB, Kokoro 2.74 GiB).

## Not changed here

- Chatterbox convert grows with the source: 12.7 GiB at 60 s, out of
memory at 120 s, yet Studio allows 300 s. The profile covers sources up
to 30 s.
- VoxCPM2 clone fails with references of 15 s or more; Studio allows 30
s.
- Higgs Audio v3 stops at its 2,048-token chunk cap on long text.
- Kokoro multilingual stops resolving when it is the only Kokoro file in
the cache.
- MiniMax Music 3 BF16 was not measured and keeps the generic formula.

## Tests

- New tests check every measured variant against its CUDA and Vulkan
peak with the margin, the profile and fallback for each backend (CUDA,
Vulkan, none, other) and YuE2's placement on the unslothai#16627 card under each
backend. The estimate tests pin the backend, so the installed runtime
doesn't affect them.
- The audio, music, TTS and variant-listing suites pass.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Create Music Incorrect Reporting

3 participants