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
5b0034e4
Unverified
Commit
5b0034e4
authored
Aug 20, 2019
by
SparkSnail
Committed by
GitHub
Aug 20, 2019
Browse files
Merge pull request #204 from microsoft/master
merge master
parents
704b50e2
19173aa4
Changes
82
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
2743 additions
and
3746 deletions
+2743
-3746
src/webui/src/components/public-child/OpenRow.tsx
src/webui/src/components/public-child/OpenRow.tsx
+1
-1
src/webui/src/components/trial-detail/DefaultMetricPoint.tsx
src/webui/src/components/trial-detail/DefaultMetricPoint.tsx
+1
-1
src/webui/src/components/trial-detail/Intermediate.tsx
src/webui/src/components/trial-detail/Intermediate.tsx
+2
-2
src/webui/src/components/trial-detail/Para.tsx
src/webui/src/components/trial-detail/Para.tsx
+12
-8
src/webui/src/components/trial-detail/TableList.tsx
src/webui/src/components/trial-detail/TableList.tsx
+20
-18
src/webui/src/index.tsx
src/webui/src/index.tsx
+9
-7
src/webui/src/static/const.ts
src/webui/src/static/const.ts
+2
-2
src/webui/src/static/interface.ts
src/webui/src/static/interface.ts
+1
-1
src/webui/src/static/style/compare.scss
src/webui/src/static/style/compare.scss
+1
-1
src/webui/src/static/style/trialsDetail.scss
src/webui/src/static/style/trialsDetail.scss
+2
-2
src/webui/tsconfig.json
src/webui/tsconfig.json
+3
-9
src/webui/yarn.lock
src/webui/yarn.lock
+2640
-3676
test/config_test.py
test/config_test.py
+0
-2
test/naive_test.py
test/naive_test.py
+4
-4
test/remote_docker.py
test/remote_docker.py
+1
-1
tools/bash-completion
tools/bash-completion
+1
-1
tools/nni_cmd/config_schema.py
tools/nni_cmd/config_schema.py
+7
-8
tools/nni_cmd/launcher.py
tools/nni_cmd/launcher.py
+2
-2
tools/nni_cmd/launcher_utils.py
tools/nni_cmd/launcher_utils.py
+33
-0
tools/nni_cmd/nnictl.py
tools/nni_cmd/nnictl.py
+1
-0
No files found.
src/webui/src/components/public-child/OpenRow.tsx
View file @
5b0034e4
...
...
@@ -98,7 +98,7 @@ class OpenRow extends React.Component<OpenRowProps, OpenRowState> {
For the entire parameter set, please refer to the following "
<
a
href
=
{
trialink
}
target
=
"_blank"
>
{
trialink
}
</
a
>
".
<
br
/>
Current Phase:
{
record
.
description
.
p
rogress
}
.
Current Phase:
{
record
.
description
.
multiP
rogress
}
.
</
Row
>
:
<
div
/>
...
...
src/webui/src/components/trial-detail/DefaultMetricPoint.tsx
View file @
5b0034e4
...
...
@@ -275,7 +275,7 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
<
div
>
<
div
className
=
"default-metric"
>
<
div
className
=
"position"
>
<
span
className
=
"bold"
>
o
ptimization curve
</
span
>
<
span
className
=
"bold"
>
O
ptimization curve
</
span
>
<
Switch
defaultChecked
=
{
false
}
onChange
=
{
this
.
loadDefault
}
/>
</
div
>
</
div
>
...
...
src/webui/src/components/trial-detail/Interme
i
date.tsx
→
src/webui/src/components/trial-detail/Intermed
i
ate.tsx
View file @
5b0034e4
...
...
@@ -292,7 +292,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
isFilter
?
<
span
>
<
span
className
=
"filter-x"
>
# Interme
i
date
</
span
>
<
span
className
=
"filter-x"
>
# Intermed
i
ate
</
span
>
<
input
// placeholder="point"
ref
=
{
input
=>
this
.
pointInput
=
input
}
...
...
@@ -321,7 +321,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
null
}
</
Row
>
<
Row
className
=
"interme
i
date-graph"
>
<
Row
className
=
"intermed
i
ate-graph"
>
<
ReactEcharts
option
=
{
interSource
}
style
=
{
{
width
:
'
100%
'
,
height
:
418
,
margin
:
'
0 auto
'
}
}
...
...
src/webui/src/components/trial-detail/Para.tsx
View file @
5b0034e4
...
...
@@ -237,7 +237,8 @@ class Para extends React.Component<ParaProps, ParaState> {
show
:
true
},
axisLabel
:
{
formatter
:
function
(
value
:
string
)
{
formatter
:
function
(
value
?:
string
)
{
if
(
value
!==
undefined
)
{
const
length
=
value
.
length
;
if
(
length
>
16
)
{
const
temp
=
value
.
split
(
''
);
...
...
@@ -248,6 +249,9 @@ class Para extends React.Component<ParaProps, ParaState> {
}
else
{
return
value
;
}
}
else
{
return
null
;
}
}
},
}
...
...
src/webui/src/components/trial-detail/TableList.tsx
View file @
5b0034e4
...
...
@@ -4,7 +4,7 @@ import ReactEcharts from 'echarts-for-react';
import
{
Row
,
Table
,
Button
,
Popconfirm
,
Modal
,
Checkbox
,
Select
,
Icon
}
from
'
antd
'
;
const
Option
=
Select
.
Option
;
const
CheckboxGroup
=
Checkbox
.
Group
;
import
{
MANAGER_IP
,
trialJobStatus
,
COLUMN
,
COLUMN_INDEX
,
COLUMNPro
}
from
'
../../static/const
'
;
import
{
MANAGER_IP
,
trialJobStatus
,
COLUMN_INDEX
,
COLUMNPro
}
from
'
../../static/const
'
;
import
{
convertDuration
,
intermediateGraphOption
,
killJob
,
filterByStatus
}
from
'
../../static/function
'
;
import
{
TableObj
,
TrialJob
}
from
'
../../static/interface
'
;
import
OpenRow
from
'
../public-child/OpenRow
'
;
...
...
@@ -32,6 +32,8 @@ interface TableListProps {
platform
:
string
;
logCollection
:
boolean
;
isMultiPhase
:
boolean
;
columnList
:
Array
<
string
>
;
// user select columnKeys
changeColumn
:
(
val
:
Array
<
string
>
)
=>
void
;
}
interface
TableListState
{
...
...
@@ -39,7 +41,6 @@ interface TableListState {
modalVisible
:
boolean
;
isObjFinal
:
boolean
;
isShowColumn
:
boolean
;
columnSelected
:
Array
<
string
>
;
// user select columnKeys
selectRows
:
Array
<
TableObj
>
;
isShowCompareModal
:
boolean
;
selectedRowKeys
:
string
[]
|
number
[];
...
...
@@ -69,7 +70,6 @@ class TableList extends React.Component<TableListProps, TableListState> {
isObjFinal
:
false
,
isShowColumn
:
false
,
isShowCompareModal
:
false
,
columnSelected
:
COLUMN
,
selectRows
:
[],
selectedRowKeys
:
[],
// close selected trial message after modal closed
intermediateData
:
[],
...
...
@@ -120,6 +120,8 @@ class TableList extends React.Component<TableListProps, TableListState> {
}
}
// intermediate button click -> intermediate graph for each trial
// support intermediate is dict
selectOtherKeys
=
(
value
:
string
)
=>
{
const
isShowDefault
:
boolean
=
value
===
'
default
'
?
true
:
false
;
...
...
@@ -193,7 +195,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
case
'
Status
'
:
case
'
Operation
'
:
case
'
Default
'
:
case
'
Interme
i
date count
'
:
case
'
Intermed
i
ate count
'
:
break
;
default
:
finalKeys
.
push
(
checkedValues
[
m
]);
...
...
@@ -226,7 +228,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
});
if
(
this
.
_isMounted
)
{
this
.
setState
(()
=>
({
columnSelected
:
wantResult
})
);
this
.
props
.
changeColumn
(
wantResult
);
}
}
...
...
@@ -277,8 +279,8 @@ class TableList extends React.Component<TableListProps, TableListState> {
render
()
{
const
{
entries
,
tableSource
,
updateList
}
=
this
.
props
;
const
{
intermediateOption
,
modalVisible
,
isShowColumn
,
columnSelected
,
const
{
entries
,
tableSource
,
updateList
,
columnList
}
=
this
.
props
;
const
{
intermediateOption
,
modalVisible
,
isShowColumn
,
selectRows
,
isShowCompareModal
,
selectedRowKeys
,
intermediateOtherKeys
}
=
this
.
state
;
const
rowSelection
=
{
selectedRowKeys
:
selectedRowKeys
,
...
...
@@ -316,8 +318,8 @@ class TableList extends React.Component<TableListProps, TableListState> {
value
:
item
});
});
Object
.
keys
(
column
Selected
).
map
(
key
=>
{
const
item
=
column
Selected
[
key
];
Object
.
keys
(
column
List
).
map
(
key
=>
{
const
item
=
column
List
[
key
];
switch
(
item
)
{
case
'
Trial No.
'
:
showColumn
.
push
({
...
...
@@ -392,7 +394,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
sorter
:
(
a
:
TableObj
,
b
:
TableObj
):
number
=>
a
.
status
.
localeCompare
(
b
.
status
)
});
break
;
case
'
Interme
i
date count
'
:
case
'
Intermed
i
ate count
'
:
showColumn
.
push
({
title
:
'
Intermediate count
'
,
dataIndex
:
'
progress
'
,
...
...
@@ -413,13 +415,12 @@ class TableList extends React.Component<TableListProps, TableListState> {
key
:
'
acc
'
,
width
:
120
,
sorter
:
(
a
:
TableObj
,
b
:
TableObj
)
=>
{
const
aa
=
a
.
description
.
intermediate
;
const
bb
=
b
.
description
.
intermediate
;
if
(
aa
!==
undefined
&&
bb
!==
undefined
)
{
return
aa
[
aa
.
length
-
1
]
-
bb
[
bb
.
length
-
1
];
}
else
{
return
NaN
;
}
const
oneArr
=
a
.
description
.
intermediate
;
const
otherArr
=
b
.
description
.
intermediate
;
const
one
=
(
oneArr
[
oneArr
.
length
-
1
]
!==
undefined
)
?
oneArr
[
oneArr
.
length
-
1
]
:
0
;
const
other
=
(
otherArr
[
otherArr
.
length
-
1
]
!==
undefined
)
?
otherArr
[
otherArr
.
length
-
1
]
:
0
;
return
one
-
other
;
},
render
:
(
text
:
string
,
record
:
TableObj
)
=>
{
return
(
...
...
@@ -581,7 +582,8 @@ class TableList extends React.Component<TableListProps, TableListState> {
>
<
CheckboxGroup
options
=
{
showTitle
}
defaultValue
=
{
columnSelected
}
defaultValue
=
{
columnList
}
// defaultValue={columnSelected}
onChange
=
{
this
.
selectedColumn
}
className
=
"titleColumn"
/>
...
...
src/webui/src/index.tsx
View file @
5b0034e4
...
...
@@ -9,13 +9,15 @@ import TrialsDetail from './components/TrialsDetail';
import
'
./index.css
'
;
ReactDOM
.
render
(
(
<
Router
history
=
{
browserHistory
}
>
<
Route
path
=
"/"
component
=
{
App
}
>
<
IndexRedirect
to
=
"/oview"
/>
<
Route
path
=
"/oview"
component
=
{
Overview
}
/>
<
Route
path
=
"/detail"
component
=
{
TrialsDetail
}
/>
</
Route
>
</
Router
>,
</
Router
>
),
document
.
getElementById
(
'
root
'
)
as
HTMLElement
);
registerServiceWorker
();
src/webui/src/static/const.ts
View file @
5b0034e4
...
...
@@ -42,7 +42,7 @@ const COLUMN_INDEX = [
index
:
4
},
{
name
:
'
Interme
i
date count
'
,
name
:
'
Intermed
i
ate count
'
,
index
:
5
},
{
...
...
@@ -57,7 +57,7 @@ const COLUMN_INDEX = [
// defatult selected column
const
COLUMN
=
[
'
Trial No.
'
,
'
ID
'
,
'
Duration
'
,
'
Status
'
,
'
Default
'
,
'
Operation
'
];
// all choice column !dictory final
const
COLUMNPro
=
[
'
Trial No.
'
,
'
ID
'
,
'
Duration
'
,
'
Status
'
,
'
Interme
i
date count
'
,
'
Default
'
,
'
Operation
'
];
const
COLUMNPro
=
[
'
Trial No.
'
,
'
ID
'
,
'
Duration
'
,
'
Status
'
,
'
Intermed
i
ate count
'
,
'
Default
'
,
'
Operation
'
];
export
{
MANAGER_IP
,
DOWNLOAD_IP
,
trialJobStatus
,
COLUMNPro
,
CONTROLTYPE
,
MONACO
,
COLUMN
,
COLUMN_INDEX
,
DRAWEROPTION
...
...
src/webui/src/static/interface.ts
View file @
5b0034e4
...
...
@@ -27,7 +27,7 @@ interface Parameters {
parameters
:
ErrorParameter
;
logPath
?:
string
;
intermediate
:
Array
<
number
>
;
p
rogress
?:
number
;
multiP
rogress
?:
number
;
}
interface
Experiment
{
...
...
src/webui/src/static/style/compare.scss
View file @
5b0034e4
...
...
@@ -24,7 +24,7 @@
}
}
.compare-interme
i
date
{
.compare-intermed
i
ate
{
position
:
relative
;
.compare-yAxis
{
color
:
#333
;
...
...
src/webui/src/static/style/trialsDetail.scss
View file @
5b0034e4
...
...
@@ -84,8 +84,8 @@
}
}
/* for # intermediate in interme
i
date graph*/
.interme
i
date-graph
{
/* for # intermediate in intermed
i
ate graph*/
.intermed
i
ate-graph
{
position
:
relative
;
.yAxis
{
color
:
#333
;
...
...
src/webui/tsconfig.json
View file @
5b0034e4
...
...
@@ -21,13 +21,7 @@
"noUnusedLocals"
:
true
,
"baseUrl"
:
"."
},
"exclude"
:
[
"node_modules"
,
"build"
,
"scripts"
,
"acceptance-tests"
,
"webpack"
,
"jest"
,
"src/setupTests.ts"
"include"
:
[
"src/**/*"
]
}
src/webui/yarn.lock
View file @
5b0034e4
This diff is collapsed.
Click to expand it.
test/config_test.py
View file @
5b0034e4
...
...
@@ -131,5 +131,3 @@ if __name__ == '__main__':
setup_experiment
(
args
.
preinstall
)
run
(
args
)
#
\ No newline at end of file
test/naive_test.py
View file @
5b0034e4
...
...
@@ -103,11 +103,11 @@ def stop_experiment_test():
snooze
()
assert
not
detect_port
(
8990
),
'`nnictl stop %s` failed to stop experiments'
%
experiment_id
# test cmd `nnictl stop all`
proc
=
subprocess
.
run
([
'nnictl'
,
'stop'
,
'all'
])
assert
proc
.
returncode
==
0
,
'`nnictl stop all` failed with code %d'
%
proc
.
returncode
# test cmd `nnictl stop
--
all`
proc
=
subprocess
.
run
([
'nnictl'
,
'stop'
,
'
--
all'
])
assert
proc
.
returncode
==
0
,
'`nnictl stop
--
all` failed with code %d'
%
proc
.
returncode
snooze
()
assert
not
detect_port
(
8888
)
and
not
detect_port
(
8989
),
'`nnictl stop all` failed to stop experiments'
assert
not
detect_port
(
8888
)
and
not
detect_port
(
8989
),
'`nnictl stop
--
all` failed to stop experiments'
if
__name__
==
'__main__'
:
...
...
test/remote_docker.py
View file @
5b0034e4
...
...
@@ -54,7 +54,7 @@ def start_container(image, name, nnimanager_os):
else
:
return
'/tmp/nni/dist/{0}'
.
format
(
wheel_name
)
pip_cmds
=
[
'docker'
,
'exec'
,
name
,
'python3'
,
'-m'
,
'pip'
,
'install'
,
'--upgrade'
,
'pip'
]
pip_cmds
=
[
'docker'
,
'exec'
,
name
,
'python3'
,
'-m'
,
'pip'
,
'install'
,
'--upgrade'
,
'pip'
,
'setuptools==39.1.0'
]
check_call
(
pip_cmds
)
sdk_cmds
=
[
'docker'
,
'exec'
,
name
,
'python3'
,
'-m'
,
'pip'
,
'install'
,
get_dist
(
wheel_name
)]
check_call
(
sdk_cmds
)
...
...
tools/bash-completion
View file @
5b0034e4
...
...
@@ -7,7 +7,7 @@ __nnictl_update_searchspace_cmds="--filename"
__nnictl_update_concurrency_cmds="--value"
__nnictl_update_duration_cmds="--value"
__nnictl_update_trialnum_cmds="--value"
__nnictl_stop_cmds="--port all"
__nnictl_stop_cmds="--port
--
all"
__nnictl_trial_cmds="ls kill codegen"
__nnictl_trial_kill_cmds="--trial_id"
__nnictl_trial_codegen_cmds="--trial_id"
...
...
tools/nni_cmd/config_schema.py
View file @
5b0034e4
...
...
@@ -70,8 +70,8 @@ common_schema = {
}
}
tuner_schema_dict
=
{
(
'TPE'
,
'Anneal'
,
'SMAC'
):
{
'builtinTunerName'
:
setChoice
(
'builtinTunerName'
,
'TPE'
,
'Anneal'
,
'SMAC'
),
(
'Anneal'
,
'SMAC'
):
{
'builtinTunerName'
:
setChoice
(
'builtinTunerName'
,
'Anneal'
,
'SMAC'
),
Optional
(
'classArgs'
):
{
'optimize_mode'
:
setChoice
(
'optimize_mode'
,
'maximize'
,
'minimize'
),
},
...
...
@@ -94,7 +94,7 @@ tuner_schema_dict = {
},
'TPE'
:
{
'builtinTunerName'
:
'TPE'
,
'classArgs'
:
{
Optional
(
'classArgs'
)
:
{
Optional
(
'optimize_mode'
):
setChoice
(
'optimize_mode'
,
'maximize'
,
'minimize'
),
Optional
(
'parallel_optimize'
):
setType
(
'parallel_optimize'
,
bool
),
Optional
(
'constant_liar_type'
):
setChoice
(
'constant_liar_type'
,
'min'
,
'max'
,
'mean'
)
...
...
@@ -104,7 +104,7 @@ tuner_schema_dict = {
},
'NetworkMorphism'
:
{
'builtinTunerName'
:
'NetworkMorphism'
,
'classArgs'
:
{
Optional
(
'classArgs'
)
:
{
Optional
(
'optimize_mode'
):
setChoice
(
'optimize_mode'
,
'maximize'
,
'minimize'
),
Optional
(
'task'
):
setChoice
(
'task'
,
'cv'
,
'nlp'
,
'common'
),
Optional
(
'input_width'
):
setType
(
'input_width'
,
int
),
...
...
@@ -116,7 +116,7 @@ tuner_schema_dict = {
},
'MetisTuner'
:
{
'builtinTunerName'
:
'MetisTuner'
,
'classArgs'
:
{
Optional
(
'classArgs'
)
:
{
Optional
(
'optimize_mode'
):
setChoice
(
'optimize_mode'
,
'maximize'
,
'minimize'
),
Optional
(
'no_resampling'
):
setType
(
'no_resampling'
,
bool
),
Optional
(
'no_candidates'
):
setType
(
'no_candidates'
,
bool
),
...
...
@@ -128,7 +128,7 @@ tuner_schema_dict = {
},
'GPTuner'
:
{
'builtinTunerName'
:
'GPTuner'
,
'classArgs'
:
{
Optional
(
'classArgs'
)
:
{
Optional
(
'optimize_mode'
):
setChoice
(
'optimize_mode'
,
'maximize'
,
'minimize'
),
Optional
(
'utility'
):
setChoice
(
'utility'
,
'ei'
,
'ucb'
,
'poi'
),
Optional
(
'kappa'
):
setType
(
'kappa'
,
float
),
...
...
@@ -233,8 +233,7 @@ pai_trial_schema = {
'cpuNum'
:
setNumberRange
(
'cpuNum'
,
int
,
0
,
99999
),
'memoryMB'
:
setType
(
'memoryMB'
,
int
),
'image'
:
setType
(
'image'
,
str
),
Optional
(
'authFile'
):
And
(
Regex
(
r
'hdfs://(([0-9]{1,3}.){3}[0-9]{1,3})(:[0-9]{2,5})?(/.*)?'
),
\
error
=
'ERROR: authFile format error, authFile format is hdfs://xxx.xxx.xxx.xxx:xxx'
),
Optional
(
'authFile'
):
And
(
os
.
path
.
exists
,
error
=
SCHEMA_PATH_ERROR
%
'authFile'
),
Optional
(
'shmMB'
):
setType
(
'shmMB'
,
int
),
Optional
(
'dataDir'
):
And
(
Regex
(
r
'hdfs://(([0-9]{1,3}.){3}[0-9]{1,3})(:[0-9]{2,5})?(/.*)?'
),
\
error
=
'ERROR: dataDir format error, dataDir format is hdfs://xxx.xxx.xxx.xxx:xxx'
),
...
...
tools/nni_cmd/launcher.py
View file @
5b0034e4
...
...
@@ -519,14 +519,14 @@ def resume_experiment(args):
#find the latest stopped experiment
if
not
args
.
id
:
print_error
(
'Please set experiment id!
\n
You could use
\'
nnictl resume {id}
\'
to resume a stopped experiment!
\n
'
\
'You could use
\'
nnictl experiment list all
\'
to show all
of stopped
experiments!'
)
'You could use
\'
nnictl experiment list
--
all
\'
to show all experiments!'
)
exit
(
1
)
else
:
if
experiment_dict
.
get
(
args
.
id
)
is
None
:
print_error
(
'Id %s not exist!'
%
args
.
id
)
exit
(
1
)
if
experiment_dict
[
args
.
id
][
'status'
]
!=
'STOPPED'
:
print_error
(
'
Experiment %s is running!'
%
args
.
id
)
print_error
(
'
Only stopped experiments can be resumed!'
)
exit
(
1
)
experiment_id
=
args
.
id
print_normal
(
'Resuming experiment %s...'
%
experiment_id
)
...
...
tools/nni_cmd/launcher_utils.py
View file @
5b0034e4
...
...
@@ -56,12 +56,30 @@ def parse_path(experiment_config, config_path):
expand_path
(
experiment_config
,
'searchSpacePath'
)
if
experiment_config
.
get
(
'trial'
):
expand_path
(
experiment_config
[
'trial'
],
'codeDir'
)
if
experiment_config
[
'trial'
].
get
(
'authFile'
):
expand_path
(
experiment_config
[
'trial'
],
'authFile'
)
if
experiment_config
[
'trial'
].
get
(
'ps'
):
if
experiment_config
[
'trial'
][
'ps'
].
get
(
'privateRegistryAuthPath'
):
expand_path
(
experiment_config
[
'trial'
][
'ps'
],
'privateRegistryAuthPath'
)
if
experiment_config
[
'trial'
].
get
(
'master'
):
if
experiment_config
[
'trial'
][
'master'
].
get
(
'privateRegistryAuthPath'
):
expand_path
(
experiment_config
[
'trial'
][
'master'
],
'privateRegistryAuthPath'
)
if
experiment_config
[
'trial'
].
get
(
'worker'
):
if
experiment_config
[
'trial'
][
'worker'
].
get
(
'privateRegistryAuthPath'
):
expand_path
(
experiment_config
[
'trial'
][
'worker'
],
'privateRegistryAuthPath'
)
if
experiment_config
[
'trial'
].
get
(
'taskRoles'
):
for
index
in
range
(
len
(
experiment_config
[
'trial'
][
'taskRoles'
])):
if
experiment_config
[
'trial'
][
'taskRoles'
][
index
].
get
(
'privateRegistryAuthPath'
):
expand_path
(
experiment_config
[
'trial'
][
'taskRoles'
][
index
],
'privateRegistryAuthPath'
)
if
experiment_config
.
get
(
'tuner'
):
expand_path
(
experiment_config
[
'tuner'
],
'codeDir'
)
if
experiment_config
.
get
(
'assessor'
):
expand_path
(
experiment_config
[
'assessor'
],
'codeDir'
)
if
experiment_config
.
get
(
'advisor'
):
expand_path
(
experiment_config
[
'advisor'
],
'codeDir'
)
if
experiment_config
.
get
(
'machineList'
):
for
index
in
range
(
len
(
experiment_config
[
'machineList'
])):
expand_path
(
experiment_config
[
'machineList'
][
index
],
'sshKeyPath'
)
#if users use relative path, convert it to absolute path
root_path
=
os
.
path
.
dirname
(
config_path
)
...
...
@@ -69,6 +87,21 @@ def parse_path(experiment_config, config_path):
parse_relative_path
(
root_path
,
experiment_config
,
'searchSpacePath'
)
if
experiment_config
.
get
(
'trial'
):
parse_relative_path
(
root_path
,
experiment_config
[
'trial'
],
'codeDir'
)
if
experiment_config
[
'trial'
].
get
(
'authFile'
):
parse_relative_path
(
root_path
,
experiment_config
[
'trial'
],
'authFile'
)
if
experiment_config
[
'trial'
].
get
(
'ps'
):
if
experiment_config
[
'trial'
][
'ps'
].
get
(
'privateRegistryAuthPath'
):
parse_relative_path
(
root_path
,
experiment_config
[
'trial'
][
'ps'
],
'privateRegistryAuthPath'
)
if
experiment_config
[
'trial'
].
get
(
'master'
):
if
experiment_config
[
'trial'
][
'master'
].
get
(
'privateRegistryAuthPath'
):
parse_relative_path
(
root_path
,
experiment_config
[
'trial'
][
'master'
],
'privateRegistryAuthPath'
)
if
experiment_config
[
'trial'
].
get
(
'worker'
):
if
experiment_config
[
'trial'
][
'worker'
].
get
(
'privateRegistryAuthPath'
):
parse_relative_path
(
root_path
,
experiment_config
[
'trial'
][
'worker'
],
'privateRegistryAuthPath'
)
if
experiment_config
[
'trial'
].
get
(
'taskRoles'
):
for
index
in
range
(
len
(
experiment_config
[
'trial'
][
'taskRoles'
])):
if
experiment_config
[
'trial'
][
'taskRoles'
][
index
].
get
(
'privateRegistryAuthPath'
):
parse_relative_path
(
root_path
,
experiment_config
[
'trial'
][
'taskRoles'
][
index
],
'privateRegistryAuthPath'
)
if
experiment_config
.
get
(
'tuner'
):
parse_relative_path
(
root_path
,
experiment_config
[
'tuner'
],
'codeDir'
)
if
experiment_config
.
get
(
'assessor'
):
...
...
tools/nni_cmd/nnictl.py
View file @
5b0034e4
...
...
@@ -91,6 +91,7 @@ def parse_args():
parser_stop
=
subparsers
.
add_parser
(
'stop'
,
help
=
'stop the experiment'
)
parser_stop
.
add_argument
(
'id'
,
nargs
=
'?'
,
help
=
'the id of experiment, use
\'
all
\'
to stop all running experiments'
)
parser_stop
.
add_argument
(
'--port'
,
'-p'
,
dest
=
'port'
,
help
=
'the port of restful server'
)
parser_stop
.
add_argument
(
'--all'
,
'-a'
,
action
=
'store_true'
,
help
=
'stop all of experiments'
)
parser_stop
.
set_defaults
(
func
=
stop_experiment
)
#parse trial command
...
...
Prev
1
2
3
4
5
Next
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