Skip to content

[Fix]Pad the last rank if vocab size is not divisible by tp_size - #100

Open
cswuyg wants to merge 5 commits into
sgl-project:mainfrom
cswuyg:feature/cswuyg_vocab_padding
Open

[Fix]Pad the last rank if vocab size is not divisible by tp_size#100
cswuyg wants to merge 5 commits into
sgl-project:mainfrom
cswuyg:feature/cswuyg_vocab_padding

Conversation

@cswuyg

@cswuyg cswuyg commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Pad vocabulary size to a multiple of TP size to ensure shape alignment and avoid assertion errors when assigning self.weight on each TP rank.

@cswuyg cswuyg closed this Mar 15, 2026
@cswuyg cswuyg reopened this Mar 15, 2026
@DarkSharpness

Copy link
Copy Markdown
Collaborator

Hi @cswuyg . I wonder there's some real world use case for this PR. It seems that we have not encountered such an issue so far. In addition, we use the vocab_size in many other places (e.g. model implementation, cuda graph), so we should ensure the correctness in the use place. Could you please check that again?

@DarkSharpness DarkSharpness added the bugfix Fixes incorrect behavior, runtime errors, or regressions. label May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes incorrect behavior, runtime errors, or regressions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants