diff --git a/docs/en_US/Trials.md b/docs/en_US/Trials.md index 5a39f03d86..017c48d222 100644 --- a/docs/en_US/Trials.md +++ b/docs/en_US/Trials.md @@ -144,7 +144,7 @@ export NNI_TRIAL_SEQ_ID=1 export MULTI_PHASE=false export CUDA_VISIBLE_DEVICES= eval python3 mnist.py 2>/home/user_name/nni/experiments/$experiment_id$/trials/$trial_id$/stderr -echo $? `date +%s000` >/home/user_name/nni/experiments/$experiment_id$/trials/$trial_id$/.nni/state +echo $? `date +%s%3N` >/home/user_name/nni/experiments/$experiment_id$/trials/$trial_id$/.nni/state ``` ### Other Modes diff --git a/docs/zh_CN/Trials.md b/docs/zh_CN/Trials.md index 993952c72a..475438c55a 100644 --- a/docs/zh_CN/Trials.md +++ b/docs/zh_CN/Trials.md @@ -149,7 +149,7 @@ export NNI_TRIAL_SEQ_ID=1 export MULTI_PHASE=false export CUDA_VISIBLE_DEVICES= eval python3 mnist.py 2>/home/user_name/nni/experiments/$experiment_id$/trials/$trial_id$/stderr -echo $? `date +%s000` >/home/user_name/nni/experiments/$experiment_id$/trials/$trial_id$/.nni/state +echo $? `date +%s%3N` >/home/user_name/nni/experiments/$experiment_id$/trials/$trial_id$/.nni/state ``` ### 其它模式 @@ -166,4 +166,4 @@ echo $? `date +%s000` >/home/user_name/nni/experiments/$experiment_id$/trials/$t * [为 CIFAR 10 分类找到最佳的 optimizer](Cifar10Examples.md) * [如何在 NNI 调优 SciKit-learn 的参数](SklearnExamples.md) * [在阅读理解上使用自动模型架构搜索。](SquadEvolutionExamples.md) -* [如何在 NNI 上调优 GBDT](GbdtExample.md) \ No newline at end of file +* [如何在 NNI 上调优 GBDT](GbdtExample.md) diff --git a/src/nni_manager/training_service/local/localTrainingService.ts b/src/nni_manager/training_service/local/localTrainingService.ts index 31a90db695..a4cdcd5328 100644 --- a/src/nni_manager/training_service/local/localTrainingService.ts +++ b/src/nni_manager/training_service/local/localTrainingService.ts @@ -507,12 +507,12 @@ class LocalTrainingService implements TrainingService { script.push( `cmd /c ${localTrailConfig.command} 2>${path.join(workingDirectory, 'stderr')}`, `$NOW_DATE = [int64](([datetime]::UtcNow)-(get-date "1/1/1970")).TotalSeconds`, - `$NOW_DATE = "$NOW_DATE" + "000"`, + `$NOW_DATE = "$NOW_DATE" + (Get-Date -Format fff).ToString()`, `Write $LASTEXITCODE " " $NOW_DATE | Out-File ${path.join(workingDirectory, '.nni', 'state')} -NoNewline -encoding utf8`); } else { script.push( `eval ${localTrailConfig.command} 2>${path.join(workingDirectory, 'stderr')}`, - `echo $? \`date +%s000\` >${path.join(workingDirectory, '.nni', 'state')}`); + `echo $? \`date +%s%3N\` >${path.join(workingDirectory, '.nni', 'state')}`); } return script; diff --git a/src/webui/src/components/overview/SuccessTable.tsx b/src/webui/src/components/overview/SuccessTable.tsx index 97108e11b3..18d7ee55a6 100644 --- a/src/webui/src/components/overview/SuccessTable.tsx +++ b/src/webui/src/components/overview/SuccessTable.tsx @@ -72,8 +72,15 @@ class SuccessTable extends React.Component { sorter: (a: TableObj, b: TableObj) => (a.duration as number) - (b.duration as number), render: (text: string, record: TableObj) => { let duration; - if (record.duration) { - duration = convertDuration(record.duration); + if (record.duration !== undefined) { + // duration is nagative number(-1) & 0-1 + if (record.duration > 0 && record.duration < 1 || record.duration < 0) { + duration = `${record.duration}s`; + } else { + duration = convertDuration(record.duration); + } + } else { + duration = 0; } return (
{duration}
diff --git a/src/webui/src/components/trial-detail/TableList.tsx b/src/webui/src/components/trial-detail/TableList.tsx index 954a1cd1b5..448c237eb2 100644 --- a/src/webui/src/components/trial-detail/TableList.tsx +++ b/src/webui/src/components/trial-detail/TableList.tsx @@ -264,7 +264,8 @@ class TableList extends React.Component { render: (text: string, record: TableObj) => { let duration; if (record.duration !== undefined) { - if (record.duration > 0 && record.duration < 1) { + // duration is nagative number(-1) & 0-1 + if (record.duration > 0 && record.duration < 1 || record.duration < 0) { duration = `${record.duration}s`; } else { duration = convertDuration(record.duration);