Skip to content

fix: correct EMA RVQ exports and verify trained-model parity - #75

Merged
apage224 merged 7 commits into
mainfrom
issue-74-rvq-codebook-export
Oct 6, 2026
Merged

apage224 merged 7 commits into
mainfrom
issue-74-rvq-codebook-export

Conversation

@apage224

@apage224 apage224 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

EMA RVQ exports included embedding-sum accumulators as additional codebooks. Two-level models consequently advertised four levels, doubling table storage and fixed-width token payloads while changing reconstruction. This repair exports only the trained codebooks and checks deployment against an independently restored training quantizer.

Closes #74.

Prerequisite #65 is merged. This PR now targets main and includes its merge commit without changing the reviewed code. Fresh CI and documentation checks passed against the updated base at d6359e7. The integration commit has the same source tree as the independently reviewed cd01a0c.

Changes

  • Validate explicit EMA weight layouts, level counts, shapes, and warm-start state during training export and saved-run repackaging.
  • Load checkpoint arrays and runtime levels in numeric order; preserve float32 values in compilable C headers.
  • Export independent source latents, tokens, quantized latents, and reconstructions. Strict validation checks numerical encoder/decoder parity and exact quantizer parity.
  • Generate sample reconstructions through VQ and refresh precision reports against corrected tables.
  • Support INT8-only decoders using the float Keras companion for training parity. Generate float references on CPU to avoid GPU TF32 rounding.
  • Run CI for stacked PRs and document affected published revisions in maintainer-notes/rvq-export-audit.md.

Validation

  • Full devcontainer suite: 443 passed, 78 skipped for optional artifacts/data.
  • Ruff, formatting, shell syntax, GitHub CI, and Astro documentation checks pass at final head d6359e7.
  • Fresh independent review of the combined changes found no remaining actionable findings; the reviewer independently passed 16 targeted tests.
  • The recorded export audit regenerated 11 single-stage RVQ candidates and validated their training parity. For ECG/PPG 8x, corrected packets shrink from 260 to 132 bytes and 164 to 84 bytes respectively, including the 4-byte header.

Compatibility and scope

Older RVQ packages without independent training references require re-export for strict validation. Corrected level counts change packet interpretation; old packets remain bound to their original bundle. Audit artifacts are git-ignored and unpublished. The audit establishes deployment parity, not a new physiological-quality result; two-stage entropy priors were not requalified.

@apage224
apage224 requested a balanced review from Copilot October 5, 2026 23:44
@apage224
apage224 removed the request for review from Copilot October 5, 2026 23:48
@apage224
apage224 marked this pull request as ready for review October 6, 2026 00:46
@apage224

apage224 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Integrated the updated prerequisite and resolved the stack integration issues. CI now runs on stacked PRs. A fresh independent review of the combined changes found no remaining actionable findings and independently passed 16 targeted tests.

At cd01a0c, the full devcontainer suite passed 443 tests (78 optional artifacts/data skips). GitHub CI and Astro documentation checks both passed. No merge conflicts remain. Merge #65 first, then retarget this PR to main and verify its checks before merging.

@apage224
apage224 changed the base branch from issue-64-multiprecision-encoder-release to main October 6, 2026 11:48
@apage224
apage224 merged commit 7a54438 into main Oct 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix EMA RVQ codebook export and verify trained-model deployment parity

1 participant