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

Add errors for Mixed Dataloader Eval #2269

Merged
merged 11 commits into from
Jun 7, 2023

Conversation

rishab-partha
Copy link
Contributor

@rishab-partha rishab-partha commented Jun 1, 2023

What does this PR do?

Now, if a user passes in a list of some DataLoaders/DataSpecs and Evaluators to the Trainer class, it no longer tries to apply all metrics to the DataLoaders/DataSpecs, causing a crash. Instead, it raises a ValueError and instructs the user to wrap the DataLoaders in an Evaluator beforehand to prevent unexpected behavior.

What issue(s) does this change relate to?

CO-1763

Before submitting

  • Have you read the contributor guidelines?
  • Is this change a documentation change or typo fix? If so, skip the rest of this checklist.
  • Was this change discussed/approved in a GitHub issue first? It is much more likely to be merged if so.
  • Did you update any related docs and document your change?
  • Did you update any related tests and add any new tests related to your change? (see testing)
  • Did you run the tests locally to make sure they pass?
  • Did you run pre-commit on your change? (see the pre-commit section of prerequisites)

Copy link
Contributor

@mvpatel2000 mvpatel2000 left a comment

Choose a reason for hiding this comment

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

This looks great! Mostly minor cleanup comments. Can you please also add a unit test verifying this behavior?

Also, does eval() need the same logic added to init and fit?

composer/trainer/trainer.py Outdated Show resolved Hide resolved
composer/trainer/trainer.py Outdated Show resolved Hide resolved
composer/trainer/trainer.py Outdated Show resolved Hide resolved
composer/trainer/trainer.py Outdated Show resolved Hide resolved
composer/trainer/trainer.py Outdated Show resolved Hide resolved
composer/trainer/trainer.py Outdated Show resolved Hide resolved
composer/trainer/trainer.py Outdated Show resolved Hide resolved
@rishab-partha
Copy link
Contributor Author

fixed all above

Copy link
Contributor

@mvpatel2000 mvpatel2000 left a comment

Choose a reason for hiding this comment

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

LGTM! Will wait for review from @dakinggg as well though before approval

composer/trainer/trainer.py Outdated Show resolved Hide resolved
composer/trainer/trainer.py Outdated Show resolved Hide resolved
composer/trainer/trainer.py Outdated Show resolved Hide resolved
Copy link
Contributor

@dakinggg dakinggg left a comment

Choose a reason for hiding this comment

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

lgtm, a couple nits

composer/callbacks/mlperf.py Outdated Show resolved Hide resolved
composer/trainer/trainer.py Show resolved Hide resolved
composer/trainer/trainer.py Show resolved Hide resolved
@rishab-partha
Copy link
Contributor Author

fixed nits!

composer/trainer/trainer.py Show resolved Hide resolved
composer/trainer/trainer.py Show resolved Hide resolved
@rishab-partha rishab-partha merged commit 15ac5c6 into mosaicml:dev Jun 7, 2023
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