Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Fix localTrainingService cancel logic and nnictl logic #334

Merged
merged 105 commits into from
Nov 9, 2018
Merged
Show file tree
Hide file tree
Changes from 100 commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
dc780cd
Merge pull request #1 from Microsoft/master
SparkSnail Sep 14, 2018
86243e7
Merge pull request #2 from Microsoft/master
SparkSnail Sep 14, 2018
3d1e4e9
fix nnictl bug
Sep 14, 2018
6d09780
Merge pull request #4 from Microsoft/master
SparkSnail Sep 17, 2018
0d24158
Merge branch 'master' of https://github.com/SparkSnail/nni
Sep 18, 2018
6d669c6
Merge pull request #6 from Microsoft/master
SparkSnail Sep 19, 2018
af2615d
Merge pull request #8 from Microsoft/master
SparkSnail Sep 20, 2018
f6b7c0a
Merge pull request #9 from Microsoft/master
SparkSnail Sep 24, 2018
a74febc
Merge pull request #10 from Microsoft/master
SparkSnail Sep 25, 2018
334b0a4
Merge pull request #12 from Microsoft/master
SparkSnail Sep 27, 2018
efe93df
Merge pull request #13 from Microsoft/master
SparkSnail Sep 27, 2018
0d9b074
Merge branch 'master' of https://github.com/SparkSnail/nni
Sep 28, 2018
421ad1a
Merge pull request #16 from Microsoft/master
SparkSnail Sep 30, 2018
660a8f8
Merge branch 'master' of https://github.com/SparkSnail/nni
Sep 30, 2018
2b01089
fix install.sh
Sep 30, 2018
951e80e
Merge pull request #17 from Microsoft/master
SparkSnail Oct 1, 2018
90fe674
Merge pull request #18 from Microsoft/master
SparkSnail Oct 7, 2018
2ccf0ed
Merge pull request #19 from Microsoft/master
SparkSnail Oct 8, 2018
77aacee
Merge pull request #20 from Microsoft/master
SparkSnail Oct 8, 2018
9e23dfe
Merge pull request #22 from Microsoft/master
SparkSnail Oct 8, 2018
ca7bbe4
Merge pull request #24 from Microsoft/master
SparkSnail Oct 10, 2018
346badd
add desc for Dockerfile.build.base
Oct 10, 2018
4af27d6
Merge pull request #27 from Microsoft/master
SparkSnail Oct 11, 2018
46a8350
update document for Dockerfile
Oct 11, 2018
4e3697f
Merge pull request #29 from Microsoft/master
SparkSnail Oct 12, 2018
4cd95aa
Merge pull request #30 from Microsoft/master
SparkSnail Oct 15, 2018
405ce45
Merge pull request #31 from Microsoft/master
SparkSnail Oct 15, 2018
c3949e6
Merge pull request #32 from Microsoft/master
SparkSnail Oct 16, 2018
22c78fd
Merge pull request #33 from Microsoft/master
SparkSnail Oct 16, 2018
a870817
update
Oct 16, 2018
b45268c
refactor port detect
Oct 16, 2018
59626ec
update
Oct 16, 2018
31ea28b
Merge pull request #34 from Microsoft/master
SparkSnail Oct 16, 2018
2ca84c5
refactor NNICTLDOC.md
Oct 17, 2018
ab02c93
add document for pai and nnictl
Oct 17, 2018
5ff7b45
add default value for port
Oct 17, 2018
c1e835d
Merge pull request #35 from Microsoft/master
SparkSnail Oct 18, 2018
5ae146d
add exception handling in trial_keeper.py
Oct 18, 2018
1dde461
fix port bug
Oct 18, 2018
fe6a188
Merge pull request #36 from Microsoft/master
SparkSnail Oct 18, 2018
f7a5228
Merge pull request #37 from Microsoft/master
SparkSnail Oct 19, 2018
9fdf6d4
fix resume
Oct 19, 2018
c1285f8
fix nnictl resume and fix nnictl stop
Oct 19, 2018
af0d081
fix document
Oct 19, 2018
7ce8fd8
update
Oct 19, 2018
b29aaed
refactor nnictl
Oct 19, 2018
683833b
update
Oct 19, 2018
6149bf9
update doc
Oct 22, 2018
73bef2f
update
Oct 22, 2018
5c397f6
update nnictl
Oct 23, 2018
2c68171
fix comment
Oct 23, 2018
d0659d6
fix conflict
Oct 23, 2018
e64abbf
Merge branch 'Microsoft-master'
Oct 23, 2018
a70f7e7
Merge pull request #39 from Microsoft/master
SparkSnail Oct 23, 2018
8d14ca9
revert dockerfile
Oct 23, 2018
aeb7c66
update
Oct 23, 2018
a256549
update
Oct 23, 2018
3fb0bca
update
Oct 23, 2018
e116af4
Merge pull request #40 from Microsoft/master
SparkSnail Oct 23, 2018
f4edebc
Merge pull request #41 from Microsoft/master
SparkSnail Oct 24, 2018
9413d77
Merge pull request #42 from Microsoft/master
SparkSnail Oct 25, 2018
c0663e8
Merge pull request #43 from Microsoft/master
SparkSnail Oct 25, 2018
357545b
Merge pull request #44 from Microsoft/master
SparkSnail Oct 26, 2018
e8dec33
Merge pull request #45 from Microsoft/master
SparkSnail Oct 27, 2018
46bf7b4
fix nnictl error hit
Oct 30, 2018
7fd0ac3
Merge pull request #46 from Microsoft/master
SparkSnail Oct 30, 2018
4cc7d92
Merge branch 'master' of https://github.com/SparkSnail/nni
Oct 30, 2018
55701a2
fix comments
Oct 30, 2018
25d1c22
Merge pull request #47 from Microsoft/master
SparkSnail Oct 30, 2018
b6b45d1
fix bash-completion
Oct 30, 2018
04c03a4
fix paramiko install
Oct 31, 2018
72f0e45
Merge pull request #48 from Microsoft/master
SparkSnail Oct 31, 2018
7c91af9
quick fix resume logic
Oct 31, 2018
26ef462
update
Oct 31, 2018
8237228
Merge pull request #49 from Microsoft/master
SparkSnail Oct 31, 2018
3404415
Merge pull request #52 from Microsoft/master
SparkSnail Nov 1, 2018
cbee322
fix nnictl in master
Nov 1, 2018
0d67eca
update
Nov 1, 2018
a982ed0
update
Nov 1, 2018
5d44f7b
update
Nov 1, 2018
88072dc
update
Nov 1, 2018
12a3e21
Merge pull request #53 from Microsoft/master
SparkSnail Nov 1, 2018
e4b2082
remove paramiko
Nov 2, 2018
53167b4
update
Nov 2, 2018
384a159
Merge pull request #57 from Microsoft/master
SparkSnail Nov 2, 2018
96ad3ed
refactor requirement.txt of sklearn
Nov 2, 2018
cb9d74e
Merge branch 'master' into master
SparkSnail Nov 2, 2018
8a026cc
update
Nov 2, 2018
369a303
Merge branch 'master' of https://github.com/SparkSnail/nni
Nov 2, 2018
7499de7
fix readme.md
Nov 2, 2018
78ee31c
update
Nov 2, 2018
e7245f8
update
Nov 2, 2018
775701a
update
Nov 2, 2018
1520a3e
fix conflict
Nov 5, 2018
0a3c103
Merge branch 'Microsoft-master'
Nov 5, 2018
4dbbb90
fix conflict
Nov 5, 2018
3eb8ea0
Merge branch 'Microsoft-master'
Nov 5, 2018
c34809d
add HowToContribute.md
Nov 5, 2018
cfca9f2
add port in experiment list
Nov 7, 2018
f31b27b
fix localTrainingService stop logic
Nov 7, 2018
84fe396
support pai port
Nov 7, 2018
b12ed90
update
Nov 7, 2018
0ebbb29
Merge pull request #61 from Microsoft/master
SparkSnail Nov 9, 2018
5123ab1
update
Nov 9, 2018
9771511
update
Nov 9, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions src/nni_manager/training_service/local/localTrainingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,16 @@ class LocalTrainingService implements TrainingService {
while (!this.stopping) {
while (this.jobQueue.length !== 0) {
const trialJobId: string = this.jobQueue[0];
const [success, resource] = this.tryGetAvailableResource();
if (!success) {
break;
const trialJobDeatil = this.jobMap.get(trialJobId)
if (trialJobDeatil !== undefined && trialJobDeatil.status === 'WAITING'){
const [success, resource] = this.tryGetAvailableResource();
if (!success) {
break;
}
this.occupyResource(resource);
this.jobQueue.shift();
await this.runTrialJob(trialJobId, resource);
}
this.occupyResource(resource);
this.jobQueue.shift();
await this.runTrialJob(trialJobId, resource);
}
await delay(5000);
}
Expand Down Expand Up @@ -249,9 +252,14 @@ class LocalTrainingService implements TrainingService {
if (trialJob === undefined) {
throw new NNIError(NNIErrorNames.NOT_FOUND, 'Trial job not found');
}
if (trialJob.pid === undefined){
this.setTrialJobStatus(trialJob, 'USER_CANCELED');
return;
}
if (trialJob.form.jobType === 'TRIAL') {
await tkill(trialJob.pid, 'SIGKILL');
} else if (trialJob.form.jobType === 'HOST') {
}
else if (trialJob.form.jobType === 'HOST') {
await cpp.exec(`pkill -9 -P ${trialJob.pid}`);
} else {
throw new Error(`Job type not supported: ${trialJob.form.jobType}`);
Expand Down
2 changes: 1 addition & 1 deletion tools/nni_cmd/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
'%s\n' \
'-----------------------------------------------------------------------\n'

EXPERIMENT_DETAIL_FORMAT = 'Id: %s Status: %s StartTime: %s EndTime: %s \n'
EXPERIMENT_DETAIL_FORMAT = 'Id: %s Status: %s Port: %s StartTime: %s EndTime: %s \n'

PACKAGE_REQUIREMENTS = {
'SMAC': 'smac_tuner'
Expand Down
4 changes: 3 additions & 1 deletion tools/nni_cmd/launcher_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ def validate_common_content(experiment_config):
experiment_config['machineList'][index]['port'] = 22

except Exception as exception:
raise Exception(exception)
print_error('Your config file is not correct, please check your config file content!')
print_error('Information:\n%s' % exception)
exit(1)

def parse_tuner_content(experiment_config):
'''Validate whether tuner in experiment_config is valid'''
Expand Down
7 changes: 5 additions & 2 deletions tools/nni_cmd/nnictl_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ def stop_experiment(args):
if running:
response = rest_delete(experiment_url(rest_port), 20)
if not response or not check_response(response):
print_error('Stop experiment failed!')
if response:
print_error(response.text)
else:
print_error('No response from restful server!')
stop_rest_result = False
#sleep to wait rest handler done
time.sleep(3)
Expand Down Expand Up @@ -365,7 +368,7 @@ def experiment_list(args):
print_warning('There is no experiment running...\nYou can use \'nnictl experiment list all\' to list all stopped experiments!')
experiment_information = ""
for key in experiment_id_list:
experiment_information += (EXPERIMENT_DETAIL_FORMAT % (key, experiment_dict[key]['status'], \
experiment_information += (EXPERIMENT_DETAIL_FORMAT % (key, experiment_dict[key]['status'], experiment_dict[key]['port'],\
experiment_dict[key]['startTime'], experiment_dict[key]['endTime']))
print(EXPERIMENT_INFORMATION_FORMAT % experiment_information)