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
77dac12b
Unverified
Commit
77dac12b
authored
Oct 23, 2020
by
QuanluZhang
Committed by
GitHub
Oct 23, 2020
Browse files
Merge pull request #3023 from microsoft/v1.9
[do not squash!] merge v1.9 back to master
parents
c2e69672
98a72a1e
Changes
126
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
7 deletions
+22
-7
test/nni_test/nnitest/generate_ts_config.py
test/nni_test/nnitest/generate_ts_config.py
+3
-0
test/pipelines/pipelines-it-remote-linux-to-linux.yml
test/pipelines/pipelines-it-remote-linux-to-linux.yml
+1
-1
test/pipelines/pipelines-it-remote-windows-to-linux.yml
test/pipelines/pipelines-it-remote-windows-to-linux.yml
+1
-1
tools/nni_annotation/test_annotation.py
tools/nni_annotation/test_annotation.py
+3
-1
tools/nni_cmd/launcher.py
tools/nni_cmd/launcher.py
+5
-0
tools/nni_trial_tool/trial.py
tools/nni_trial_tool/trial.py
+9
-4
No files found.
test/nni_test/nnitest/generate_ts_config.py
View file @
77dac12b
...
@@ -86,6 +86,8 @@ def update_training_service_config(args):
...
@@ -86,6 +86,8 @@ def update_training_service_config(args):
config
[
args
.
ts
][
'machineList'
][
0
][
'port'
]
=
args
.
remote_port
config
[
args
.
ts
][
'machineList'
][
0
][
'port'
]
=
args
.
remote_port
if
args
.
remote_pwd
is
not
None
:
if
args
.
remote_pwd
is
not
None
:
config
[
args
.
ts
][
'machineList'
][
0
][
'passwd'
]
=
args
.
remote_pwd
config
[
args
.
ts
][
'machineList'
][
0
][
'passwd'
]
=
args
.
remote_pwd
if
args
.
remote_reuse
is
not
None
:
config
[
args
.
ts
][
'remoteConfig'
][
'reuse'
]
=
args
.
remote_reuse
.
lower
()
==
'true'
dump_yml_content
(
TRAINING_SERVICE_FILE
,
config
)
dump_yml_content
(
TRAINING_SERVICE_FILE
,
config
)
...
@@ -119,6 +121,7 @@ if __name__ == '__main__':
...
@@ -119,6 +121,7 @@ if __name__ == '__main__':
parser
.
add_argument
(
"--remote_pwd"
,
type
=
str
)
parser
.
add_argument
(
"--remote_pwd"
,
type
=
str
)
parser
.
add_argument
(
"--remote_host"
,
type
=
str
)
parser
.
add_argument
(
"--remote_host"
,
type
=
str
)
parser
.
add_argument
(
"--remote_port"
,
type
=
int
)
parser
.
add_argument
(
"--remote_port"
,
type
=
int
)
parser
.
add_argument
(
"--remote_reuse"
,
type
=
str
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
update_training_service_config
(
args
)
update_training_service_config
(
args
)
test/pipelines/pipelines-it-remote-linux-to-linux.yml
View file @
77dac12b
...
@@ -62,7 +62,7 @@ jobs:
...
@@ -62,7 +62,7 @@ jobs:
-
script
:
|
-
script
:
|
set -e
set -e
cd test
cd test
python3 nni_test/nnitest/generate_ts_config.py --ts remote --remote_user $(docker_user) --remote_host $(remote_host) \
python3 nni_test/nnitest/generate_ts_config.py --ts remote
--remote_reuse $(remote_reuse)
--remote_user $(docker_user) --remote_host $(remote_host) \
--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 config/training_service.yml
cat config/training_service.yml
PATH=$HOME/.local/bin:$PATH python3 nni_test/nnitest/run_tests.py --config config/integration_tests.yml --ts remote
PATH=$HOME/.local/bin:$PATH python3 nni_test/nnitest/run_tests.py --config config/integration_tests.yml --ts remote
...
...
test/pipelines/pipelines-it-remote-windows-to-linux.yml
View file @
77dac12b
...
@@ -48,7 +48,7 @@ jobs:
...
@@ -48,7 +48,7 @@ jobs:
displayName
:
'
Get
docker
port'
displayName
:
'
Get
docker
port'
-
powershell
:
|
-
powershell
:
|
cd test
cd test
python nni_test/nnitest/generate_ts_config.py --ts remote --remote_user $(docker_user) --remote_host $(remote_host) --remote_port $(Get-Content port) --remote_pwd $(docker_pwd) --nni_manager_ip $(nni_manager_ip)
python nni_test/nnitest/generate_ts_config.py --ts remote
--remote_reuse $(remote_reuse)
--remote_user $(docker_user) --remote_host $(remote_host) --remote_port $(Get-Content port) --remote_pwd $(docker_pwd) --nni_manager_ip $(nni_manager_ip)
Get-Content config/training_service.yml
Get-Content config/training_service.yml
python nni_test/nnitest/run_tests.py --config config/integration_tests.yml --ts remote --exclude cifar10
python nni_test/nnitest/run_tests.py --config config/integration_tests.yml --ts remote --exclude cifar10
displayName
:
'
integration
test'
displayName
:
'
integration
test'
...
...
tools/nni_annotation/test_annotation.py
View file @
77dac12b
...
@@ -5,12 +5,13 @@
...
@@ -5,12 +5,13 @@
from
.__init__
import
*
from
.__init__
import
*
import
sys
import
ast
import
ast
import
json
import
json
import
os
import
os
import
shutil
import
shutil
import
tempfile
import
tempfile
from
unittest
import
TestCase
,
main
from
unittest
import
TestCase
,
main
,
skipIf
class
AnnotationTestCase
(
TestCase
):
class
AnnotationTestCase
(
TestCase
):
...
@@ -26,6 +27,7 @@ class AnnotationTestCase(TestCase):
...
@@ -26,6 +27,7 @@ class AnnotationTestCase(TestCase):
with
open
(
'testcase/searchspace.json'
)
as
f
:
with
open
(
'testcase/searchspace.json'
)
as
f
:
self
.
assertEqual
(
search_space
,
json
.
load
(
f
))
self
.
assertEqual
(
search_space
,
json
.
load
(
f
))
@
skipIf
(
sys
.
version_info
.
major
==
3
and
sys
.
version_info
.
minor
>
7
,
"skip for python3.8 temporarily"
)
def
test_code_generator
(
self
):
def
test_code_generator
(
self
):
code_dir
=
expand_annotations
(
'testcase/usercode'
,
'_generated/usercode'
,
nas_mode
=
'classic_mode'
)
code_dir
=
expand_annotations
(
'testcase/usercode'
,
'_generated/usercode'
,
nas_mode
=
'classic_mode'
)
self
.
assertEqual
(
code_dir
,
'_generated/usercode'
)
self
.
assertEqual
(
code_dir
,
'_generated/usercode'
)
...
...
tools/nni_cmd/launcher.py
View file @
77dac12b
...
@@ -371,6 +371,11 @@ def set_experiment(experiment_config, mode, port, config_file_name):
...
@@ -371,6 +371,11 @@ def set_experiment(experiment_config, mode, port, config_file_name):
{
'key'
:
'frameworkcontroller_config'
,
'value'
:
experiment_config
[
'frameworkcontrollerConfig'
]})
{
'key'
:
'frameworkcontroller_config'
,
'value'
:
experiment_config
[
'frameworkcontrollerConfig'
]})
request_data
[
'clusterMetaData'
].
append
(
request_data
[
'clusterMetaData'
].
append
(
{
'key'
:
'trial_config'
,
'value'
:
experiment_config
[
'trial'
]})
{
'key'
:
'trial_config'
,
'value'
:
experiment_config
[
'trial'
]})
elif
experiment_config
[
'trainingServicePlatform'
]
==
'aml'
:
request_data
[
'clusterMetaData'
].
append
(
{
'key'
:
'aml_config'
,
'value'
:
experiment_config
[
'amlConfig'
]})
request_data
[
'clusterMetaData'
].
append
(
{
'key'
:
'trial_config'
,
'value'
:
experiment_config
[
'trial'
]})
response
=
rest_post
(
experiment_url
(
port
),
json
.
dumps
(
request_data
),
REST_TIME_OUT
,
show_error
=
True
)
response
=
rest_post
(
experiment_url
(
port
),
json
.
dumps
(
request_data
),
REST_TIME_OUT
,
show_error
=
True
)
if
check_response
(
response
):
if
check_response
(
response
):
return
response
return
response
...
...
tools/nni_trial_tool/trial.py
View file @
77dac12b
...
@@ -137,10 +137,15 @@ class Trial:
...
@@ -137,10 +137,15 @@ class Trial:
def
kill
(
self
,
trial_id
=
None
):
def
kill
(
self
,
trial_id
=
None
):
if
trial_id
==
self
.
id
or
trial_id
is
None
:
if
trial_id
==
self
.
id
or
trial_id
is
None
:
if
self
.
process
is
not
None
:
if
self
.
process
is
not
None
:
nni_log
(
LogType
.
Info
,
"%s: killing trial"
%
self
.
name
)
try
:
for
child
in
psutil
.
Process
(
self
.
process
.
pid
).
children
(
True
):
nni_log
(
LogType
.
Info
,
"%s: killing trial"
%
self
.
name
)
child
.
kill
()
for
child
in
psutil
.
Process
(
self
.
process
.
pid
).
children
(
True
):
self
.
process
.
kill
()
child
.
kill
()
self
.
process
.
kill
()
except
psutil
.
NoSuchProcess
:
nni_log
(
LogType
.
Info
,
"kill trial %s failed: %s does not exist!"
%
(
trial_id
,
self
.
process
.
pid
))
except
Exception
as
ex
:
nni_log
(
LogType
.
Error
,
"kill trial %s failed: %s "
%
(
trial_id
,
str
(
ex
)))
self
.
cleanup
()
self
.
cleanup
()
def
cleanup
(
self
):
def
cleanup
(
self
):
...
...
Prev
1
…
3
4
5
6
7
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