-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Conversation
suiguoxin
commented
Jul 24, 2019
- only failed jobs can be re-submitted
- no trial_id returned when re-submitted successfully
- else raise err
src/nni_manager/core/nniDataStore.ts
Outdated
@@ -141,6 +141,7 @@ class NNIDataStore implements DataStore { | |||
|
|||
public async getTrialJob(trialJobId: string): Promise<TrialJobInfo> { | |||
const trialJobs: TrialJobInfo[] = await this.queryTrialJobs(undefined, trialJobId); | |||
assert(trialJobs.length <= 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if trialJobs.length == 0, then asseration is right but will crash when take value "trialJobs[0]" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -168,6 +169,9 @@ def handle_initialize(self, data): | |||
def handle_request_trial_jobs(self, data): | |||
raise NotImplementedError('handle_request_trial_jobs not implemented') | |||
|
|||
def handle_resubmit_trial_job(self, data): | |||
raise NotImplementedError('handle_resubmit_trial_job not implemented') | |||
|
|||
def handle_update_search_space(self, data): | |||
raise NotImplementedError('handle_update_search_space not implemented') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Irrelevant to this PR. The indentation is mistyped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why irrelevant ? Which indentation ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -103,6 +103,7 @@ abstract class Manager { | |||
public abstract exportData(): Promise<string>; | |||
|
|||
public abstract addCustomizedTrialJob(hyperParams: string): Promise<void>; | |||
public abstract resubmitTrialJob(hyperParams: string): Promise<void>; | |||
public abstract cancelTrialJobByUser(trialJobId: string): Promise<void>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the parameter should be trial job id as we discussed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/nni_manager/core/nnimanager.ts
Outdated
@@ -135,6 +135,42 @@ class NNIManager implements Manager { | |||
return this.dataStore.storeTrialJobEvent('ADD_CUSTOMIZED', '', hyperParams); | |||
} | |||
|
|||
public async resubmitTrialJob(data: string): Promise<void> { | |||
// get trail job info by jobId | |||
const trialJobId = JSON.parse(data).job_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter should be trial job id, it should not need to be parsed inside this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/nni_manager/core/nnimanager.ts
Outdated
return Promise.reject( | ||
new Error('only failed trials can be resubmitted') | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This status checking can be moved up to before retrieving hyperParameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed