Skip to content

Add TDT loss kernel#46048

Draft
ebezzam wants to merge 82 commits into
huggingface:mainfrom
ebezzam:tdt_loss_kernel
Draft

Add TDT loss kernel#46048
ebezzam wants to merge 82 commits into
huggingface:mainfrom
ebezzam:tdt_loss_kernel

Conversation

@ebezzam
Copy link
Copy Markdown
Contributor

@ebezzam ebezzam commented May 19, 2026

What does this PR do?

Add a kernel for faster TDT loss computation (and thus faster training).

Corresponding PR in kernels-community: huggingface/kernels-community#882

cc @eustlb

Hainan Xu and others added 30 commits February 20, 2026 09:45
Implement Token-and-Duration Transducer (TDT) decoding for Parakeet models,
extending the existing CTC-only support. This adds ParakeetForTDT with greedy
TDT decoding in generate(), per-token timestamp generation, and full
integration with AutoModelForTDT, processors, and ASR pipeline.
- Use -100 label padding for training (HF convention)
- Fix timestamp recording in inner blank-seeking loop
- Add max_symbols_per_step guard matching NeMo
- Clean up decoding loop
- Add TDT training example to docs
- Use setUpClass for TDT integration tests
@ebezzam ebezzam marked this pull request as draft May 19, 2026 02:33
@github-actions
Copy link
Copy Markdown
Contributor

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

run-slow: parakeet

"finegrained-fp8": {"repo_id": "kernels-community/finegrained-fp8", "version": 1},
"deep-gemm": {"repo_id": "kernels-community/deep-gemm", "version": 1},
"sonic-moe": {"repo_id": "kernels-community/sonic-moe", "revision": "ep-support"},
"tdt-loss": {"repo_id": "eustlb/tdt-loss", "revision": "v1"},
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +736 to 738
Verify that ParakeetForTDT loss matches NeMo's TDT loss (sigma=0) for both
the CUDA kernel and the pure PyTorch implementation.
reproducer: https://gist.github.com/883ea42bf7d8ce2af42f3055627476a7
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should we also test for sigma != 0?

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

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.

4 participants