Repository navigation
fix(personaplex): round the FP16 depth input like the reference - #1789
Closed
chaofengw-nv wants to merge 1 commit into
Closed
chaofengw-nv wants to merge 1 commit into
chaofengw-nv wants to merge 1 commit into
Conversation
The reference builds each depth step's input as F.linear(temporal_hidden) plus the previous-token embedding in the depth transformer's dtype: in FP16 the weights, the projection output, the embedding and the sum are each rounded to Half. The depth-input helper summed FP32 copies of the BF16 tables in FP32 and left a single Half rounding to the depth engine, so the depth input differed from the reference in every FP16 depth step. The helper now rounds at those boundaries to the depth engine's compute dtype, taken per codebook from the engine's cache_k_0 dtype. FP32 depth engines keep the FP32 formula. A GPU regression test checks a binary counterexample whose reference result is 0 (the old formula gives 2^-12) and that the FP32 path is unchanged. Fixes NVIDIA#1788 Signed-off-by: chaofengw <chaofengw@nvidia.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
This was referenced Oct 18, 2026
chaofengw-nv
added a commit
to chaofengw-nv/TensorRT-Model-Connect-fork
that referenced
this pull request
Oct 20, 2026
Round depth projection weights, inputs, projection output and token embedding additions at the reference Half boundaries. Closes NVIDIA#1788 Refs NVIDIA#1789 Signed-off-by: chaofengw <chaofengw@nvidia.com>
3 of 11 tasks
Collaborator
Author
chaofengw-nv
added a commit
to chaofengw-nv/TensorRT-Model-Connect-fork
that referenced
this pull request
Oct 21, 2026
Round depth projection weights, inputs, projection output and token embedding additions at the reference Half boundaries. Closes NVIDIA#1788 Refs NVIDIA#1789 Signed-off-by: chaofengw <chaofengw@nvidia.com>
chaofengw-nv
added a commit
that referenced
this pull request
Oct 21, 2026
* fix(personaplex): decode with the FP32 Mimi codec Build the Mimi decoder in FP32, matching the encoder and native codec for every language-model precision. Closes #1750 Signed-off-by: chaofengw <chaofengw@nvidia.com> * fix(personaplex): keep RMSNorm epsilon in FP32 Create RMSNorm epsilon in FP32 so the 1e-8 value survives Half network construction. Closes #1779 Refs #1780 Signed-off-by: chaofengw <chaofengw@nvidia.com> * fix(personaplex): preserve Half embedding additions Sum audio embeddings before text and round each addition to Half for Half temporal engines. Closes #1778 Refs #1781 Signed-off-by: chaofengw <chaofengw@nvidia.com> * fix(personaplex): round the FP16 depth input like the reference Round depth projection weights, inputs, projection output and token embedding additions at the reference Half boundaries. Closes #1788 Refs #1789 Signed-off-by: chaofengw <chaofengw@nvidia.com> * fix(personaplex): preserve reference RoPE precision Construct RoPE angles and rotation in FP32, then restore the input dtype across the family decoder variants. Closes #1790 Refs #1791 Signed-off-by: chaofengw <chaofengw@nvidia.com> * fix(personaplex): round the SwiGLU gate product once Evaluate SiLU and its gate product in FP32, casting the combined result to the projection dtype once. Closes #1793 Refs #1794 Signed-off-by: chaofengw <chaofengw@nvidia.com> * fix(personaplex): build the FP16 profile with a Half core Remove component-promotion selectors from the primary FP16 manifest. Preserve the declared BF16 E2E reference and all existing thresholds. Refs #1786 Refs #1795 Signed-off-by: chaofengw <chaofengw@nvidia.com> * fix(personaplex): preserve residual input rounding Preserve rounded branch outputs before residual addition across the family decoder variants. Closes #1796 Refs #1797 Signed-off-by: chaofengw <chaofengw@nvidia.com> * fix(personaplex): store RMSNorm weights in the model dtype Round RMSNorm scale weights to the model dtype before the FP32 normalization computation. Closes #1799 Refs #1800 Signed-off-by: chaofengw <chaofengw@nvidia.com> --------- Signed-off-by: chaofengw <chaofengw@nvidia.com>
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.
Background
Fixes #1788. When the PersonaPlex depth transformer runs in FP16, the reference builds each depth step's input as
depformer_in[cb](hidden)with a HalfF.linear, rounds that output to Half, and then adds the Half previous-tokenembedding. The runtime's depth-input helper (
prepare_depth_embedding_kernel) instead summed FP32 copies of the BF16tables in FP32, and the depth engine applied a single Half rounding afterwards.
As a result, the FP16 depth input differed from the reference in every depth step, even when the temporal hidden state
and the previous token were identical.
Exit Criteria
Half, the projection output is rounded to Half, and the embedding plus the sum are rounded to Half.
Implementation
sampling_kernels.cugainsround_to_depth_dtype, which applies Half or BF16 rounding, or none for FP32. The kernelapplies it to each projection operand, to the reduced projection, to the seed embedding, and to their sum. The launcher
takes the depth dtype as a new parameter.
SpeechPipeline::prepare_depth_inputpasses each codebook engine's owncache_k_0dtype. The depth engine computes inits KV-cache dtype, so this is the dtype of the reference's depth
F.linearand add.test_personaplex_depth_embedding_kernel(CTest labelgpu; it exits with skip code 77 when no GPU ispresent). It uses hidden
[1, 1], projection row[1, 2^-12]and embedding-1, all exact in BF16 and Half. Thereference result is 0, while the old formula gives 2^-12. The test also asserts that FP32 depth still returns 2^-12.
minimal correction to that kernel. No new kernels, tactic choices or GPU-specific branches are added.
Change categories
Validation
Commands and Results
main88ceb9f:cmake -DTRTMC_BUILD_TESTS=ON, builttrtmc_model_personaplexand the 7 PersonaPlex C++ tests, then ranctest -R ^test_personaplex_. Result: 7/7 passed,including the new GPU test (0.62 s). The tested source hashes equal this commit's files.
main88ceb9f and from this change, each compiled as-is, called onthe same inputs.
with the fix gives 2^-12, unchanged.
reference's own temporal hidden state and previous token (recovered uniquely in all 640 steps).
655,360 elements.
torchreproducesbitwise, while the helper keeps its own FP32 reduction order. That order is the likely cause, but it is unverified.
git diff --check: clean.clang-format --dry-runon the changed C++ and CUDA files: clean.Hardware, Environment, and Revisions
GB300 (SBSA), CUDA 13.0, TensorRT 11.2. Checkpoint
nvidia/personaplex-7b-v1revisionfdaf4090a61cb315c138a1faee287ffd6c716309(BF16 weights). The reference ran FP16 with the pinned PersonaPlex referenceenvironment.
Not Run / Remaining Gaps
against the reference FP16 baseline (5.58 dB). In that run the generated model audio tokens follow the reference FP32
run through all 197 steps. The remaining difference is under investigation in the temporal and depth paths. This PR
fixes one confirmed component boundary only.
for all codebooks. That form is equivalent to this head only when every depth engine's cache is Half; this has been
recorded for the first two depth engines, and recording all 16 is pending. The per-codebook form in this head was
validated by the CTest run above.
Contributor Self-Review
Notes For Future Readers
cache_k_0input, not from the temporal hidden dtype. The temporaloutput can be FP32 while the depth runs in Half.
Risk level
Medium: this changes FP16 depth numerics for every generated frame toward the reference semantics. FP32 builds are
unchanged.