Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix block_size picking in megatron_lm_gpt_pretraining example. #2342

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

nilq
Copy link
Contributor

@nilq nilq commented Jan 16, 2024

What does this PR do?

If no block_size is explicitly passed, and the tokenizer happens to have a model_max_length of less than 1024, the current example will produce a bad block_size. With this change, we only cap block_size to 1024 if tokenizer.model_max_length is actually greater than 1024.

Who can review?

Tagging @pacman100 / @sgugger as the authors of the surrounding code.

Only cap `block_size` to 1024 if `tokenizer.model_max_length` is actually greater than 1024.
Copy link
Contributor

@pacman100 pacman100 left a comment

Choose a reason for hiding this comment

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

Thank you @nilq for the fix, LGTM!

@HuggingFaceDocBuilderDev

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.

Copy link
Collaborator

@muellerzr muellerzr left a comment

Choose a reason for hiding this comment

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

Thanks!

@muellerzr muellerzr merged commit 14d7c3f into huggingface:main Jan 18, 2024
23 checks passed
statelesshz pushed a commit to statelesshz/accelerate that referenced this pull request Jan 22, 2024
…ce#2342)

Only cap `block_size` to 1024 if `tokenizer.model_max_length` is actually greater than 1024.
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.

None yet

4 participants