Commit 19173aa4 authored by Guoxin's avatar Guoxin Committed by QuanluZhang
Browse files

merge v1.0(bug bash) back to master (#1462)

* squash commits in v1.0 first round bug bash
parent f721b431
......@@ -83,7 +83,7 @@ class Compare extends React.Component<CompareProps, {}> {
},
xAxis: {
type: 'category',
// name: '# Intermeidate',
// name: '# Intermediate',
boundaryGap: false,
data: xAxis
},
......@@ -194,9 +194,9 @@ class Compare extends React.Component<CompareProps, {}> {
maskClosable={false}
width="90%"
>
<Row className="compare-intermeidate">
<Row className="compare-intermediate">
{this.intermediate()}
<Row className="compare-yAxis"># Intermeidate</Row>
<Row className="compare-yAxis"># Intermediate</Row>
</Row>
<Row>{this.initColumn()}</Row>
</Modal>
......
......@@ -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 = [];
......
......@@ -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... */}
......
......@@ -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
?
......
......@@ -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/Intermeidate';
import Intermediate from './trial-detail/Intermediate';
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: [],
progress: 1
multiProgress: 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.progress = tempHyper.length;
desc.multiProgress = 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>
......
......@@ -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 => {
......
......@@ -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.progress}.
Current Phase: {record.description.multiProgress}.
</Row>
:
<div />
......
......@@ -275,7 +275,7 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
<div>
<div className="default-metric">
<div className="position">
<span className="bold">optimization curve</span>
<span className="bold">Optimization curve</span>
<Switch defaultChecked={false} onChange={this.loadDefault} />
</div>
</div>
......
......@@ -292,7 +292,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
isFilter
?
<span>
<span className="filter-x"># Intermeidate</span>
<span className="filter-x"># Intermediate</span>
<input
// placeholder="point"
ref={input => this.pointInput = input}
......@@ -321,7 +321,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
null
}
</Row>
<Row className="intermeidate-graph">
<Row className="intermediate-graph">
<ReactEcharts
option={interSource}
style={{ width: '100%', height: 418, margin: '0 auto' }}
......
......@@ -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;
}
}
},
......
......@@ -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 'Intermeidate count':
case 'Intermediate 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(columnSelected).map(key => {
const item = columnSelected[key];
Object.keys(columnList).map(key => {
const item = columnList[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 'Intermeidate count':
case 'Intermediate 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"
/>
......
......@@ -42,7 +42,7 @@ const COLUMN_INDEX = [
index: 4
},
{
name: 'Intermeidate count',
name: 'Intermediate 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', 'Intermeidate count', 'Default', 'Operation'];
const COLUMNPro = ['Trial No.', 'ID', 'Duration', 'Status', 'Intermediate count', 'Default', 'Operation'];
export {
MANAGER_IP, DOWNLOAD_IP, trialJobStatus, COLUMNPro,
CONTROLTYPE, MONACO, COLUMN, COLUMN_INDEX, DRAWEROPTION
......
......@@ -27,7 +27,7 @@ interface Parameters {
parameters: ErrorParameter;
logPath?: string;
intermediate: Array<number>;
progress?: number;
multiProgress?: number;
}
interface Experiment {
......
......@@ -24,7 +24,7 @@
}
}
.compare-intermeidate{
.compare-intermediate{
position: relative;
.compare-yAxis{
color: #333;
......
......@@ -84,8 +84,8 @@
}
}
/* for # intermediate in intermeidate graph*/
.intermeidate-graph{
/* for # intermediate in intermediate graph*/
.intermediate-graph{
position: relative;
.yAxis{
color: #333;
......
......@@ -131,5 +131,3 @@ if __name__ == '__main__':
setup_experiment(args.preinstall)
run(args)
#
\ No newline at end of file
......@@ -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__':
......
......@@ -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)
......
......@@ -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"
......
......@@ -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'),
......
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