Skip to content

fix(personaplex): preserve Half embedding additions - #1781

Closed
chaofengw-nv wants to merge 1 commit into
NVIDIA:mainfrom
chaofengw-nv:fix/personaplex-half-input-embeddings-20261017
Closed

chaofengw-nv wants to merge 1 commit into
NVIDIA:mainfrom
chaofengw-nv:fix/personaplex-half-input-embeddings-20261017

Conversation

@chaofengw-nv

Copy link
Copy Markdown
Collaborator

Background

Fixes #1778. Native FP16 PersonaPlex adds audio codebook embeddings in order, then text, rounding each addition to Half. The runtime instead adds text first in FP32 and casts only the final sum. Identical token histories therefore produce different temporal inputs before any transformer computation.

Exit Criteria

  • Preserve Native Half rounding and audio-before-text order for FP16 temporal engines, including text-prompt frames.
  • Keep the existing FP32 path and bundle interface unchanged; retain all audio-parity gates.

Implementation

Select Half summation from the temporal engine's base cache dtype. Per-layer FP32 promotion retains this base cache contract. Use CUDA's host-only round-to-nearest-even Half conversions for each embedding value and addition; no GPU kernel or CUDA-runtime call is introduced. Both dual-stream and text-prompt frames use the same family-owned helper. Add the CUDA header include path only to the affected CPU test target.

Change categories

  • Model or runtime behavior
  • Public API
  • ABI
  • Bundle or artifact format
  • Dependencies
  • Documentation only
  • CI or developer tooling

Validation

Commands and Results

  • CPU, with CUDA_VISIBLE_DEVICES empty: compile families/personaplex/tests/cpp/test_speech_temporal_embed_plan.cpp using g++ -std=c++17 -Wall -Wextra -Wpedantic -I. -isystem /usr/local/cuda/include, then execute the resulting binary: passed without linking cudart or executing GPU work. Covers Half ties/subnormals/overflow, rounding after every addition, audio-before-text cancellation, the preserved FP32 sum, and existing embedding/logit cases.
  • CPU product control: sequential Half additions of [1, 0.000400066375732421875, -1] return zero after this change; the original FP32-sum path returns 0.000400066375732421875 before its final cast, reproducing the defect.
  • GB300 component capture in the diagnosis pipeline: originally 1737/4096 effective Half input elements differ at step 0. With this helper, Native and TRTMC inputs are bit-identical at steps 0 through 28. A generated token still diverges at step 28 and whole-clip audio parity still fails (5.58 dB against a 3 dB limit). This is input-boundary evidence, not full-model acceptance.
  • python -m tools.model_ci validate, python -m tools.test_impact --base github/main --validate, git diff --check, and clang-format 22 on changed C++ files: passed.

Hardware, Environment, and Revisions

  • Head a8b1160451353a47a66883eae832d8ed4e05dc87; base 9643800b3b5a951382c87ae1ebfbbeb24b1a8090.
  • CPU regression: x86-64 with CUDA 13 headers, GPU access disabled.
  • Component capture: NVIDIA GB300, ARM64, CUDA 13, TensorRT 11.2.0.113; checkpoint nvidia/personaplex-7b-v1 at revision fdaf4090. The summation helper and C++ regression are byte-identical to the ones used in the diagnosis pipeline. The focused PR uses the first base-cache dtype instead of checking every identically typed base cache.

Not Run / Remaining Gaps

This PR alone has not passed full audio-parity acceptance, multi-GPU execution, or protected exact-head premerge. The capture pipeline includes separate resampler/Mimi fixes and does not qualify this entire PR head as an end-to-end pass. Remaining temporal/depth differences are being investigated without changing quality gates.

Contributor Self-Review

  • I have completed a self-review of this change.

Reviewed the six-file family-local diff, prompt and ordinary-frame call sites, base-cache dtype contract, host-only Half conversions, unchanged FP32 path, test assertions, DCO, and the distinction between component proof and audio acceptance.

Notes For Future Readers

Risk level

  • Low
  • Medium
  • High

Every FP16 temporal input now follows Native's arithmetic boundaries. Token trajectories can change even though token IDs and checkpoint weights are unchanged.

Sum audio embeddings before text and round every FP16 addition as the Native temporal input does. Keep the existing FP32 path and infer the temporal base dtype from the engine cache contract.

Add host-only rounding and summation regressions. This fixes an input defect; complete audio parity still requires separate validation.

Refs: NVIDIA#1778
Signed-off-by: chaofengw <chaofengw@nvidia.com>
@chaofengw-nv chaofengw-nv self-assigned this Oct 17, 2026
@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

chaofengw-nv added a commit to chaofengw-nv/TensorRT-Model-Connect-fork that referenced this pull request Oct 20, 2026
Sum audio embeddings before text and round each addition to Half for Half temporal engines.

Closes NVIDIA#1778
Refs NVIDIA#1781

Signed-off-by: chaofengw <chaofengw@nvidia.com>
@chaofengw-nv

Copy link
Copy Markdown
Collaborator Author

Superseded by #1751. This change and its regression coverage are preserved in commit acca115 of the consolidated PR. Original issue links and acceptance criteria remain tracked there.

chaofengw-nv added a commit to chaofengw-nv/TensorRT-Model-Connect-fork that referenced this pull request Oct 21, 2026
Sum audio embeddings before text and round each addition to Half for Half temporal engines.

Closes NVIDIA#1778
Refs NVIDIA#1781

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>
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.

[Accuracy] PersonaPlex sums FP16 temporal embeddings in FP32

1 participant