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] Cleanup path-related properties in experiment classes #33370

Merged
merged 11 commits into from
Mar 17, 2023

Conversation

krfricke
Copy link
Contributor

@krfricke krfricke commented Mar 16, 2023

Why are these changes needed?

The naming of different path-related components in Ray Tune is currently messy. For instance, Experiment.local_dir refers to main results directory, e.g. ~/ray_results, while Trial.local_dir refers to the experiment directory, e.g. ~/ray_results/experiment. The same is true for properties, where it's unclear if it refers to the object's sub directory or to its parent directory.

To disentangle this information, this PR introduces a new naming convention.

  • All entities receiving a "parent path" receive it in a unambiguous naming scheme.
  • For instance, Experiment(storage_path), TrialRunner(experiment_path), Trial(experiment_path)
  • Outputs are also normalized. E.g. Trial.remote_experiment_path and Trial.local_experiment_path
  • We keep existing arguments and properties for backwards compatibility

One thing to discuss is the logdir property, which exists for different classes, namely Trials, Trainables, and Loggers (and some internal metadata objects).

In my opinion, logdir is unambiguous and okay. However, in the case of Trial it is the same information as local_path. The options here are a) Keep both, b) Keep logdir, c) Switch to local_path. The current version goes for c, deprecating Trial.logdir, to avoid having two names for the same thing. I'm also happy to go with option a instead. For the sake of a uniform naming convention, I would like to avoid sticking only with logdir. Any thoughts here would be appreciated.

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

