Skip to content

fix(personaplex): keep RMSNorm epsilon in FP32 - #1780

Closed
chaofengw-nv wants to merge 1 commit into
NVIDIA:mainfrom
chaofengw-nv:fix/personaplex-fp32-rmsnorm-epsilon-20261017
Closed

chaofengw-nv wants to merge 1 commit into
NVIDIA:mainfrom
chaofengw-nv:fix/personaplex-fp32-rmsnorm-epsilon-20261017

Conversation

@chaofengw-nv

Copy link
Copy Markdown
Collaborator

Background

Fixes #1779. FP16 PersonaPlex decoder builds round RMSNorm's 1e-8 epsilon to zero before promoting it to FP32. Zero inputs then produce NaNs; a small-input regression differs from Native by 0.29296875.

Exit Criteria

  • Preserve the epsilon used by Native rms_norm_f32 through constant creation and variance addition.
  • Keep zero inputs finite and match Native normalization for small and ordinary FP16 inputs, with identical assertions and tolerance for the original and fixed controls.

Implementation

Store the epsilon constant in FP32 in the standard and tensor-parallel builders. The family's dual-profile builder already does this. Model checkpoints, requests, gates, references and runtime source remain unchanged.

Add a one-layer standard-decoder regression. Identity value/output projections and one unmasked attention key expose normalization through the existing post-attention debug output. The expected value uses the independent Native FP32-normalization equation followed by FP16 output/residual rounding.

Change categories

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

Validation

Commands and Results

  • GB300: PYTHONPATH=core/builder:apps/benchmark:. python -m pytest -c pyproject.toml -q -rA -p no:cacheprovider families/personaplex/tests/test_fp16_decoder_norm_epsilon.py: 3 passed for zero, 1e-4, and 0.1 inputs.
  • Original-builder negative control, using the identical test and atol=5e-4: 2 failed, 1 passed. Zero input produces NaNs; all 64 small-input elements differ by 0.29296875. Ordinary input passes.
  • These commands used isolated original/fixed family copies. Import-path guards verified the loaded builders, and their hashes matched the corresponding source files; the test file was identical in both runs.
  • CPU equation control: epsilon 1e-8 gives 0.70703125 for a constant 1e-4 FP16 input; FP16-stored epsilon is zero and gives 1.0.
  • ruff check --config ruff.toml on the three changed files, python -m tools.model_ci validate, python tools/test_impact.py --validate, and git diff --check: passed.

Hardware, Environment, and Revisions

  • NVIDIA GB300, ARM64, CUDA 13.0, TensorRT 11.2.0.113, PyTorch 2.12.0+cu130.
  • Head 39486fac00d8b435955c7be04b9b48445d92a678; base 9643800b3b5a951382c87ae1ebfbbeb24b1a8090. The tested fixed production files and test are byte-identical to this head.
  • Native contract: the pinned PersonaPlex source's rms_norm_f32 uses FP32 variance with epsilon 1e-8.

Not Run / Remaining Gaps

Full PersonaPlex audio-parity acceptance for this epsilon change, multi-GPU tensor-parallel execution, other platforms, and protected exact-head premerge have not been qualified. The component result does not establish that this alone resolves the remaining audio-parity failure.

Contributor Self-Review

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

Reviewed the three-file diff, family ownership, FP32 constant propagation, independent reference, fixed tolerance, original-source negative control, DCO and validation limits.

Notes For Future Readers

  • Rebuild engines to apply the corrected constant. Bundle interfaces and runtime loading are unchanged.
  • The FP32 promotion must happen before storing the epsilon; casting an already rounded zero cannot recover it.
  • Other PersonaPlex pipeline work is tracked in fix(personaplex): align FP16 inference with Native #1751. Its full-model validation is separate from this numerical regression.

Risk level

  • Low
  • Medium
  • High

The change preserves one family-owned scalar in its intended computation dtype. Existing FP32 builds already use this value.

The FP16 standard and tensor-parallel builders rounded 1e-8 to zero before
RMSNorm promoted the scalar to FP32. Preserve the epsilon in FP32, matching
Native rms_norm_f32 and the family's existing dual-profile path.

Add a one-layer decoder regression for zero, small and ordinary inputs.
Identity value/output projections expose normalization through the existing
post-attention debug output without replacing the production builder.

Fixes NVIDIA#1779

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
Create RMSNorm epsilon in FP32 so the 1e-8 value survives Half network construction.

Closes NVIDIA#1779
Refs NVIDIA#1780

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 bf45b2e 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
Create RMSNorm epsilon in FP32 so the 1e-8 value survives Half network construction.

Closes NVIDIA#1779
Refs NVIDIA#1780

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 loses RMSNorm epsilon in FP16 decoder builds

1 participant