Skip to content

fix(paraformer): handle trailing zero-fire samples in mixed CIF batches - #3854

Merged
LauraGPT merged 1 commit into
modelscope:mainfrom
BillVan1945:fix/cif-mixed-zero-fires
Nov 7, 2026
Merged

LauraGPT merged 1 commit into
modelscope:mainfrom
BillVan1945:fix/cif-mixed-zero-fires

Conversation

@BillVan1945

Copy link
Copy Markdown
Contributor

Summary

cif_v1 and cif_v1_export assume each sample has at least one CIF firing during frame processing. If a sample produces no firings while an earlier sample in the batch does, the code can access an invalid index and crash. Very short audio segments can trigger this case.

The guard added in #3028 handles batches where no sample fires. This fix covers mixed batches by skipping zero-fire samples when resetting frame boundaries.

Type of change

  • Bug fix

Validation

python -m pytest -q tests/test_cif_mixed_zero_fires.py
  • Before: 45 subcase errors. After: 6 tests and 98 subtests pass, including isolated CIF ONNX export and ONNX Runtime checks, with no skips.
  • Real audio: short, nonempty segments produce CIF counts [1, 0]. With a fixed seed, three independent GPU runs per version fail before the fix and pass afterward.
  • An additional 200 normal-input comparisons retain bitwise-identical CIF outputs.
  • python -m compileall funasr examples tests and git diff --check pass.

User impact

Mixed batches containing trailing zero-fire samples complete CIF aggregation instead of crashing.

LauraGPT added a commit that referenced this pull request Nov 7, 2026
Preserve the original PR #3854 commit. Synchronize retained main content to the exact reviewed integration tree and add fail-closed CPU/ONNX regression CI. No history rewrite, pretrained download, or protection bypass.

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 39e7511 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