feat: enable Hugging Face eval_loss on sharded datasets - #777
Open
DanielAsadi wants to merge 1 commit into
Open
DanielAsadi wants to merge 1 commit into
DanielAsadi wants to merge 1 commit into
Conversation
Gr00tN1d7 already returns a training loss, but DatasetFactory refused to build an eval set, the mixture iterator never terminated, Accelerate broadcast CPU objects through NCCL, and Trainer.prediction_step dropped the loss because the model has empty label_names. Split episodes, make eval iteration finite and rank-aligned, skip Accelerate dispatch, and return the forward loss so Hugging Face logs eval_loss.
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.
Summary
Hugging Face
eval_strategyis documented on GR00T, but the sharded dataset path cannot actually produceeval_loss:DatasetFactory.build()assertseval_strategy == "no"and always returnseval_dataset=None.Trainer.prediction_stepdrops the loss because Gr00tN1d7 has emptylabel_namesand noreturn_lossargument, so eval emitseval_runtimebut noeval_loss.This change keeps training behavior when
eval_strategyis"no". When it is not:world_size * num_workersDataLoader(same as train) and put the processor in eval modeprediction_stepTest plan
tests/gr00t/data/test_dataset_factory.pytests/gr00t/data/test_sharded_datasets.pytests/gr00t/experiment/test_trainer_eval_dataloader.pytests/gr00t/experiment/test_trainer_prediction_step_loss.pyeval_lossappeared in trainer state / logs, training resumed, checkpoint written