Skip to content

Clarify per_device_train_batch_size scaling in TrainingArguments (#38… #38857

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

Merged

Conversation

Shohail-Ismail
Copy link
Contributor

What does this PR do?

This PR clarifies in the TrainingArguments docstring that per_device_train_batch_size
is multiplied by the number of devices when training on multiple GPUs or with distributed training.

Closes #38484

Before submitting

  • This PR fixes a typo or improves the docs

Who can review?

Copy link
Member

@SunMarc SunMarc left a comment

Choose a reason for hiding this comment

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

thanks ! there is a lot of changes that are not required here, can you clean the pr ?

@qgallouedec
Copy link
Member

Usually we call it the global batch size

@Shohail-Ismail Shohail-Ismail force-pushed the fix-per-device-batchsize-doc branch 2 times, most recently from 4e383cc to d085301 Compare June 17, 2025 16:45
@Shohail-Ismail Shohail-Ismail force-pushed the fix-per-device-batchsize-doc branch from d085301 to 3570b79 Compare June 17, 2025 16:50
@Shohail-Ismail
Copy link
Contributor Author

Ready for final review and merge. Thanks!

@Shohail-Ismail Shohail-Ismail requested a review from SunMarc July 2, 2025 12:36
Copy link
Member

@SunMarc SunMarc left a comment

Choose a reason for hiding this comment

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

Thx !

@SunMarc SunMarc enabled auto-merge (squash) July 7, 2025 16:45
@SunMarc SunMarc merged commit b96f213 into huggingface:main Jul 7, 2025
10 checks passed
@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.

@Shohail-Ismail Shohail-Ismail deleted the fix-per-device-batchsize-doc branch July 8, 2025 00:23
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.

Clarification on per_device_train_batch_size in Trainer
4 participants