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
2a722cf7
Unverified
Commit
2a722cf7
authored
Dec 24, 2021
by
liuzhe-lz
Committed by
GitHub
Dec 24, 2021
Browse files
fix retiarii with new config/experiment (#4417)
parent
4b67c457
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
nni/retiarii/experiment/pytorch.py
nni/retiarii/experiment/pytorch.py
+5
-1
No files found.
nni/retiarii/experiment/pytorch.py
View file @
2a722cf7
...
@@ -81,7 +81,7 @@ class RetiariiExeConfig(ConfigBase):
...
@@ -81,7 +81,7 @@ class RetiariiExeConfig(ConfigBase):
if
key
in
fixed_attrs
and
fixed_attrs
[
key
]
!=
value
:
if
key
in
fixed_attrs
and
fixed_attrs
[
key
]
!=
value
:
raise
AttributeError
(
f
'
{
key
}
is not supposed to be set in Retiarii mode by users!'
)
raise
AttributeError
(
f
'
{
key
}
is not supposed to be set in Retiarii mode by users!'
)
# 'trial_code_directory' is handled differently because the path will be converted to absolute path by us
# 'trial_code_directory' is handled differently because the path will be converted to absolute path by us
if
key
==
'trial_code_directory'
and
not
(
value
==
Path
(
'.'
)
or
os
.
path
.
isabs
(
value
)):
if
key
==
'trial_code_directory'
and
not
(
str
(
value
)
==
'.'
or
os
.
path
.
isabs
(
value
)):
raise
AttributeError
(
f
'
{
key
}
is not supposed to be set in Retiarii mode by users!'
)
raise
AttributeError
(
f
'
{
key
}
is not supposed to be set in Retiarii mode by users!'
)
if
key
==
'execution_engine'
:
if
key
==
'execution_engine'
:
assert
value
in
[
'base'
,
'py'
,
'cgo'
,
'benchmark'
],
f
'The specified execution engine "
{
value
}
" is not supported.'
assert
value
in
[
'base'
,
'py'
,
'cgo'
,
'benchmark'
],
f
'The specified execution engine "
{
value
}
" is not supported.'
...
@@ -183,6 +183,8 @@ class RetiariiExperiment(Experiment):
...
@@ -183,6 +183,8 @@ class RetiariiExperiment(Experiment):
self
.
_proc
:
Optional
[
Popen
]
=
None
self
.
_proc
:
Optional
[
Popen
]
=
None
self
.
_pipe
:
Optional
[
Pipe
]
=
None
self
.
_pipe
:
Optional
[
Pipe
]
=
None
self
.
url_prefix
=
None
def
_start_strategy
(
self
):
def
_start_strategy
(
self
):
base_model_ir
,
self
.
applied_mutators
=
preprocess_model
(
base_model_ir
,
self
.
applied_mutators
=
preprocess_model
(
self
.
base_model
,
self
.
trainer
,
self
.
applied_mutators
,
self
.
base_model
,
self
.
trainer
,
self
.
applied_mutators
,
...
@@ -212,6 +214,8 @@ class RetiariiExperiment(Experiment):
...
@@ -212,6 +214,8 @@ class RetiariiExperiment(Experiment):
"""
"""
atexit
.
register
(
self
.
stop
)
atexit
.
register
(
self
.
stop
)
self
.
config
=
self
.
config
.
canonical_copy
()
# we will probably need a execution engine factory to make this clean and elegant
# we will probably need a execution engine factory to make this clean and elegant
if
self
.
config
.
execution_engine
==
'base'
:
if
self
.
config
.
execution_engine
==
'base'
:
from
..execution.base
import
BaseExecutionEngine
from
..execution.base
import
BaseExecutionEngine
...
...
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