Skip to content

Update vocab_size for debugmodel_moe of qwen3 moe#1864

Closed
wmhst7 wants to merge 1 commit intopytorch:mainfrom
wmhst7:patch-1
Closed

Update vocab_size for debugmodel_moe of qwen3 moe#1864
wmhst7 wants to merge 1 commit intopytorch:mainfrom
wmhst7:patch-1

Conversation

@wmhst7
Copy link
Contributor

@wmhst7 wmhst7 commented Oct 13, 2025

Setting vocab_size to 2048 without updating the tokenizer accordingly will cause a CUDA illegal memory access error. Maybe it's better to keep the model's vocab_size consistent with other model sizes.

Setting vocab_size to 2048 without updating the tokenizer accordingly will cause a CUDA illegal memory access error. Maybe it's better to keep the model's vocab_size consistent with other model sizes.
@meta-cla
Copy link

meta-cla bot commented Oct 13, 2025

Hi @wmhst7!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

),
# Qwen3-MoE models
"debugmodel_moe": Qwen3ModelArgs(
vocab_size=2048,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we are using the test tokenizer in the toml, which has less than 2048 tokens, so it should be fine?
https://github.com/pytorch/torchtitan/blob/main/torchtitan/models/qwen3/train_configs/qwen3_moe_debug.toml#L18

# Qwen3-MoE models
"debugmodel_moe": Qwen3ModelArgs(
vocab_size=2048,
vocab_size=151936,
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for pointing out! I set this to smaller size because we need to make the debugmodel_moe to fit in to github CI. I checked the toml file, and the tokenizer is less than 2048 tokens. Can you also attach the command how to reproduce the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, if this is for the CI run, that's reasonable. I have no issues on my end. I'll go ahead and close this PR for now.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 14, 2025
@meta-cla
Copy link

meta-cla bot commented Oct 14, 2025

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@wmhst7 wmhst7 closed this Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants