Repository navigation
Conversation
|
just released 0.8.1. stopped the workflows and let me check |
|
Before / after (same tokens, same noise, same 32 steps)
Both columns use identical injected inputs ( |
|
I was testing that whole day :) Now is perfect reproduction from PyTorch |
b2de4eb to
dc983ec
Compare
Adds opt-in YuE2 request options that let callers drive the pipeline from externally computed tensors, and fixes the symbolic prefix helper so plans that carry ABC token IDs are closed the same way whether those IDs came from ABC text, from the planner, or from a file. New request options (model-local, opt-in, default off): - abc_ids_file / abc_ids_out_file Inject or dump exact ABC token IDs, bypassing tokenization. - semantic_tokens_file / semantic_tokens_out_file Inject or dump exact semantic codec token IDs (0..32767), bypassing AR sampling. - latent_in_file / latent_out_file Decode precomputed NAR latents (bypasses AR and NAR) or dump the latents produced before VAE decode. - nar_noise_out_file Dump the resolved NAR noise ([frames,64] float32). - nar_velocity_out_file Dump the first v_theta(x, t) evaluation of the flow solve. - nar_tap_out_file + nar_tap_stage Dump an intermediate NAR activation: embed, prehead, layer<N>, or layer<N>.norm|attn|mlp. Fix: token_prefixes() appended ABC_END/MUSIC_START only when request.abc text was present. A plan that carries ABC token IDs without the text produced a prefix that was missing those two tokens, so the acoustic stage conditioned on a malformed prompt. The guard now keys off the ABC IDs that were actually consumed, which matches how the generated-ABC path closes the block. Validation (Windows 10/11, CUDA 12.4, RTX 3090, custom -Models yue2 build) against the PyTorch YuE2 reference (m-a-p YuE2-3B / YuE2-Vae): - Same ABC ids + same codec tokens + same NAR noise, 32 steps: - BF16 GGUF: NAR latent cosine 0.99994, decoded audio correlation 0.9999 - Q8_0 GGUF: NAR latent cosine 0.99989, decoded audio correlation 0.9998 - duration and alignment match exactly - Before the prefix fix the same comparison measured 0.611 latent / 0.34 audio, which is what surfaced the missing tokens. - Standalone generation (no injected tensors) is unchanged.
dc983ec to
d205291
Compare
|
Rebased onto The only conflict was Validation is unaffected — v0.8.1 does not touch any YuE2 code ( |
|
@mirek190 I think these parity debug options should be removed. The original dev implementation had similar options, but I removed them during cleanup because they added substantial complexity to the runtime. The reported prefix issue does not appear to affect current behavior. Normally, users provide ABC text, not pre-tokenized ABC IDs. The code tokenizes that text itself, so The problematic state, where The parity investigation is useful, but I do not think these model-specific diagnostic inputs and intermediate tensor dumps should become part of the public runtime. Update: For parity, using the standalone probes is a better way. |
|
If you really want to keep some debugging options, options for "control" are more useful than output-only tensor dumps, such as noise that applications can easily provide themselves. It does not require the Python reference and still produces meaningful output. |
|
You're right, thanks for the pointer to the probes. I re-checked reachability on
So Removing the diagnostic options and closing this. Parity is being redone as a standalone probe under My bad ;) too long in from of computer today |
|
Parity now lives in a standalone probe: #598.
Measured on an RTX 3090: cosine |
Summary
Two related YuE2 changes:
The prefix bug
token_prefixes()insrc/models/yue2/pipeline.cppclosed the symbolic block only when ABC text was present:The helper receives
abc_ids, so the guard should key off the IDs it actually consumed. When a plan carries ABC token IDs without the text, the returned prefix is missingABC_END+MUSIC_START, and the acoustic stage conditions on a prompt that never closes the symbolic block.This is latent today because the only upstream producer of
abc_idsistokenizer.encode(request.abc), soabc_idsis non-empty exactly whenabcis non-empty. It becomes live as soon as the IDs can come from anywhere else — which is what theabc_ids_fileoption in this PR does, and why the fix is included here rather than in a separate PR (the option is not correct without it).The generated-ABC path was never affected:
generate_semantic()appends the two tokens itself after the planner returns.New request options
All model-local, opt-in, default off, and documented in
docs/models/yue2.md:abc_ids_file/abc_ids_out_filesemantic_tokens_file/semantic_tokens_out_file0..32767(raw int32), bypassing AR samplinglatent_in_file/latent_out_filenar_noise_out_file[frames,64]float32nar_velocity_out_filev_theta(x, t)of the flow solvenar_tap_out_file+nar_tap_stageembed,prehead,layer<N>, `layer.normThese turn "does the port match the reference?" into a per-stage question (tokens, noise, latents, velocity, layer activations) instead of an end-to-end listen test.
latent_in_filealso gives a bit-faithful VAE path: decoding reference latents reproduces the reference audio exactly.Build / run
Built on Windows 11 with the repo's own script (MSVC 14.43, CUDA 12.4, RTX 3090, sm_86):
Models:
audio-cpp/Yue2-3B-GGUF(yue2-3b-bf16.gguf,yue2-3b-q8_0.gguf,yue2-vae-f16.gguf+ sidecars).Reference:
m-a-p/YuE2-3B+m-a-p/YuE2-Vaethrough the Python pipeline, same request and seed.Validation
Injected plan/tokens/noise, 32 steps, compared against the Python reference audio:
yue2-3b-bf16.ggufyue2-3b-q8_0.gguflatent_in_file(reference latents)Same comparison before the prefix fix: latent cosine 0.611, audio correlation 0.34. The gap was entirely the two missing prefix tokens, not kernel numerics.
Standalone generation (no injected tensors) is unchanged by these options and by the fix: the same seed and request reproduce the same audio, and the guard change only affects plans with IDs and no text.
A second cross-check that helped isolate the issue: feeding the CUDA sampler's exact tokens and noise into the Python reference reproduces audio.cpp's latents at 0.9998 and even reproduces its occasional decode clicks at the same timestamps, so those are model/VAE behaviour for particular token draws and not a decode bug.
Known limitations
nar_noise_fileconvention.abc_ids_filerequirescot=melodyorcot=full;semantic_tokens_filebypasses AR sampling entirely, soguidance_scale/ABC options have no effect on that route.pipeline.cpphelpers live in an anonymous namespace, so a unit test would need a small refactor to expose the prefix builder. Happy to add one if you want the shape first.