Unverified Commit 7cf7997a authored by liuzhe-lz's avatar liuzhe-lz Committed by GitHub
Browse files

fix bugs about config (#3437)

parent ea838014
......@@ -79,6 +79,9 @@ class ExperimentConfig(ConfigBase):
else:
raise RuntimeError('Unsupported Training service configuration!')
super().__init__(**kwargs)
for algo_type in ['tuner', 'assessor', 'advisor']:
if isinstance(kwargs.get(algo_type), dict):
setattr(self, algo_type, _AlgorithmConfig(**kwargs.pop(algo_type)))
def validate(self, initialized_tuner: bool = False) -> None:
super().validate()
......@@ -107,9 +110,9 @@ _canonical_rules = {
'max_experiment_duration': lambda value: f'{util.parse_time(value)}s' if value is not None else None,
'experiment_working_directory': util.canonical_path,
'tuner_gpu_indices': lambda value: [int(idx) for idx in value.split(',')] if isinstance(value, str) else value,
'tuner': lambda config: None if config.name == '_none_' else config,
'assessor': lambda config: None if config.name == '_none_' else config,
'advisor': lambda config: None if config.name == '_none_' else config,
'tuner': lambda config: None if config is None or config.name == '_none_' else config,
'assessor': lambda config: None if config is None or config.name == '_none_' else config,
'advisor': lambda config: None if config is None or config.name == '_none_' else config,
}
_validation_rules = {
......
......@@ -91,7 +91,6 @@ def _handle_training_service(ts, data):
data['localConfig']['gpuIndices'] = _convert_gpu_indices(ts['gpuIndices'])
elif ts['platform'] == 'remote':
print(ts)
data['remoteConfig'] = {'reuse': ts['reuseMode']}
data['machineList'] = []
for machine in ts['machineList']:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment