Skip to content

YuE2 CPU: NAR crashes with GGML_ASSERT(ctx->mem_buffer != NULL) on Ryzen (nightly 61e06 too; arena/tiling not applied on CPU) #656

Closed

Description

@pluginfixs-a11y

Describe the bug
YuE2 generation on CPU crashes during NAR graph setup with a ggml allocation failure. The track never completes to WAV.

Environment

  • audio.cpp test-61e06 (2026-09-22, windows-x64-cpu) and v0.8.1 release (same failure)
  • Windows 10, AMD Ryzen 5 5600 (6C/12T), 32 GB RAM, CPU-only
  • yue2-3b-q8_0.gguf + yue2-vae-f32.gguf + official sidecars

Repro
audiocpp_cli --task gen --family yue2 --model

--backend cpu --threads 10 --session-option yue2.model_gguf=yue2-3b-q8_0.gguf --session-option yue2.vae_gguf=yue2-vae-f32.gguf --lyrics "Sunlight on the window, morning in the air." --request-option "style=English, indie pop, acoustic guitar, soft drums" --request-option cot=off --request-option num_inference_steps=4 --duration-seconds 6 --seed 1234 --out out.wav --log --metrics

AR (semantic) completes: 3928 tokens (~6.5 min on this CPU). NAR then fails:

yue2.nar.synthesize.codec_tokens 3928
yue2.nar.synthesize.chunks 1
yue2.nar.synthesize.context 24576
D:\a\audio.cpp\audio.cpp\external\ggml\src\ggml.c:1685: GGML_ASSERT(ctx->mem_buffer != NULL) failed
(exit -1073740791)

Observations / attempts

  • Fails even with 22 GB free RAM; also with --session-option yue2.nar_graph_arena_mb=8192.
  • yue2.nar.graph.buffer_bytes is never printed (crash precedes that log).
  • pipeline.cpp:149 (void) this->nar_graph_arena_bytes; -> arena option is unused on CPU.
  • NAR attention tiling (yue2: tile the eager NAR attention so long songs fit a 4 GiB buffer [bugfix] #642) is applied only for non-CPU backends; the CPU path builds the full NAR graph.
  • Generation-config validator pins context to 24576 (assets.cpp), so the buffer cannot be reduced via config.

Expected
CPU NAR should tile attention like other backends / use a sane arena budget / allow smaller context, so short tracks complete on CPU.

Activity

  1. 0xShug0 commented on Sep 23, 2026

    @0xShug0
    Owner

    @pluginfixs-a11y Please set these options to 256 (or maybe as low as 32) as a temp workaround and let me know if this works.

    --session-option yue2.model_weight_context_mb=256
    --session-option yue2.vae_weight_context_mb=256
    --session-option yue2.ar_prefill_graph_arena_mb=256
    --session-option yue2.ar_decode_graph_arena_mb=256
    --session-option yue2.nar_graph_arena_mb=256
    --session-option yue2.vae_graph_arena_mb=256
    

    Update: YuE2 doesn't have duration_sec. To control duration you need to use

    --request-option semantic_min_tokens=X
    --request-option semantic_max_tokens=Y
    
  2. 0xShug0 commented on Sep 24, 2026

    @0xShug0
    Owner

    @pluginfixs-a11y @engival

    Tested on Windows. Set those context_mb or arean_mb to 256 should work. 32 is actually sufficent for the 6s case.

    Six 32 MiB options Peak virtual address use
    Set 12.943 GiB
    Omitted 34.818 GiB

    Also tested in a Linux container with ulimit -v 16777216 (16 GiB virtual address space). Without those options, the run failed. Different error messages, but I think they’re related to the same issue.

    ggml_aligned_malloc: insufficient memory (attempted to allocate 5197.34 MB)
    ggml_backend_cpu_buffer_type_alloc_buffer: failed to allocate buffer of size 5449802240
    ggml_gallocr_reserve_n_impl: failed to allocate CPU buffer of size 5449802240
    audiocpp_cli failed: Oobleck audio VAE decode backend buffer allocation failed
    

    With those options set to 32, it generated the full song using the cmd provided (duration_sec is the wrong option, but I used it as-is).
    wrong-duration-16g.log
    wrong-duration-16g.wav

    For now, I'd prefer not to change the code. Later, during the housekeeping pass, we can just lower the defaults for these control options. @engival I'm going to close the PRs, but I'll add a label to #667 so I can revisit it when I have some cycles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions