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

[tune] populate internal configs when creating Trainable through DistributedTrainableCreator #16128

Merged
merged 7 commits into from
Jun 1, 2021

Conversation

matthewdeng
Copy link
Contributor

@matthewdeng matthewdeng commented May 28, 2021

Why are these changes needed?

DistributedTrainableCreator creates a wrapper Trainable which is used to create an ImplicitFunc. The ImplicitFunc should be created with the same configs as the Trainable, but is currently not because Trainable.__init__ clears out some of the internal configs (e.g. trial info).

Changes

  1. Create a new DistributedTrainable class with a build_config method to populate internal configs.
  2. Update {horovod, tensorflow, torch} integrations to inherit from DistributedTrainable and call build_config.

Related issue number

Closes #15288

Checks

  • 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 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 :(

Copy link
Contributor

@amogkam amogkam left a comment

Choose a reason for hiding this comment

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

Thanks a bunch for cleaning this up and adding tests! Looks good overall. Just left 1 comment.

python/ray/tune/trainable.py Outdated Show resolved Hide resolved
Copy link
Contributor

@richardliaw richardliaw left a comment

Choose a reason for hiding this comment

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

Nice work! Left 1 nit.

Copy link
Contributor

@amogkam amogkam left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

@richardliaw richardliaw merged commit 7637654 into ray-project:master Jun 1, 2021
@matthewdeng matthewdeng deleted the trainable-configs branch June 11, 2021 17:11
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.

[tune] DistributedTrainableCreator can not get access to current trial_id
3 participants