Skip to content

fix(normalize): correct UtteranceMVN variance normalization - #3853

Merged
LauraGPT merged 1 commit into
modelscope:mainfrom
BillVan1945:fix/utterance-mvn-variance
Nov 7, 2026
Merged

LauraGPT merged 1 commit into
modelscope:mainfrom
BillVan1945:fix/utterance-mvn-variance

Conversation

@BillVan1945

Copy link
Copy Markdown
Contributor

Summary

With both mean and variance normalization enabled, UtteranceMVN includes mean-shifted padding in its variance and divides by std.sqrt() instead of std. The same recording therefore produces different valid features depending on batch padding, and its normalized variance is not generally one.

Mask padding after centering and divide by the standard deviation once.

Type of change

  • Bug fix
  • Documentation
  • Example or demo
  • Runtime or deployment
  • Benchmark or evaluation
  • Model/training change

Validation

OMP_NUM_THREADS=1 python -m pytest -q tests/test_utterance_mvn.py
  • New regressions: 20 failed, 35 passed on efe5504e; 55 passed with the fix. Including adjacent frontend tests on the candidate integrated with efe5504e: 97 passed on CPU/CUDA (RTX 5080, PyTorch 2.10.0+cu128).

  • Real repository audio through a randomly initialized Transformer: single-vs-mixed-batch feature differences drop from 2.44 to 7.15e-7, and variance returns to approximately 1.

  • python -m compileall funasr examples tests

  • Docs or links checked

  • Runtime/deployment command tested

User impact

Recordings using mean-and-variance normalization now produce consistent valid features across batch lengths. The affected branch requires both options enabled; norm_vars defaults to false.

Notes for reviewers

Checkpoints trained with both options enabled will receive different normalized features after this fix and should be reevaluated for recognition quality.

Related padding fix: ESPnet #6571.

LauraGPT added a commit that referenced this pull request Nov 7, 2026
Preserve the original PR #3853 commit. Synchronize retained main content to the exact tested integration tree without rewriting history. Use IEEE FP32 only inside audio integration tests, restore backend settings, and keep all assertions and tolerances unchanged. Add the regression file to the existing NumPy matrix.

Signed-off-by: LauraGPT <zhifu.gzf@alibaba-inc.com>
LauraGPT added a commit that referenced this pull request Nov 7, 2026
Preserve the original contributor commit and add maintained regression coverage. No administrator bypass.

Signed-off-by: LauraGPT <zhifu.gzf@alibaba-inc.com>
@LauraGPT
LauraGPT merged commit 290c133 into modelscope:main Nov 7, 2026
LauraGPT added a commit that referenced this pull request Nov 8, 2026
Deliver empty-symbol tokenizer, padded variance normalization and mixed zero-fire CIF fixes (#3852, #3853, #3854). Checkpoints trained with mean and variance normalization need recognition-quality reevaluation.

Signed-off-by: LauraGPT <zhifu.gzf@alibaba-inc.com>
@LauraGPT LauraGPT mentioned this pull request Nov 8, 2026
LauraGPT added a commit that referenced this pull request Nov 8, 2026
Deliver tested empty-symbol tokenizer, padded variance normalization and mixed zero-fire CIF fixes (#3852, #3853, #3854), with the variance-normalized checkpoint compatibility warning.

Signed-off-by: LauraGPT <zhifu.gzf@alibaba-inc.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.

2 participants