Skip to content

Commit

Permalink
Rename client to experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Delaunay committed Jan 6, 2023
1 parent b8d0aac commit c60e8d4
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions example/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ defaults:
hydra:
job:
env_set:
PREVIOUS_CHECKPOINT: ${hydra.sweeper.client.previous_checkpoint}
PREVIOUS_CHECKPOINT: ${hydra.sweeper.experiment.previous_checkpoint}
CURRENT_CHECKPOINT: ${hydra.runtime.output_dir}

# makes sure each multirun ends up in a unique folder
# the defaults can make overlapping folders
sweep:
dir: multirun/${now:%Y-%m-%d}/${now:%H-%M-%S}
subdir: ${hydra.sweeper.client.name}/${hydra.sweeper.client.uuid}/${hydra.job.id}
subdir: ${hydra.sweeper.experiment.name}/${hydra.sweeper.experiment.uuid}/${hydra.job.id}

sweeper:
# default parametrization of the search space
Expand All @@ -23,7 +23,7 @@ hydra:
batch_size: "uniform(4, 16, discrete=True)"
epoch: "fidelity(3, 100)"

client:
experiment:
name: 'experiment'
version: '1'

Expand Down
2 changes: 1 addition & 1 deletion hydra_plugins/hydra_orion_sweeper/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class OrionSweeperConf:

_target_: str = "hydra_plugins.hydra_orion_sweeper.orion_sweeper.OrionSweeper"

client: OrionClientConf = OrionClientConf()
experiment: OrionClientConf = OrionClientConf()

worker: WorkerConf = WorkerConf()

Expand Down
14 changes: 7 additions & 7 deletions hydra_plugins/hydra_orion_sweeper/implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ def as_overrides(trial, additional, uuid, prev_checkpoint):
args = [f"{k}={v}" for k, v in kwargs.items()]

args += [
f"hydra.sweeper.client.id={trial.experiment}",
f"hydra.sweeper.client.trial={trial.id}",
f"hydra.sweeper.client.uuid={uuid}",
f"hydra.sweeper.client.previous_checkpoint={prev_checkpoint}",
# "hydra.sweeper.client.current_checkpoint=$hydra.runtime.output_dir",
f"hydra.sweeper.experiment.id={trial.experiment}",
f"hydra.sweeper.experiment.trial={trial.id}",
f"hydra.sweeper.experiment.uuid={uuid}",
f"hydra.sweeper.experiment.previous_checkpoint={prev_checkpoint}",
# "hydra.sweeper.experiment.current_checkpoint=$hydra.runtime.output_dir",
]
return tuple(args)

Expand Down Expand Up @@ -341,7 +341,7 @@ class OrionSweeperImpl(Sweeper):

def __init__(
self,
client: OrionClientConf,
experiment: OrionClientConf,
worker: WorkerConf,
algorithm: AlgorithmConf,
storage: StorageConf,
Expand All @@ -355,7 +355,7 @@ def __init__(
self.uuid = uuid.uuid1().hex
self.resume_paths = dict()

self.orion_config = client
self.orion_config = experiment
self.worker_config = worker
self.algo_config = algorithm
self.storage_config = storage
Expand Down
8 changes: 4 additions & 4 deletions hydra_plugins/hydra_orion_sweeper/orion_sweeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class OrionSweeper(Sweeper):

def __init__(
self,
client: OrionClientConf,
experiment: OrionClientConf,
worker: WorkerConf,
algorithm: AlgorithmConf,
storage: StorageConf,
Expand All @@ -30,15 +30,15 @@ def __init__(
# >>> Remove with Issue #8
if parametrization is not None and params is None:
warn(
"`hydra.sweeper.orion.parametrization` is deprecated;"
"`hydra.sweeper.experiment.parametrization` is deprecated;"
"use `hydra.sweeper.params` instead",
DeprecationWarning,
)
params = parametrization

elif parametrization is not None and params is not None:
warn(
"Both `hydra.sweeper.orion.parametrization` and `hydra.sweeper.params` are defined;"
"Both `hydra.sweeper.experiment.parametrization` and `hydra.sweeper.params` are defined;"
"using `hydra.sweeper.params`",
DeprecationWarning,
)
Expand All @@ -47,7 +47,7 @@ def __init__(
if params is None:
params = dict()

self.sweeper = OrionSweeperImpl(client, worker, algorithm, storage, params)
self.sweeper = OrionSweeperImpl(experiment, worker, algorithm, storage, params)

def setup(
self,
Expand Down
2 changes: 1 addition & 1 deletion tests/hydra_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"sweeper": {
"_target_": "hydra_plugins.hydra_orion_sweeper.orion_sweeper.OrionSweeper",
"client": {
"experiment": {
"name": None,
"version": None,
"branching": None,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_orion.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def load_hydra_testing_config():

def orion_configuration():
return dict(
client=OmegaConf.structured(OrionClientConf()),
experiment=OmegaConf.structured(OrionClientConf()),
worker=OmegaConf.structured(WorkerConf()),
algorithm=OmegaConf.structured(AlgorithmConf()),
storage=OmegaConf.structured(StorageConf()),
Expand Down
4 changes: 2 additions & 2 deletions tests/test_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_parametrization_is_deprecated():
assert (
warnings[0]
.message.args[0]
.startswith("`hydra.sweeper.orion.parametrization` is deprecated;")
.startswith("`hydra.sweeper.experiment.parametrization` is deprecated;")
)


Expand All @@ -44,7 +44,7 @@ def test_parametrization_and_params():
assert (
warnings[0]
.message.args[0]
.startswith("Both `hydra.sweeper.orion.parametrization` and")
.startswith("Both `hydra.sweeper.experiment.parametrization` and")
)


Expand Down

0 comments on commit c60e8d4

Please sign in to comment.