[Train] Fix HF Trainer with DatasetIterator, handle device_map - #32955
Merged
Yard1 merged 9 commits intoMar 7, 2023
Conversation
Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
DatasetIteratorDatasetIterator, handle device_map
Yard1
marked this pull request as ready for review
March 7, 2023 01:05
bveeramani
approved these changes
Mar 7, 2023
7 tasks
Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
amogkam
reviewed
Mar 7, 2023
|
|
||
| try: | ||
| dataset_length = dataset.count() | ||
| dataset_length = dataset._base_dataset_or_pipeline.count() |
Contributor
There was a problem hiding this comment.
With datasets streaming by default, count() will trigger full execution of the dataset.
Is length required here, or can we go with the pipelined case as the default?
Member
Author
There was a problem hiding this comment.
Having the length would make for best UX. How about we discuss that in a followup?
Contributor
There was a problem hiding this comment.
ok can we not use private attributes from DatasetIterator?
Member
Author
There was a problem hiding this comment.
How can I obtain the count in that case? I don't want to have to make breaking changes in HuggingFaceTrainer in this PR.
Contributor
There was a problem hiding this comment.
ok that's fine, but let's make sure to follow up
amogkam
approved these changes
Mar 7, 2023
ProjectsByJackHe
pushed a commit
to ProjectsByJackHe/ray
that referenced
this pull request
Mar 21, 2023
…ay-project#32955) This PR switches to the DatasetIterator in Hugging Face Trainer code to avoid deprecation warnings and makes sure that the device_map argument in HuggingFacePredictor is handled properly. --------- Signed-off-by: Antoni Baum <antoni.baum@protonmail.com> Signed-off-by: Jack He <jackhe2345@gmail.com>
edoakes
pushed a commit
to edoakes/ray
that referenced
this pull request
Mar 22, 2023
…ay-project#32955) This PR switches to the DatasetIterator in Hugging Face Trainer code to avoid deprecation warnings and makes sure that the device_map argument in HuggingFacePredictor is handled properly. --------- Signed-off-by: Antoni Baum <antoni.baum@protonmail.com> Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
peytondmurray
pushed a commit
to peytondmurray/ray
that referenced
this pull request
Mar 22, 2023
…ay-project#32955) This PR switches to the DatasetIterator in Hugging Face Trainer code to avoid deprecation warnings and makes sure that the device_map argument in HuggingFacePredictor is handled properly. --------- Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
elliottower
pushed a commit
to elliottower/ray
that referenced
this pull request
Apr 22, 2023
…ay-project#32955) This PR switches to the DatasetIterator in Hugging Face Trainer code to avoid deprecation warnings and makes sure that the device_map argument in HuggingFacePredictor is handled properly. --------- Signed-off-by: Antoni Baum <antoni.baum@protonmail.com> Signed-off-by: elliottower <elliot@elliottower.com>
ProjectsByJackHe
pushed a commit
to ProjectsByJackHe/ray
that referenced
this pull request
May 4, 2023
…ay-project#32955) This PR switches to the DatasetIterator in Hugging Face Trainer code to avoid deprecation warnings and makes sure that the device_map argument in HuggingFacePredictor is handled properly. --------- Signed-off-by: Antoni Baum <antoni.baum@protonmail.com> Signed-off-by: Jack He <jackhe2345@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
This PR switches to the
DatasetIteratorin Hugging Face Trainer code to avoid deprecation warnings and makes sure that thedevice_mapargument inHuggingFacePredictoris handled properly.Related issue number
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.