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

[train+data] Remove preprocessor argument from trainers #43146

Merged
merged 9 commits into from
Feb 14, 2024

Conversation

justinvyu
Copy link
Contributor

Why are these changes needed?

This PR removes the hard-deprecated preprocessor argument fully. This is a follow-up to #38640.

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Justin Yu <[email protected]>
Comment on lines +674 to 680
# Evaluate datasets if they are wrapped in a factory.
trainer.datasets = {
k: d() if callable(d) else d for k, d in self.datasets.items()
}

trainer.setup()
trainer.preprocess_datasets()
trainer.training_loop()
Copy link
Contributor Author

@justinvyu justinvyu Feb 13, 2024

Choose a reason for hiding this comment

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

preprocess_datasets used to do this "evaluation" of the dataset factory function, plus any dataset preprocessing from Trainer.preprocessor. This interface is not needed so I removed it, and brought the evaluation logic out.

Copy link
Contributor

@matthewdeng matthewdeng left a comment

Choose a reason for hiding this comment

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

love cleaning up code 👌

python/ray/train/lightgbm/lightgbm_trainer.py Outdated Show resolved Hide resolved
Copy link
Member

@bveeramani bveeramani left a comment

Choose a reason for hiding this comment

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

LGTM

@justinvyu justinvyu merged commit a79f18d into ray-project:master Feb 14, 2024
9 checks passed
@justinvyu justinvyu deleted the remove_preprocessor branch February 14, 2024 22:22
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.

5 participants