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
e99c579b
Unverified
Commit
e99c579b
authored
Aug 05, 2021
by
Ni Hao
Committed by
GitHub
Aug 05, 2021
Browse files
fix trial status not correct when trial is early stoped (#4005)
parent
e7eab833
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
ts/nni_manager/core/nnimanager.ts
ts/nni_manager/core/nnimanager.ts
+6
-1
ts/nni_manager/training_service/local/localTrainingService.ts
...ni_manager/training_service/local/localTrainingService.ts
+3
-3
No files found.
ts/nni_manager/core/nnimanager.ts
View file @
e99c579b
...
...
@@ -681,7 +681,12 @@ class NNIManager implements Manager {
this
.
currSubmittedTrialNum
++
;
this
.
log
.
info
(
'
submitTrialJob: form:
'
,
form
);
const
trialJobDetail
:
TrialJobDetail
=
await
this
.
trainingService
.
submitTrialJob
(
form
);
setTimeout
(
async
()
=>
this
.
stopTrialJobIfOverMaxDurationTimer
(
trialJobDetail
.
id
),
1000
*
this
.
maxTrialDuration
);
if
(
this
.
maxTrialDuration
!==
Infinity
){
// Fix timeout warning : Infinity does not fit into a 32-bit signed integer(2147483647).
const
duration
=
(
this
.
maxTrialDuration
*
1000
)
>
2147483647
?
2147483647
:
this
.
maxTrialDuration
*
1000
;
setTimeout
(
async
()
=>
this
.
stopTrialJobIfOverMaxDurationTimer
(
trialJobDetail
.
id
),
duration
);
}
const
Snapshot
:
TrialJobDetail
=
Object
.
assign
({},
trialJobDetail
);
await
this
.
storeExperimentProfile
();
this
.
trialJobs
.
set
(
trialJobDetail
.
id
,
Snapshot
);
...
...
ts/nni_manager/training_service/local/localTrainingService.ts
View file @
e99c579b
...
...
@@ -237,8 +237,10 @@ class LocalTrainingService implements TrainingService {
return
Promise
.
resolve
();
}
tkill
(
trialJob
.
pid
,
'
SIGTERM
'
);
this
.
setTrialJobStatus
(
trialJob
,
getJobCancelStatus
(
isEarlyStopped
));
const
startTime
=
Date
.
now
();
while
(
await
isAlive
(
trialJob
.
pid
))
{
while
(
await
isAlive
(
trialJob
.
pid
))
{
if
(
Date
.
now
()
-
startTime
>
4999
)
{
tkill
(
trialJob
.
pid
,
'
SIGKILL
'
,
(
err
)
=>
{
if
(
err
)
{
...
...
@@ -250,8 +252,6 @@ class LocalTrainingService implements TrainingService {
await
delay
(
500
);
}
this
.
setTrialJobStatus
(
trialJob
,
getJobCancelStatus
(
isEarlyStopped
));
return
Promise
.
resolve
();
}
...
...
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