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] Allow train methods to be called outside of the session #21969

Merged
merged 9 commits into from
Feb 12, 2022

Conversation

amogkam
Copy link
Contributor

@amogkam amogkam commented Jan 29, 2022

Updates to address @worldveil's feedback:

  • Include import train.torch in the docs
  • Allow methods in session.py to be called outside of the session with sensible defaults. These will no longer raise an error.

Why are these changes needed?

Related issue number

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

@bveeramani
Copy link
Member

‼️ ACTION REQUIRED ‼️

We've switched our code formatter from YAPF to Black (see #21311).

To prevent issues with merging your code, here's what you'll need to do:

  1. Install Black
pip install -I black==21.12b0
  1. Format changed files with Black
curl -o format-changed.sh https://gist.githubusercontent.com/bveeramani/42ef0e9e387b755a8a735b084af976f2/raw/7631276790765d555c423b8db2b679fd957b984a/format-changed.sh
chmod +x ./format-changed.sh
./format-changed.sh
rm format-changed.sh
  1. Commit your changes.
git add --all
git commit -m "Format Python code with Black"
  1. Merge master into your branch.
git pull upstream master
  1. Resolve merge conflicts (if necessary).

After running these steps, you'll have the updated format.sh.

@worldveil
Copy link
Contributor

Just checking, this will allow it to be created inside Jupyter notebook, outside of a train run, correct?

@amogkam
Copy link
Contributor Author

amogkam commented Feb 3, 2022

@worldveil yep thats right.

@worldveil
Copy link
Contributor

Anything I can do to unblock here?

@amogkam
Copy link
Contributor Author

amogkam commented Feb 11, 2022

Comments are addressed, please take another look!

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.

Take a look at failing tests?

python/ray/train/session.py Outdated Show resolved Hide resolved
python/ray/train/tests/test_session.py Outdated Show resolved Hide resolved
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.

Nice, LGTM pending successful tests.

@amogkam amogkam merged commit e8e3516 into ray-project:master Feb 12, 2022
@amogkam amogkam deleted the train-minor-docs-update branch February 12, 2022 01:42
@amogkam
Copy link
Contributor Author

amogkam commented Feb 12, 2022

Failing tests are unrelated, going to merge.

amogkam added a commit that referenced this pull request Feb 24, 2022
Update more examples to include the ray.train.torch import line. Follow up to #21969
simonsays1980 pushed a commit to simonsays1980/ray that referenced this pull request Feb 27, 2022
…y-project#21969)

Updates to address @worldveil's feedback:

Include import train.torch in the docs
Allow methods in session.py to be called outside of the session with sensible defaults. These will no longer raise an error.

Co-authored-by: Balaji Veeramani <[email protected]>
simonsays1980 pushed a commit to simonsays1980/ray that referenced this pull request Feb 27, 2022
Update more examples to include the ray.train.torch import line. Follow up to ray-project#21969
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