-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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 the behavior of collecting 'num_input_tokens_seen' #29099
Fix the behavior of collecting 'num_input_tokens_seen' #29099
Conversation
See huggingface#28791 for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Overall this looks good to me, can you rebase from main to ensure that tests pass?
Just got it rebased from the main. However something still went wrong in the test, and it seems irrevelant to my PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, it's been three weeks the unrelated tests are fixed, sorry to ask you to rebase one more time!
Done, and it has passed all the tests. |
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. |
thanks for this fix |
…9099) fix the behavior of collecting 'num_input_tokens_seen' See huggingface#28791 for more details.
fix the behavior of collecting 'num_input_tokens_seen' See #28791 for more details.
What does this PR do?
The length of "inputs[main_input_name]" is not guaranteed to be the same when using DDP, which may make the training process hang. Besides, in a distributed setup, it costs a lot to gather the WHOLE input tensors on different workers. It is better to call .numel() first and then .gather().
Fixes #28791
The modified code has already passed the relevant test
tests/trainer/test_trainer_distributed.py
with additional argument 'include_num_input_tokens_seen'.Who can review?
@pacman100
@muellerzr