Skip to content

Commit

Permalink
[AIR] Do not deepcopy RunConfig (#23499)
Browse files Browse the repository at this point in the history
RunConfig is not a tunable hyperparameter, so we do not need to deep copy it when merging parameters with Ray Tune's param_space.
  • Loading branch information
amogkam authored Mar 25, 2022
1 parent cf7b4e6 commit 7fd7efc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/ray/ml/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,11 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

# Create a new config by merging the dicts.
# run_config is not a tunable hyperparameter so it does not need to be
# merged.
run_config = base_config.pop("run_config", None)
self._merged_config = merge_dicts(base_config, self.config)
self._merged_config["run_config"] = run_config

def _trainable_func(self, config, reporter, checkpoint_dir):
# We ignore the config passed by Tune and instead use the merged
Expand Down

0 comments on commit 7fd7efc

Please sign in to comment.