libref, libavx, libr4d: rvq_embed's clamp -- a code past a codebook smaller than the heads that wrote it reads the codebook's last row, as Fish Audio's codec reads its 1024-entry residual codebooks

This commit is contained in:
zivius committed 2026-10-20 23:07:33 +02:00
1 parent 832a88faac
commit 346efdeb2e
9 files changed
+41 -25

No files matched your search

+3
View File
@@ -1015,6 +1015,9 @@ std::vector<Case> build_cases() {
for (double sc : { 1.0, 0.7 })
add("rvq_embed", { HI("M", 7), HI("n_embd", 645), HI("n_codes", 8), HI("vocab", 64),
HI("off0", 5), HF("scale", sc), HS("dtype", dt) });
/* Codes past a codebook smaller than its heads read its last row (Fish Audio's codec). */
add("rvq_embed", { HI("M", 7), HI("n_embd", 645), HI("n_codes", 4), HI("vocab", 64),
HI("off0", 0), HF("scale", 1.0), HI("clamp", 40), HS("dtype", dt) });
/* One rounding of the whole sum: sixteen codebooks, as a speech model's frame embedding. */
for (double sc : { 1.0, 0.7 })
add("rvq_embed", { HI("M", 7), HI("n_embd", 645), HI("n_codes", 16), HI("vocab", 64),