Add MiniMax-Music3 community model - #241
Conversation
Lyrics- and caption-conditioned song generation (44.1 kHz stereo, up to six minutes) following the diffusers MiniMaxMusic3ModularPipeline: Qwen3-8B autoregressive semantic codes with classifier-free guidance, a 4-layer RVQ depth decoder, a 36-layer flow-matching transformer over overlapping 200-frame windows, and a DAC-style Flow-VAE decoder. The global LM rides the shared QwenCausalDecodeRuntime for prefill and a batch-2 decode graph built from QwenDecoderLayerModule for the CFG pair (one weight pass per frame). The depth decoder runs its seven codebook steps as a single unrolled graph with on-device top-k Gumbel sampling. The flow transformer uses flash attention with F16 weights and activations. Component parity against the diffusers reference is validated by tests/minimax_music3 fixtures; 32 s of audio renders in 67 s on an RTX 3090 (Q8_0 LM). Framework changes: the static-cache decode tail's post-attention reshape is now shape-driven (identical for existing batch-1 users), the minimax_h3 model-spec fallback also covers minimax_music3, and a ggml-quantize-raw helper target supports K-quant conversion from the Python GGUF converters. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
f24a877 to
a20b134
Compare
|
Could a maintainer tag this with the |
The joemattie/MiniMax-Music3-GGUF repo hosts the converted package with the installer's nested layout, so the model manager and native UI can install both precisions today; the repo id can flip to the official audio-cpp/audio.cpp-gguf catalog once the package is mirrored there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@JoeMattie Thank you for the PR! We quietly made the model public this morning but haven’t announced it yet. https://github.com/0xShug0/audio.cpp/tree/preview/minimax-music-3 and GGUFs are at https://huggingface.co/audio-cpp/MiniMax-Music3-GGUF. Would you like to give it a try? I think the best way is to apply your improvements or pieces we’re missing to preview/minimax-music-3 and hopefully we can address the issues mentioned here #230 (comment). I really appreciate you taking the time to work on Music 3. And definitely don’t let this discourage you from contributing more models! |
|
Thanks, and no discouragement at all. Nice port! I took you up on it and applied my pieces on top of Highlights from testing the preview branch on my box (RTX 3090, CUDA 13.3):
After the fixes your default q4_k config benches at RTF ~2.1 for 32 s here, and interestingly BF16 flow beats all-F16 on this branch, so I proposed no precision changes, just the conv guard. For the open issues from the #230 discussion I left notes in #243: component-seam parity against the diffusers reference as a precision-robust quality metric (happy to port that harness from this PR as a follow-up), plus quant sensitivity data (depth decoder is the fragile one, embeddings tolerate Q8, and slicing the LM head to the 16385 sampleable rows saves ~1.5 GB for free). Feel free to close this PR in favor of the preview branch, or cherry-pick anything useful from it; the converted packages from this PR live at https://huggingface.co/joemattie/MiniMax-Music3-GGUF if any variants help. |
|
Closing in favor of the official port on preview/minimax-music-3 plus #243. The branch and the HF package stay up for cherry-picking. |
|
@JoeMattie Thanks! I added your repo to the HF README. I will include your repo as a download source in the spec once we finalize it! |
Why is there is no Q8 versions? |
|
@mirek190 I don’t see a clear win for q8_0 over q4_0 in terms of speed or VRAM usage. The q4_k component GGUFs in the repo are just sync leakage. The final repo may just keep q4_0, or whichever variant ends up winning. |
Q4 has a low precision comparing to Q8. ( quality should be better ) So we could allow to use Q4 , Q8 and bf16 versions |
okay sounds good. I will add them later. |
Adds
minimax_music3: lyrics- and caption-conditioned song generation with MiniMaxAI/MiniMax-Music3 (44.1 kHz stereo, up to six minutes). The port follows the diffusersMiniMaxMusic3ModularPipelinereference: a Qwen3-8B autoregressive stage emits one semantic code per 40 ms frame with classifier-free guidance, a 4-layer RVQ depth decoder fills seven residual codebooks per frame, the fused per-frame hidden states condition a 36-layer flow-matching transformer over overlapping 200-frame windows, and a DAC-style Flow-VAE decoder renders stereo audio.Full documentation with package layout, conversion commands, and options:
docs/community_models/minimax_music3.md. Design notes:docs/proposals/minimax_music3.md.Reuse and implementation notes
QwenCausalDecodeRuntimefor prefill. Decode runs the conditional/unconditional CFG pair as one batch-2 graph built from the sharedQwenDecoderLayerModule::build_with_static_cache_tailwith family-owned per-branch KV caches, so the 8B weights stream once per frame; the two sequences are always position-aligned, so one KV write slot and mask serve both.ggml_top_k, host-supplied Gumbel noise, argmax. Gumbel-max over the masked logits draws exactly from the reference's renormalized top-k distribution, and zero noise reduces to greedy decoding for the parity probe.Framework changes
qwen_decoder.cpp: the static-cache decode tail's post-attention reshape was hardcoded{1, 1, heads * dim}; it now derives batch and steps from the input shape. Identical behavior for every existing batch-1 caller; verified at runtime with NeuTTS 2E (neutts_2e_orig, which decodes through this exact path): a CUDA TTS generation after the change produces healthy audio at RTF 0.48.package.cpp: the multi-file-package model-spec fallback that coveredminimax_h3now also coversminimax_music3.ggml-quantize-rawtool target (tools/ggml_quantize_raw.c): a stdin/stdoutggml_quantize_chunkhelper for tensor types gguf-py cannot quantize (K-quants);scripts/minimax_h3/convert_dit_gguf.pyalready expected such a binary.catalog.ts(the multi-component package loads vialm_*.gguf, like minimax_h3'sdit.gguf).Build and run
Validation
Component parity against diffusers 0.40.0.dev0 (fixtures via
tests/minimax_music3/reference_dump.py, C++ side viatests/minimax_music3/minimax_music3_component_probe.cpp, built with-DENGINE_BUILD_WARMBENCH=ON):End-to-end generations (8 s and 32 s, multiple prompts/seeds) produce structured stereo music with intact window stitching. A demo output is published with the weights: samples/blues_32s_seed7_q8_0.wav.
Long-lived server session: three sequential
/v1/tasks/rungenerations against one loaded model all succeeded, with idle VRAM stable between requests (451 / 467 / 467 MiB;mem_saverdefaults on and frees each phase's weights after the request). Peak VRAM during a request is about 14 GB in the autoregressive phase.python3 tools/check_loader_catalog_sync.py --self-testand the main sync check both pass; every file advertised by both spec packages resolves against the download repo (verified with per-file HTTP checks).Performance and memory
RTX 3090, CUDA 13.3, 32 s of audio at 30 flow steps:
Stage timings are logged as
minimax_music3.{ar_lm_decode,ar_depth,ar,flow,vocode,total}_ms. VRAM peaks around 14 GB during the autoregressive phase and around 8 GB during the flow phase;mem_saverdefaults on and loads each phase's weights on demand.Known limitations
runtime.tags: ["cuda", "gguf"]); the components also run on CPU (used by parity tests) but far below real time, and Vulkan/HIP/Metal are untested.audio-cpp/audio.cpp-ggufand flip the repo id whenever you prefer.🤖 Generated with Claude Code