Repository navigation
tests(yue2): add a standalone NAR parity probe - #598
Merged
Merged
Conversation
Parity work should not need reference-only inputs in the request surface. The probe drives Yue2ArRuntime/Yue2NarRuntime directly, the way yue2_vae_parity_probe drives the VAE, and reads everything the acoustic flow consumes from files: the token prefix, the codec tokens, the fp32 noise the Python reference integrated, and the reference latents. yue2_nar_reference_dump.py records those tensors. ABC and semantic sampling run greedily so token choice carries no RNG, and the noise draw mirrors yue2.nar.song_chunks, which leaves the comparison to the port. metadata.json carries the seed, steps and context so the probe integrates the same path. Measured on an RTX 3090: cosine 0.9999 with the bf16 package for both a 734-token and a 4144-token prefix, and 0.9999 / 0.9976 with the shipped q8_0 package, which accumulates more error over long prefixes. The default thresholds accept the q8_0 package while still catching structural breakage, which measured 0.611 on the same inputs during the investigation. The target is built with the test targets and only when the model composite links yue2, because it uses the model runtime rather than framework code.
Owner
|
Merged! Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #596, which is closed: the reference-only request options are gone, and parity comes back as a standalone probe.
What this adds
tests/yue2/yue2_nar_parity_probe.cppdrivesYue2ArRuntime/Yue2NarRuntimedirectly — the wayyue2_vae_parity_probedrives the VAE — and reads everything the acoustic flow consumes from files:prefix.i32MUSIC_STARTcodec.i32noise.f32[frames, 64]fp32 noise the reference integratedlatents_ref.f32[frames, 64]reference latentsmetadata.jsontests/yue2/yue2_nar_reference_dump.pyrecords those tensors from the Python reference. ABC and semantic sampling run greedily so token choice carries no RNG, the noise draw mirrorsyue2.nar.song_chunks, and the steps/context come from the pipeline generation config. Nothing model-specific is added to the request surface.Verification
python tests/yue2/yue2_nar_reference_dump.py --reference-root reference/YuE \ --model models/YuE2-3B --vae models/YuE2-Vae --out-dir /tmp/yue2nar build/bin/yue2_nar_parity_probe --model models/Yue2-3B-GGUF \ --reference /tmp/yue2nar --backend cudaThe q8_0/bf16 gap is weight-quantization accumulation over long prefixes rather than a port difference, so the defaults (
--min-cosine 0.995,--max-rmse 0.1) accept the shipped q8_0 package while still catching structural breakage — a wrong prefix assembly measured 0.611 on the same inputs during the investigation.Tested on an RTX 3090 (CUDA) with both packages, plus a short CPU smoke run. The target sits behind the existing test option and only builds when the model composite links
yue2, because it uses the model runtime rather than framework code.