Skip to content

fix DataLoaderDispatcher issue in Gaudi#600

Merged
regisss merged 2 commits into
mainfrom
dispather
Dec 18, 2023
Merged

fix DataLoaderDispatcher issue in Gaudi#600
regisss merged 2 commits into
mainfrom
dispather

Conversation

@sywangyi
Copy link
Copy Markdown
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 <yi.a.wang@intel.com>
@sywangyi sywangyi requested a review from regisss as a code owner December 15, 2023 05:43
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

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
Copy Markdown
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.

Comment thread optimum/habana/accelerate/data_loader.py Outdated
Comment thread optimum/habana/accelerate/data_loader.py Outdated
Comment thread optimum/habana/accelerate/data_loader.py Outdated
Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
Copy link
Copy Markdown
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
@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