Skip to content

Fix NaN in Parakeet eager attention with padded batches - #49070

Merged
ArthurZucker merged 3 commits into
mainfrom
parakeet-eager-nan
Sep 24, 2026
Merged

ArthurZucker merged 3 commits into
mainfrom
parakeet-eager-nan

Conversation

@ArthurZucker

@ArthurZucker ArthurZucker commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

CPU CI GPU run-slow

A fully padded query attends to nothing, so -inf softmaxes to NaN. Use the dtype minimum instead.

A fully padded query attends to nothing, so `-inf` softmaxes to NaN. Use the dtype minimum instead.
@ArthurZucker ArthurZucker mentioned this pull request Sep 24, 2026
6 tasks
@github-actions

Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: parakeet

@github-actions

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 35962589275:1
Result: success | Jobs: 3 | Tests: 1,773 | Failures: 0 | Duration: 12m 43s

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@vasqu vasqu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check with run slow just to be sure but yea definitely better than using -inf directly

@ArthurZucker
ArthurZucker added this pull request to the merge queue Sep 24, 2026
Merged via the queue into main with commit 93b45aa Sep 24, 2026
43 checks passed
@ArthurZucker
ArthurZucker deleted the parakeet-eager-nan branch September 24, 2026 12:43
ShaiShmuel added a commit to superlinked/sie that referenced this pull request Oct 7, 2026
…ot the bundle

Restore the transformers5 bundle's transformers floor to >=5.14,<6 so the
other models on the bundle keep their range, and check the version in
ParakeetTDTAdapter.load() instead.

transformers 5.14 through 5.17 mask padded encoder frames with -inf. Under
eager attention a fully padded query softmaxes to NaN, and the next layer
spreads it to every frame of that row, so the shorter rows of a padded
batch decode to junk (huggingface/transformers#49070, released in 5.18).
The adapter's default SDPA attention stayed finite on the CPU backends
checked, but PyTorch picks the backend per device, so load() refuses
transformers older than 5.18 before loading any weights.

The bundle test now checks that the bundle's range admits the adapter's
minimum instead of matching the range string.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ShaiShmuel added a commit to superlinked/sie that referenced this pull request Oct 7, 2026
…6b-v3) (#608)

Serve nvidia/parakeet-tdt-0.6b-v3 on the transformers5 bundle through the
same audio extract path and output contract as Whisper.

- Decode with a batched greedy TDT loop instead of generate(), whose TDT
  path has no per-frame symbol limit and can repeat a token until the
  output buffer fills.
- Re-decode rows that come back empty (up to 30 s) on their own with
  0.25 s of silence appended, then on both sides; the batched pass is
  never padded.
- Group rows by length so a forward pass never holds more than 12
  minutes of padded audio.
- Word and segment timestamps from the token durations.
- Accept a language option only inside the model's 25 languages (it has
  no effect; the model identifies the language itself), reject a prompt
  and a non-zero temperature.

The transformers5 bundle adds librosa, which the feature extractor
requires, and keeps its transformers range at >=5.14,<6. The adapter
refuses transformers older than 5.18 at load: 5.14 through 5.17 mask
padded encoder frames with -inf, which turns a padded row into NaN under
eager attention (huggingface/transformers#49070).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.

3 participants