Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
cb25d66e
Unverified
Commit
cb25d66e
authored
Jul 18, 2019
by
SparkSnail
Committed by
GitHub
Jul 18, 2019
Browse files
Merge pull request #190 from microsoft/master
merge master
parents
9fb25ccc
7ee86e1d
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
13 deletions
+25
-13
test/metrics_test/trial.py
test/metrics_test/trial.py
+7
-2
test/pipelines-it-pai.yml
test/pipelines-it-pai.yml
+1
-0
test/pipelines-it-remote.yml
test/pipelines-it-remote.yml
+1
-0
tools/nni_cmd/constants.py
tools/nni_cmd/constants.py
+6
-4
tools/nni_cmd/nnictl_utils.py
tools/nni_cmd/nnictl_utils.py
+2
-2
tools/nni_trial_tool/log_utils.py
tools/nni_trial_tool/log_utils.py
+8
-5
No files found.
test/metrics_test/trial.py
View file @
cb25d66e
...
@@ -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'
)
test/pipelines-it-pai.yml
View file @
cb25d66e
...
@@ -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'
test/pipelines-it-remote.yml
View file @
cb25d66e
...
@@ -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
:
...
...
tools/nni_cmd/constants.py
View file @
cb25d66e
...
@@ -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
'
\
...
...
tools/nni_cmd/nnictl_utils.py
View file @
cb25d66e
...
@@ -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...'
)
...
...
tools/nni_trial_tool/log_utils.py
View file @
cb25d66e
...
@@ -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
()
...
...
Prev
1
2
Next
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