@krfricke krfricke marked this pull request as ready for review March 16, 2023 18:52
@@ -1595,13 +1595,22 @@ def simulate_storage(
elif storage_type == "s3":
from moto.server import ThreadedMotoServer

old_env = os.environ
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need theses?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The tests don't pass locally when no aws credentials are setup. They are setup in the buildkite runners automatically (as env vars). This is just piggybacking a small fix in the current CI

python/ray/tune/experiment/config_parser.py Show resolved Hide resolved
python/ray/tune/experiment/experiment.py Show resolved Hide resolved
Kai Fricke added 2 commits March 16, 2023 16:29
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
Copy link
Contributor

@xwjiang2010 xwjiang2010 left a comment

Choose a reason for hiding this comment

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

unblock for the following pieces. pending test passing.

@krfricke krfricke added the tests-ok The tagger certifies test failures are unrelated and assumes personal liability. label Mar 17, 2023
@krfricke krfricke merged commit 862a5fb into ray-project:master Mar 17, 2023
@krfricke krfricke deleted the tune/experiment-properties branch March 17, 2023 02:32
ProjectsByJackHe pushed a commit to ProjectsByJackHe/ray that referenced this pull request Mar 21, 2023
…ject#33370)

The naming of different path-related components in Ray Tune is currently messy. For instance, `Experiment.local_dir` refers to main results directory, e.g. `~/ray_results`, while `Trial.local_dir` refers to the experiment directory, e.g. `~/ray_results/experiment`. The same is true for properties, where it's unclear if it refers to the object's sub directory or to its parent directory.

To disentangle this information, this PR introduces a new naming convention.

- All entities receiving a "parent path" receive it in a unambiguous naming scheme.
- For instance, `Experiment(storage_path)`, `TrialRunner(experiment_path)`, `Trial(experiment_path)`
- Outputs are also normalized. E.g. `Trial.remote_experiment_path` and `Trial.local_experiment_path`
- We keep existing arguments and properties for backwards compatibility

Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Jack He <[email protected]>
edoakes pushed a commit to edoakes/ray that referenced this pull request Mar 22, 2023
…ject#33370)

The naming of different path-related components in Ray Tune is currently messy. For instance, `Experiment.local_dir` refers to main results directory, e.g. `~/ray_results`, while `Trial.local_dir` refers to the experiment directory, e.g. `~/ray_results/experiment`. The same is true for properties, where it's unclear if it refers to the object's sub directory or to its parent directory.

To disentangle this information, this PR introduces a new naming convention.

- All entities receiving a "parent path" receive it in a unambiguous naming scheme.
- For instance, `Experiment(storage_path)`, `TrialRunner(experiment_path)`, `Trial(experiment_path)`
- Outputs are also normalized. E.g. `Trial.remote_experiment_path` and `Trial.local_experiment_path`
- We keep existing arguments and properties for backwards compatibility

Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
peytondmurray pushed a commit to peytondmurray/ray that referenced this pull request Mar 22, 2023
…ject#33370)

The naming of different path-related components in Ray Tune is currently messy. For instance, `Experiment.local_dir` refers to main results directory, e.g. `~/ray_results`, while `Trial.local_dir` refers to the experiment directory, e.g. `~/ray_results/experiment`. The same is true for properties, where it's unclear if it refers to the object's sub directory or to its parent directory.

To disentangle this information, this PR introduces a new naming convention.

- All entities receiving a "parent path" receive it in a unambiguous naming scheme.
- For instance, `Experiment(storage_path)`, `TrialRunner(experiment_path)`, `Trial(experiment_path)`
- Outputs are also normalized. E.g. `Trial.remote_experiment_path` and `Trial.local_experiment_path`
- We keep existing arguments and properties for backwards compatibility

Signed-off-by: Kai Fricke <[email protected]>
krfricke added a commit that referenced this pull request Mar 24, 2023
Following #33370, this PR adds `Result.path` and `ResultGrid.experiment_path` to the respective classes. Further, we remove the public facing `ExperimentAnalysis.local_path` and `ExperimentAnalysis.remote_path` in favor of a unified `ExperimentAnalysis.experiment_path`.

Signed-off-by: Kai Fricke <[email protected]>
chaowanggg pushed a commit to chaowanggg/ray-dev that referenced this pull request Apr 4, 2023
…ject#33370)

The naming of different path-related components in Ray Tune is currently messy. For instance, `Experiment.local_dir` refers to main results directory, e.g. `~/ray_results`, while `Trial.local_dir` refers to the experiment directory, e.g. `~/ray_results/experiment`. The same is true for properties, where it's unclear if it refers to the object's sub directory or to its parent directory.

To disentangle this information, this PR introduces a new naming convention.

- All entities receiving a "parent path" receive it in a unambiguous naming scheme.
- For instance, `Experiment(storage_path)`, `TrialRunner(experiment_path)`, `Trial(experiment_path)`
- Outputs are also normalized. E.g. `Trial.remote_experiment_path` and `Trial.local_experiment_path`
- We keep existing arguments and properties for backwards compatibility

Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: chaowang <[email protected]>
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
…ject#33370)

The naming of different path-related components in Ray Tune is currently messy. For instance, `Experiment.local_dir` refers to main results directory, e.g. `~/ray_results`, while `Trial.local_dir` refers to the experiment directory, e.g. `~/ray_results/experiment`. The same is true for properties, where it's unclear if it refers to the object's sub directory or to its parent directory.

To disentangle this information, this PR introduces a new naming convention.

- All entities receiving a "parent path" receive it in a unambiguous naming scheme.
- For instance, `Experiment(storage_path)`, `TrialRunner(experiment_path)`, `Trial(experiment_path)`
- Outputs are also normalized. E.g. `Trial.remote_experiment_path` and `Trial.local_experiment_path`
- We keep existing arguments and properties for backwards compatibility

Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: elliottower <[email protected]>
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
…t#33410)

Following ray-project#33370, this PR adds `Result.path` and `ResultGrid.experiment_path` to the respective classes. Further, we remove the public facing `ExperimentAnalysis.local_path` and `ExperimentAnalysis.remote_path` in favor of a unified `ExperimentAnalysis.experiment_path`.

Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: elliottower <[email protected]>
ProjectsByJackHe pushed a commit to ProjectsByJackHe/ray that referenced this pull request May 4, 2023
…ject#33370)

The naming of different path-related components in Ray Tune is currently messy. For instance, `Experiment.local_dir` refers to main results directory, e.g. `~/ray_results`, while `Trial.local_dir` refers to the experiment directory, e.g. `~/ray_results/experiment`. The same is true for properties, where it's unclear if it refers to the object's sub directory or to its parent directory.

To disentangle this information, this PR introduces a new naming convention.

- All entities receiving a "parent path" receive it in a unambiguous naming scheme.
- For instance, `Experiment(storage_path)`, `TrialRunner(experiment_path)`, `Trial(experiment_path)`
- Outputs are also normalized. E.g. `Trial.remote_experiment_path` and `Trial.local_experiment_path`
- We keep existing arguments and properties for backwards compatibility

Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Jack He <[email protected]>
ProjectsByJackHe pushed a commit to ProjectsByJackHe/ray that referenced this pull request May 4, 2023
…t#33410)

Following ray-project#33370, this PR adds `Result.path` and `ResultGrid.experiment_path` to the respective classes. Further, we remove the public facing `ExperimentAnalysis.local_path` and `ExperimentAnalysis.remote_path` in favor of a unified `ExperimentAnalysis.experiment_path`.

Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Jack He <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests-ok The tagger certifies test failures are unrelated and assumes personal liability.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants