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] Add find_free_port Tune util #16098

Merged
merged 1 commit into from
May 27, 2021

Conversation

amogkam
Copy link
Contributor

@amogkam amogkam commented May 26, 2021

Add a Tune specific find_free_port util to use for the Tensorflow integration.

Previously, importing the function from SGD would log this warning if torch is not installed "PyTorch not found. TorchTrainer will not be available" which is confusing for users who want to use Tensorflow Tune.

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

@@ -1,14 +1,14 @@
from ray.tune.utils.util import (
Copy link
Contributor

Choose a reason for hiding this comment

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

When do/don't we add references in this file? For example, the atomic_save function is not defined here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think there's a convention for this either, I think atomic_save was probably just forgotten to be included. @richardliaw?

@@ -484,6 +486,14 @@ def atomic_save(state: Dict, checkpoint_dir: str, file_name: str,
os.replace(tmp_search_ckpt_path, os.path.join(checkpoint_dir, file_name))


def find_free_port():
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a convention for where new functions should be, e.g. end of file?

Copy link
Contributor

Choose a reason for hiding this comment

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

No convention; usually locally grouped by similarity

@amogkam
Copy link
Contributor Author

amogkam commented May 27, 2021

Failing test is flaky and unrelated, going to merge.

@amogkam amogkam merged commit 5d3cb29 into ray-project:master May 27, 2021
@amogkam amogkam deleted the tune-find-free-port branch May 27, 2021 18:27
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