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
19173aa4
Commit
19173aa4
authored
Aug 14, 2019
by
Guoxin
Committed by
QuanluZhang
Aug 14, 2019
Browse files
merge v1.0(bug bash) back to master (#1462)
* squash commits in v1.0 first round bug bash
parent
f721b431
Changes
65
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
94 additions
and
69 deletions
+94
-69
src/webui/src/components/Modal/Compare.tsx
src/webui/src/components/Modal/Compare.tsx
+3
-3
src/webui/src/components/Modal/ExperimentDrawer.tsx
src/webui/src/components/Modal/ExperimentDrawer.tsx
+1
-2
src/webui/src/components/Overview.tsx
src/webui/src/components/Overview.tsx
+20
-3
src/webui/src/components/SlideBar.tsx
src/webui/src/components/SlideBar.tsx
+2
-2
src/webui/src/components/TrialsDetail.tsx
src/webui/src/components/TrialsDetail.tsx
+8
-3
src/webui/src/components/overview/Progress.tsx
src/webui/src/components/overview/Progress.tsx
+5
-4
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/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
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
No files found.
src/webui/src/components/Modal/Compare.tsx
View file @
19173aa4
...
...
@@ -83,7 +83,7 @@ class Compare extends React.Component<CompareProps, {}> {
},
xAxis
:
{
type
:
'
category
'
,
// name: '# Interme
i
date',
// name: '# Intermed
i
ate',
boundaryGap
:
false
,
data
:
xAxis
},
...
...
@@ -194,9 +194,9 @@ class Compare extends React.Component<CompareProps, {}> {
maskClosable
=
{
false
}
width
=
"90%"
>
<
Row
className
=
"compare-interme
i
date"
>
<
Row
className
=
"compare-intermed
i
ate"
>
{
this
.
intermediate
()
}
<
Row
className
=
"compare-yAxis"
>
# Interme
i
date
</
Row
>
<
Row
className
=
"compare-yAxis"
>
# Intermed
i
ate
</
Row
>
</
Row
>
<
Row
>
{
this
.
initColumn
()
}
</
Row
>
</
Modal
>
...
...
src/webui/src/components/Modal/ExperimentDrawer.tsx
View file @
19173aa4
...
...
@@ -42,8 +42,7 @@ class ExperimentDrawer extends React.Component<ExpDrawerProps, ExpDrawerState> {
let
trialMessagesArr
=
res1
.
data
;
const
interResultList
=
res2
.
data
;
Object
.
keys
(
trialMessagesArr
).
map
(
item
=>
{
// transform hyperparameters as object to show elegantly
trialMessagesArr
[
item
].
hyperParameters
=
JSON
.
parse
(
trialMessagesArr
[
item
].
hyperParameters
);
// not deal with trial's hyperParameters
const
trialId
=
trialMessagesArr
[
item
].
id
;
// add intermediate result message
trialMessagesArr
[
item
].
intermediate
=
[];
...
...
src/webui/src/components/Overview.tsx
View file @
19173aa4
...
...
@@ -42,6 +42,8 @@ interface OverviewState {
interface
OverviewProps
{
interval
:
number
;
// user select
whichPageToFresh
:
string
;
concurrency
:
number
;
changeConcurrency
:
(
val
:
number
)
=>
void
;
}
class
Overview
extends
React
.
Component
<
OverviewProps
,
OverviewState
>
{
...
...
@@ -61,7 +63,7 @@ class Overview extends React.Component<OverviewProps, OverviewState> {
id
:
''
,
author
:
''
,
experName
:
''
,
runConcurren
:
0
,
runConcurren
:
1
,
maxDuration
:
0
,
execDuration
:
0
,
MaxTrialNum
:
0
,
...
...
@@ -264,7 +266,8 @@ class Overview extends React.Component<OverviewProps, OverviewState> {
profile
.
succTrial
+=
1
;
const
desJobDetail
:
Parameters
=
{
parameters
:
{},
intermediate
:
[]
intermediate
:
[],
multiProgress
:
1
};
const
duration
=
(
tableData
[
item
].
endTime
-
tableData
[
item
].
startTime
)
/
1000
;
const
acc
=
getFinal
(
tableData
[
item
].
finalMetricData
);
...
...
@@ -273,6 +276,7 @@ class Overview extends React.Component<OverviewProps, OverviewState> {
if
(
tempara
!==
undefined
)
{
const
tempLength
=
tempara
.
length
;
const
parameters
=
JSON
.
parse
(
tempara
[
tempLength
-
1
]).
parameters
;
desJobDetail
.
multiProgress
=
tempara
.
length
;
if
(
typeof
parameters
===
'
string
'
)
{
desJobDetail
.
parameters
=
JSON
.
parse
(
parameters
);
}
else
{
...
...
@@ -462,6 +466,18 @@ class Overview extends React.Component<OverviewProps, OverviewState> {
accNodata
,
status
,
errorStr
,
trialNumber
,
bestAccuracy
,
isMultiPhase
,
titleMaxbgcolor
,
titleMinbgcolor
,
isLogCollection
,
experimentAPI
}
=
this
.
state
;
const
{
concurrency
}
=
this
.
props
;
trialProfile
.
runConcurren
=
concurrency
;
Object
.
keys
(
experimentAPI
).
map
(
item
=>
{
if
(
item
===
'
params
'
)
{
const
temp
=
experimentAPI
[
item
];
Object
.
keys
(
temp
).
map
(
index
=>
{
if
(
index
===
'
trialConcurrency
'
)
{
temp
[
index
]
=
concurrency
;
}
});
}
});
return
(
<
div
className
=
"overview"
>
...
...
@@ -480,7 +496,8 @@ class Overview extends React.Component<OverviewProps, OverviewState> {
bestAccuracy
=
{
bestAccuracy
}
status
=
{
status
}
errors
=
{
errorStr
}
updateFile
=
{
this
.
showSessionPro
}
concurrency
=
{
concurrency
}
changeConcurrency
=
{
this
.
props
.
changeConcurrency
}
/>
</
Col
>
{
/* experiment parameters search space tuner assessor... */
}
...
...
src/webui/src/components/SlideBar.tsx
View file @
19173aa4
...
...
@@ -136,7 +136,7 @@ class SlideBar extends React.Component<SliderProps, SliderState> {
onChange
=
{
this
.
handleVisibleChange
}
title
=
{
<
span
>
<
span
>
Download
</
span
>
<
span
>
View
</
span
>
</
span
>
}
>
...
...
@@ -234,7 +234,7 @@ class SlideBar extends React.Component<SliderProps, SliderState> {
>
<
a
className
=
"ant-dropdown-link"
href
=
"#"
>
<
Icon
type
=
"download"
className
=
"down-icon"
/>
<
span
>
Download
</
span
>
<
span
>
View
</
span
>
{
menuVisible
?
...
...
src/webui/src/components/TrialsDetail.tsx
View file @
19173aa4
...
...
@@ -9,7 +9,7 @@ import DefaultPoint from './trial-detail/DefaultMetricPoint';
import
Duration
from
'
./trial-detail/Duration
'
;
import
Title1
from
'
./overview/Title1
'
;
import
Para
from
'
./trial-detail/Para
'
;
import
Intermediate
from
'
./trial-detail/Interme
i
date
'
;
import
Intermediate
from
'
./trial-detail/Intermed
i
ate
'
;
import
TableList
from
'
./trial-detail/TableList
'
;
const
TabPane
=
Tabs
.
TabPane
;
import
'
../static/style/trialsDetail.scss
'
;
...
...
@@ -38,6 +38,8 @@ interface TrialDetailState {
interface
TrialsDetailProps
{
interval
:
number
;
whichPageToFresh
:
string
;
columnList
:
Array
<
string
>
;
changeColumn
:
(
val
:
Array
<
string
>
)
=>
void
;
}
class
TrialsDetail
extends
React
.
Component
<
TrialsDetailProps
,
TrialDetailState
>
{
...
...
@@ -112,7 +114,7 @@ class TrialsDetail extends React.Component<TrialsDetailProps, TrialDetailState>
let
desc
:
Parameters
=
{
parameters
:
{},
intermediate
:
[],
p
rogress
:
1
multiP
rogress
:
1
};
let
duration
=
0
;
const
id
=
trialJobs
[
item
].
id
!==
undefined
...
...
@@ -133,7 +135,7 @@ class TrialsDetail extends React.Component<TrialsDetailProps, TrialDetailState>
const
tempHyper
=
trialJobs
[
item
].
hyperParameters
;
if
(
tempHyper
!==
undefined
)
{
const
getPara
=
JSON
.
parse
(
tempHyper
[
tempHyper
.
length
-
1
]).
parameters
;
desc
.
p
rogress
=
tempHyper
.
length
;
desc
.
multiP
rogress
=
tempHyper
.
length
;
if
(
typeof
getPara
===
'
string
'
)
{
desc
.
parameters
=
JSON
.
parse
(
getPara
);
}
else
{
...
...
@@ -397,6 +399,7 @@ class TrialsDetail extends React.Component<TrialsDetailProps, TrialDetailState>
whichGraph
,
searchPlaceHolder
}
=
this
.
state
;
const
source
=
isHasSearch
?
searchResultSource
:
tableListSource
;
const
{
columnList
,
changeColumn
}
=
this
.
props
;
return
(
<
div
>
<
div
className
=
"trial"
id
=
"tabsty"
>
...
...
@@ -482,6 +485,8 @@ class TrialsDetail extends React.Component<TrialsDetailProps, TrialDetailState>
platform
=
{
experimentInfo
.
platform
}
updateList
=
{
this
.
getDetailSource
}
logCollection
=
{
experimentLogCollection
}
columnList
=
{
columnList
}
changeColumn
=
{
changeColumn
}
ref
=
{
(
tabList
)
=>
this
.
tableList
=
tabList
}
/>
</
div
>
...
...
src/webui/src/components/overview/Progress.tsx
View file @
19173aa4
...
...
@@ -11,11 +11,12 @@ import '../../static/style/probar.scss';
interface
ProgressProps
{
trialProfile
:
Experiment
;
concurrency
:
number
;
trialNumber
:
TrialNumber
;
bestAccuracy
:
number
;
status
:
string
;
errors
:
string
;
updateFile
:
Function
;
changeConcurrency
:
(
val
:
number
)
=>
void
;
}
interface
ProgressState
{
...
...
@@ -45,12 +46,14 @@ class Progressed extends React.Component<ProgressProps, ProgressState> {
const
{
btnName
}
=
this
.
state
;
if
(
this
.
_isMounted
)
{
if
(
btnName
===
'
Edit
'
)
{
// user click edit
this
.
setState
(()
=>
({
isEnable
:
false
,
btnName
:
'
Save
'
,
cancelSty
:
'
inline-block
'
}));
}
else
{
// user click save button
axios
(
`
${
MANAGER_IP
}
/experiment`
,
{
method
:
'
GET
'
})
...
...
@@ -81,9 +84,7 @@ class Progressed extends React.Component<ProgressProps, ProgressState> {
message
.
destroy
();
message
.
success
(
`Update
${
CONTROLTYPE
[
1
].
toLocaleLowerCase
()}
successfully`
);
// rerender trial profile message
const
{
updateFile
}
=
this
.
props
;
updateFile
();
this
.
props
.
changeConcurrency
(
parseInt
(
userInputVal
,
10
));
}
})
.
catch
(
error
=>
{
...
...
src/webui/src/components/public-child/OpenRow.tsx
View file @
19173aa4
...
...
@@ -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 @
19173aa4
...
...
@@ -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 @
19173aa4
...
...
@@ -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 @
19173aa4
...
...
@@ -237,16 +237,20 @@ class Para extends React.Component<ParaProps, ParaState> {
show
:
true
},
axisLabel
:
{
formatter
:
function
(
value
:
string
)
{
const
length
=
value
.
length
;
if
(
length
>
16
)
{
const
temp
=
value
.
split
(
''
);
for
(
let
m
=
16
;
m
<
temp
.
length
;
m
+=
17
)
{
temp
[
m
]
+=
'
\n
'
;
formatter
:
function
(
value
?:
string
)
{
if
(
value
!==
undefined
)
{
const
length
=
value
.
length
;
if
(
length
>
16
)
{
const
temp
=
value
.
split
(
''
);
for
(
let
m
=
16
;
m
<
temp
.
length
;
m
+=
17
)
{
temp
[
m
]
+=
'
\n
'
;
}
return
temp
.
join
(
''
);
}
else
{
return
value
;
}
return
temp
.
join
(
''
);
}
else
{
return
value
;
return
null
;
}
}
},
...
...
src/webui/src/components/trial-detail/TableList.tsx
View file @
19173aa4
...
...
@@ -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/static/const.ts
View file @
19173aa4
...
...
@@ -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 @
19173aa4
...
...
@@ -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 @
19173aa4
...
...
@@ -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 @
19173aa4
...
...
@@ -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
;
...
...
test/config_test.py
View file @
19173aa4
...
...
@@ -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 @
19173aa4
...
...
@@ -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 @
19173aa4
...
...
@@ -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 @
19173aa4
...
...
@@ -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 @
19173aa4
...
...
@@ -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'
),
...
...
Prev
1
2
3
4
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