[Bugfix] Fix DeepSeek V4 Pro TP24 vocabulary-padding failure on Hopper (#31801)

Co-authored-by: Po-Han Huang (NVIDIA) <53919306+nvpohanh@users.noreply.github.com>
Co-authored-by: Po-Han Huang <pohanh@nvidia.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Michael Gschwind
2026-10-01 11:11:18 -07:00
committed by GitHub
co-authored by Po-Han Huang Po-Han Huang Claude Opus 5.5
parent a0fcebb3bb
commit 3f4bfda13c
2 changed files with 3 additions and 5 deletions
@@ -264,10 +264,7 @@ class VocabParallelEmbedding(torch.nn.Module):
self.org_vocab_size = org_num_embeddings or num_embeddings
# Support the case where the vocab size is not divisible by the TP size.
if (
_is_cpu
and pad_vocab_size(self.org_vocab_size, padding_size) % self.tp_size != 0
):
if pad_vocab_size(self.org_vocab_size, padding_size) % self.tp_size != 0:
padding_size *= self.tp_size
self.padding_size = padding_size