Unverified Commit f322548f authored by chicm-ms's avatar chicm-ms Committed by GitHub
Browse files

Merge pull request #30 from microsoft/master

pull code
parents cb361b34 797f0e2c
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
} }
/* add the brother selector to increase the priority */ /* add the brother selector to increase the priority */
#succeTable .commonTableStyle, #tableList .commonTableStyle { #succeTable .commonTableStyle, #tableList .commonTableStyle {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
tr{ tr{
text-align: center; text-align: center;
color:#212121; color:#212121;
......
...@@ -2,9 +2,14 @@ import time ...@@ -2,9 +2,14 @@ import time
import nni import nni
if __name__ == '__main__': if __name__ == '__main__':
hyper_params = nni.get_next_parameter() nni.get_next_parameter()
for i in range(10): for i in range(10):
if i % 2 == 0:
print('report intermediate result without end of line.', end='')
else:
print('report intermediate result.')
nni.report_intermediate_result(0.1*(i+1)) nni.report_intermediate_result(0.1*(i+1))
time.sleep(2) time.sleep(2)
print('test final metrics not at line start.', end='')
nni.report_final_result(1.0) nni.report_final_result(1.0)
print('done')
...@@ -76,4 +76,5 @@ jobs: ...@@ -76,4 +76,5 @@ jobs:
--nni_docker_image $TEST_IMG --data_dir $(data_dir) --output_dir $(output_dir) --nni_manager_ip $(nni_manager_ip) --nni_docker_image $TEST_IMG --data_dir $(data_dir) --output_dir $(output_dir) --nni_manager_ip $(nni_manager_ip)
PATH=$HOME/.local/bin:$PATH python3 config_test.py --ts pai --exclude multi_phase_batch,multi_phase_grid PATH=$HOME/.local/bin:$PATH python3 config_test.py --ts pai --exclude multi_phase_batch,multi_phase_grid
PATH=$HOME/.local/bin:$PATH python3 metrics_test.py
displayName: 'integration test' displayName: 'integration test'
...@@ -53,6 +53,7 @@ jobs: ...@@ -53,6 +53,7 @@ jobs:
--remote_port $(cat port) --remote_pwd $(docker_pwd) --nni_manager_ip $(nni_manager_ip) --remote_port $(cat port) --remote_pwd $(docker_pwd) --nni_manager_ip $(nni_manager_ip)
cat training_service.yml cat training_service.yml
PATH=$HOME/.local/bin:$PATH python3 config_test.py --ts remote --exclude cifar10,multi_phase_batch,multi_phase_grid PATH=$HOME/.local/bin:$PATH python3 config_test.py --ts remote --exclude cifar10,multi_phase_batch,multi_phase_grid
PATH=$HOME/.local/bin:$PATH python3 metrics_test.py
displayName: 'integration test' displayName: 'integration test'
- task: SSH@0 - task: SSH@0
inputs: inputs:
......
...@@ -34,12 +34,12 @@ DEFAULT_REST_PORT = 8080 ...@@ -34,12 +34,12 @@ DEFAULT_REST_PORT = 8080
REST_TIME_OUT = 20 REST_TIME_OUT = 20
EXPERIMENT_SUCCESS_INFO = Fore.GREEN + 'Successfully started experiment!\n' + Fore.RESET + \ EXPERIMENT_SUCCESS_INFO = Fore.GREEN + 'Successfully started experiment!\n' + Fore.RESET + \
'-----------------------------------------------------------------------\n' \ '------------------------------------------------------------------------------------\n' \
'The experiment id is %s\n'\ 'The experiment id is %s\n'\
'The Web UI urls are: %s\n' \ 'The Web UI urls are: %s\n' \
'-----------------------------------------------------------------------\n\n' \ '------------------------------------------------------------------------------------\n\n' \
'You can use these commands to get more information about the experiment\n' \ 'You can use these commands to get more information about the experiment\n' \
'-----------------------------------------------------------------------\n' \ '------------------------------------------------------------------------------------\n' \
' commands description\n' \ ' commands description\n' \
'1. nnictl experiment show show the information of experiments\n' \ '1. nnictl experiment show show the information of experiments\n' \
'2. nnictl trial ls list all of trial jobs\n' \ '2. nnictl trial ls list all of trial jobs\n' \
...@@ -49,7 +49,9 @@ EXPERIMENT_SUCCESS_INFO = Fore.GREEN + 'Successfully started experiment!\n' + Fo ...@@ -49,7 +49,9 @@ EXPERIMENT_SUCCESS_INFO = Fore.GREEN + 'Successfully started experiment!\n' + Fo
'6. nnictl stop stop an experiment\n' \ '6. nnictl stop stop an experiment\n' \
'7. nnictl trial kill kill a trial job by id\n' \ '7. nnictl trial kill kill a trial job by id\n' \
'8. nnictl --help get help information about nnictl\n' \ '8. nnictl --help get help information about nnictl\n' \
'-----------------------------------------------------------------------\n' \ '------------------------------------------------------------------------------------\n' \
'Command reference document https://nni.readthedocs.io/en/latest/Tutorial/Nnictl.html\n' \
'------------------------------------------------------------------------------------\n'
LOG_HEADER = '-----------------------------------------------------------------------\n' \ LOG_HEADER = '-----------------------------------------------------------------------\n' \
' Experiment start time %s\n' \ ' Experiment start time %s\n' \
......
...@@ -151,7 +151,7 @@ def parse_ids(args): ...@@ -151,7 +151,7 @@ def parse_ids(args):
exit(1) exit(1)
else: else:
result_list = running_experiment_list result_list = running_experiment_list
elif args.all: elif args.id == 'all':
result_list = running_experiment_list result_list = running_experiment_list
elif args.id.endswith('*'): elif args.id.endswith('*'):
for id in running_experiment_list: for id in running_experiment_list:
...@@ -166,7 +166,7 @@ def parse_ids(args): ...@@ -166,7 +166,7 @@ def parse_ids(args):
if len(result_list) > 1: if len(result_list) > 1:
print_error(args.id + ' is ambiguous, please choose ' + ' '.join(result_list) ) print_error(args.id + ' is ambiguous, please choose ' + ' '.join(result_list) )
return None return None
if not result_list and args.id: if not result_list and args.id and args.id != 'all':
print_error('There are no experiments matched, please set correct experiment id...') print_error('There are no experiments matched, please set correct experiment id...')
elif not result_list: elif not result_list:
print_error('There is no experiment running...') print_error('There is no experiment running...')
......
...@@ -67,7 +67,7 @@ def trial_jobs_url(port): ...@@ -67,7 +67,7 @@ def trial_jobs_url(port):
def trial_job_id_url(port, job_id): def trial_job_id_url(port, job_id):
'''get trial_jobs with id url''' '''get trial_jobs with id url'''
return '{0}:{1}{2}{3}/:{4}'.format(BASE_URL, port, API_ROOT_URL, TRIAL_JOBS_API, job_id) return '{0}:{1}{2}{3}/{4}'.format(BASE_URL, port, API_ROOT_URL, TRIAL_JOBS_API, job_id)
def export_data_url(port): def export_data_url(port):
...@@ -87,4 +87,4 @@ def get_local_urls(port): ...@@ -87,4 +87,4 @@ def get_local_urls(port):
for addr in info: for addr in info:
if AddressFamily.AF_INET == addr.family: if AddressFamily.AF_INET == addr.family:
url_list.append('http://{}:{}'.format(addr.address, port)) url_list.append('http://{}:{}'.format(addr.address, port))
return url_list return url_list
\ No newline at end of file
...@@ -134,7 +134,7 @@ class PipeLogReader(threading.Thread): ...@@ -134,7 +134,7 @@ class PipeLogReader(threading.Thread):
self._is_read_completed = False self._is_read_completed = False
self.process_exit = False self.process_exit = False
self.log_collection = log_collection self.log_collection = log_collection
self.log_pattern = re.compile(r'^NNISDK_MEb\'.*\'$') self.log_pattern = re.compile(r'NNISDK_MEb\'.*\'$')
def _populateQueue(stream, queue): def _populateQueue(stream, queue):
''' '''
...@@ -172,11 +172,14 @@ class PipeLogReader(threading.Thread): ...@@ -172,11 +172,14 @@ class PipeLogReader(threading.Thread):
for line in iter(self.pipeReader.readline, ''): for line in iter(self.pipeReader.readline, ''):
self.orig_stdout.write(line.rstrip() + '\n') self.orig_stdout.write(line.rstrip() + '\n')
self.orig_stdout.flush() self.orig_stdout.flush()
if self.log_collection == 'none': if self.log_collection == 'none':
# If not match metrics, do not put the line into queue search_result = self.log_pattern.search(line)
if not self.log_pattern.match(line): if search_result:
continue metrics = search_result.group(0)
self.queue.put(line) self.queue.put(metrics+'\n')
else:
self.queue.put(line)
self.pipeReader.close() self.pipeReader.close()
......
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