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 DataLoaderDispatcher issue in Gaudi #600

Merged
merged 2 commits into from
Dec 18, 2023
Merged

fix DataLoaderDispatcher issue in Gaudi #600

merged 2 commits into from
Dec 18, 2023

Conversation

sywangyi
Copy link
Collaborator

TRL SFT trainer has used IterableDataset and DataLoaderDispatcher will be called. The data shape/tensor will be broadcasted from rank 0 to other rank in DDP.

What does this PR do?

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

TRL SFT trainer has used IterableDataset and DataLoaderDispatcher will be called.
The data shape/tensor will be broadcasted from rank 0 to other rank in DDP.

Signed-off-by: Wang, Yi A <[email protected]>
@sywangyi sywangyi requested a review from regisss as a code owner December 15, 2023 05:43
@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.

@sywangyi
Copy link
Collaborator Author

Traceback (most recent call last):
File "/intel-extension-for-transformers/optimum-habana/examples/trl_example/stack_llama_2/sft_llama2.py", line 184, in
trainer.train()
File "/usr/local/lib/python3.10/dist-packages/trl/trainer/sft_trainer.py", line 281, in train
output = super().train(*args, **kwargs)
File "/intel-extension-for-transformers/optimum-habana/optimum/habana/transformers/trainer.py", line 486, in train
return inner_training_loop(
File "/intel-extension-for-transformers/optimum-habana/optimum/habana/transformers/trainer.py", line 807, in _inner_training_loop
for step, inputs in enumerate(epoch_iterator):
File "/usr/local/lib/python3.10/dist-packages/accelerate/data_loader.py", line 664, in iter
raise ValueError(
ValueError: Batch does not contain any data (None). At the end of all iterable data available before expected stop iteration.
Traceback (most recent call last):
File "/intel-extension-for-transformers/optimum-habana/examples/trl_example/stack_llama_2/sft_llama2.py", line 184, in
trainer.train()
File "/usr/local/lib/python3.10/dist-packages/trl/trainer/sft_trainer.py", line 281, in train
output = super().train(*args, **kwargs)
File "/intel-extension-for-transformers/optimum-habana/optimum/habana/transformers/trainer.py", line 486, in train
return inner_training_loop(
File "/intel-extension-for-transformers/optimum-habana/optimum/habana/transformers/trainer.py", line 807, in _inner_training_loop
for step, inputs in enumerate(epoch_iterator):
File "/usr/local/lib/python3.10/dist-packages/accelerate/data_loader.py", line 664, in iter
raise ValueError(
ValueError: Batch does not contain any data (None). At the end of all iterable data available before expected stop iteration.

optimum/habana/accelerate/data_loader.py Outdated Show resolved Hide resolved
optimum/habana/accelerate/data_loader.py Outdated Show resolved Hide resolved
optimum/habana/accelerate/data_loader.py Outdated Show resolved Hide resolved
Signed-off-by: Wang, Yi A <[email protected]>
Copy link
Collaborator

@regisss regisss left a comment

Choose a reason for hiding this comment

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

LGTM

@regisss regisss merged commit ec46765 into main Dec 18, 2023
9 checks passed
@regisss regisss deleted the dispather branch December 18, 2023 08:47
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.

3 participants