Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
7cf7997a
Unverified
Commit
7cf7997a
authored
Mar 09, 2021
by
liuzhe-lz
Committed by
GitHub
Mar 09, 2021
Browse files
fix bugs about config (#3437)
parent
ea838014
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
nni/experiment/config/common.py
nni/experiment/config/common.py
+6
-3
nni/experiment/config/convert.py
nni/experiment/config/convert.py
+0
-1
No files found.
nni/experiment/config/common.py
View file @
7cf7997a
...
...
@@ -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
=
{
...
...
nni/experiment/config/convert.py
View file @
7cf7997a
...
...
@@ -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'
]:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment