Repository navigation
[VibeVoice] Avoid GPU syncs when removing audio padding - #50417
Merged
hmellor merged 3 commits intoNov 6, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
|
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. |
6 tasks done
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: vibevoice, vibevoice_asr |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Contributor
|
run-slow: vibevoice, vibevoice_asr |
ebezzam
approved these changes
Nov 6, 2026
| # adjust padding mask according to tokenizer compression | ||
| num_audio_tokens = torch.ceil(padding_mask.sum(dim=-1) / self.config.audio_config.hop_length).to(torch.int64) | ||
| padding_mask = torch.arange(num_audio_tokens.max(), device=num_audio_tokens.device) < num_audio_tokens[:, None] | ||
| positions = torch.arange(acoustic_features.shape[1], device=num_audio_tokens.device) |
Contributor
There was a problem hiding this comment.
nice that you use acoustic_features.shape[1] instead of num_audio_tokens.max(). This is actually more robust, in case padding is longer than longest samples (but not expected with default padding)
| padding_mask = torch.arange(num_audio_tokens.max(), device=combined_features.device) < num_audio_tokens[ | ||
| :, None | ||
| ].to(combined_features.device) | ||
| positions = torch.arange(combined_features.shape[1], device=num_audio_tokens.device) |
Contributor
Merged
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Removes the avoidable GPU syncs from
get_audio_featuresin VibeVoice-ASR and VibeVoice, which vLLM calls on its main execution thread (vllm-project/vllm#65735, which replaces vllm-project/vllm#62398).torch.arangeuses the feature length rather thannum_audio_tokens.max(), which read a value back from the GPU. Both are the same length, since the mask already had to match the features.padding_mask's device and is moved to the CPU to index. A caller holding the mask on the CPU then has no sync. A mask on the GPU behaves as before, as boolean indexing already had to read it back.With vLLM's
VLLM_GPU_SYNC_CHECK=errorandpadding_maskkept on the CPU, 32 VibeVoice-ASR LibriSpeech requests fail without this PR and pass with it (WER 2.54%). VibeVoice has the same change but was not run through vLLM.Tests:
tests/models/vibevoiceandtests/models/vibevoice_asrwithRUN_SLOW=1on a B200, 344 passed, 276 skipped.AI assistance (Claude Code) was used for this PR.
@eustlb @ebezzam
🤖 Generated with Claude Code