Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
f98ee672
Unverified
Commit
f98ee672
authored
Oct 20, 2020
by
liuzhe-lz
Committed by
GitHub
Oct 20, 2020
Browse files
[v2.0] Refactor code hierarchy (part 1) (#2962)
parent
f1105409
Changes
645
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
54 additions
and
33 deletions
+54
-33
nni/utils.py
nni/utils.py
+0
-0
nni_node/__init__.py
nni_node/__init__.py
+8
-0
setup.py
setup.py
+28
-15
test/config/integration_tests.yml
test/config/integration_tests.yml
+2
-2
test/config/integration_tests_tf2.yml
test/config/integration_tests_tf2.yml
+2
-2
test/config/pr_tests.yml
test/config/pr_tests.yml
+2
-2
test/nni_test/nnitest/validators.py
test/nni_test/nnitest/validators.py
+2
-2
test/scripts/unittest.sh
test/scripts/unittest.sh
+10
-10
ts/nasui/.gitignore
ts/nasui/.gitignore
+0
-0
ts/nasui/assets/darts/graph.json
ts/nasui/assets/darts/graph.json
+0
-0
ts/nasui/assets/darts/log
ts/nasui/assets/darts/log
+0
-0
ts/nasui/assets/naive/graph.json
ts/nasui/assets/naive/graph.json
+0
-0
ts/nasui/assets/naive/log
ts/nasui/assets/naive/log
+0
-0
ts/nasui/package.json
ts/nasui/package.json
+0
-0
ts/nasui/public/icon.png
ts/nasui/public/icon.png
+0
-0
ts/nasui/public/index.html
ts/nasui/public/index.html
+0
-0
ts/nasui/server.js
ts/nasui/server.js
+0
-0
ts/nasui/src/App.css
ts/nasui/src/App.css
+0
-0
ts/nasui/src/App.tsx
ts/nasui/src/App.tsx
+0
-0
ts/nasui/src/Chart.tsx
ts/nasui/src/Chart.tsx
+0
-0
No files found.
src/sdk/pynni/
nni/utils.py
→
nni/utils.py
View file @
f98ee672
File moved
nni_node/__init__.py
0 → 100644
View file @
f98ee672
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
"""
TypeScript modules of NNI.
As a python package this only contains "package data".
"""
setup.py
View file @
f98ee672
...
@@ -2,31 +2,44 @@
...
@@ -2,31 +2,44 @@
# Licensed under the MIT license.
# Licensed under the MIT license.
import
os
import
os
from
setuptools
import
setup
,
find_packages
from
setuptools
import
setup
version
=
'999.0.0-developing'
def
_find_python_packages
():
packages
=
[]
for
dirpath
,
dirnames
,
filenames
in
os
.
walk
(
'nni'
):
if
'/__pycache__'
not
in
dirpath
:
packages
.
append
(
dirpath
.
replace
(
'/'
,
'.'
))
return
sorted
(
packages
)
+
[
'nni_node'
]
def
_find_node_files
():
files
=
[]
for
dirpath
,
dirnames
,
filenames
in
os
.
walk
(
'nni_node'
):
for
filename
in
filenames
:
files
.
append
((
dirpath
+
'/'
+
filename
)[
len
(
'nni_node/'
):])
files
.
remove
(
'__init__.py'
)
return
sorted
(
files
)
def
read
(
fname
):
return
open
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
fname
),
encoding
=
'utf-8'
).
read
()
setup
(
setup
(
name
=
'nni'
,
name
=
'nni'
,
version
=
'999.0.0-developing'
,
version
=
version
,
author
=
'Microsoft NNI Team'
,
author
=
'Microsoft NNI Team'
,
author_email
=
'nni@microsoft.com'
,
author_email
=
'nni@microsoft.com'
,
description
=
'Neural Network Intelligence project'
,
description
=
'Neural Network Intelligence project'
,
long_description
=
read
(
'README.md'
),
long_description
=
open
(
'README.md'
,
encoding
=
'utf-8'
).
read
(
),
license
=
'MIT'
,
license
=
'MIT'
,
url
=
'https://github.com/Microsoft/nni'
,
url
=
'https://github.com/Microsoft/nni'
,
packages
=
find_packages
(
'src/sdk/pynni'
,
exclude
=
[
'tests'
])
+
find_packages
(
'src/sdk/pycli'
)
+
find_packages
(
'tools'
),
packages
=
_find_python_packages
(),
package_dir
=
{
package_data
=
{
'nni'
:
'src/sdk/pynni/nni'
,
'nni'
:
[
'**/requirements.txt'
],
'nnicli'
:
'src/sdk/pycli/nnicli'
,
'nni_node'
:
_find_node_files
()
'nni_annotation'
:
'tools/nni_annotation'
,
'nni_cmd'
:
'tools/nni_cmd'
,
'nni_trial_tool'
:
'tools/nni_trial_tool'
,
'nni_gpu_tool'
:
'tools/nni_gpu_tool'
},
},
package_data
=
{
'nni'
:
[
'**/requirements.txt'
]},
python_requires
=
'>=3.6'
,
python_requires
=
'>=3.6'
,
install_requires
=
[
install_requires
=
[
'astor'
,
'astor'
,
...
@@ -49,7 +62,7 @@ setup(
...
@@ -49,7 +62,7 @@ setup(
entry_points
=
{
entry_points
=
{
'console_scripts'
:
[
'console_scripts'
:
[
'nnictl = nni_cmd.nnictl:parse_args'
'nnictl =
nni.
nni_cmd.nnictl:parse_args'
]
]
}
}
)
)
test/config/integration_tests.yml
View file @
f98ee672
...
@@ -147,8 +147,8 @@ testCases:
...
@@ -147,8 +147,8 @@ testCases:
config
:
config
:
maxTrialNum
:
4
maxTrialNum
:
4
trialConcurrency
:
4
trialConcurrency
:
4
launchCommand
:
python3 -c 'from nnicli import Experiment; exp = Experiment(); exp.start_experiment("$configFile")'
launchCommand
:
python3 -c 'from
nni.
nnicli import Experiment; exp = Experiment(); exp.start_experiment("$configFile")'
stopCommand
:
python3 -c 'from nnicli import Experiment; exp = Experiment(); exp.connect_experiment("http://localhost:8080/"); exp.stop_experiment()'
stopCommand
:
python3 -c 'from
nni.
nnicli import Experiment; exp = Experiment(); exp.connect_experiment("http://localhost:8080/"); exp.stop_experiment()'
validator
:
validator
:
class
:
NnicliValidator
class
:
NnicliValidator
platform
:
linux darwin
platform
:
linux darwin
...
...
test/config/integration_tests_tf2.yml
View file @
f98ee672
...
@@ -110,8 +110,8 @@ testCases:
...
@@ -110,8 +110,8 @@ testCases:
config
:
config
:
maxTrialNum
:
4
maxTrialNum
:
4
trialConcurrency
:
4
trialConcurrency
:
4
launchCommand
:
python3 -c 'from nnicli import Experiment; exp = Experiment(); exp.start_experiment("$configFile")'
launchCommand
:
python3 -c 'from
nni.
nnicli import Experiment; exp = Experiment(); exp.start_experiment("$configFile")'
stopCommand
:
python3 -c 'from nnicli import Experiment; exp = Experiment(); exp.connect_experiment("http://localhost:8080/"); exp.stop_experiment()'
stopCommand
:
python3 -c 'from
nni.
nnicli import Experiment; exp = Experiment(); exp.connect_experiment("http://localhost:8080/"); exp.stop_experiment()'
validator
:
validator
:
class
:
NnicliValidator
class
:
NnicliValidator
platform
:
linux darwin
platform
:
linux darwin
...
...
test/config/pr_tests.yml
View file @
f98ee672
...
@@ -47,8 +47,8 @@ testCases:
...
@@ -47,8 +47,8 @@ testCases:
config
:
config
:
maxTrialNum
:
4
maxTrialNum
:
4
trialConcurrency
:
4
trialConcurrency
:
4
launchCommand
:
python3 -c 'from nnicli import Experiment; exp = Experiment(); exp.start_experiment("$configFile")'
launchCommand
:
python3 -c 'from
nni.
nnicli import Experiment; exp = Experiment(); exp.start_experiment("$configFile")'
stopCommand
:
python3 -c 'from nnicli import Experiment; exp = Experiment(); exp.connect_experiment("http://localhost:8080/"); exp.stop_experiment()'
stopCommand
:
python3 -c 'from
nni.
nnicli import Experiment; exp = Experiment(); exp.connect_experiment("http://localhost:8080/"); exp.stop_experiment()'
validator
:
validator
:
class
:
NnicliValidator
class
:
NnicliValidator
platform
:
linux darwin
platform
:
linux darwin
...
...
test/nni_test/nnitest/validators.py
View file @
f98ee672
...
@@ -6,8 +6,8 @@ from os import remove
...
@@ -6,8 +6,8 @@ from os import remove
import
subprocess
import
subprocess
import
json
import
json
import
requests
import
requests
from
nnicli
import
Experiment
from
nni.
nnicli
import
Experiment
from
nni_cmd.updater
import
load_search_space
from
nni.
nni_cmd.updater
import
load_search_space
from
utils
import
METRICS_URL
,
GET_IMPORTED_DATA_URL
from
utils
import
METRICS_URL
,
GET_IMPORTED_DATA_URL
...
...
test/scripts/unittest.sh
View file @
f98ee672
...
@@ -7,8 +7,8 @@ CWD=${PWD}
...
@@ -7,8 +7,8 @@ CWD=${PWD}
## ------Run annotation test------
## ------Run annotation test------
echo
""
echo
""
echo
"===========================Testing: nni_annotation==========================="
echo
"===========================Testing: nni_annotation==========================="
cd
${
CWD
}
/../tools/
#
cd ${CWD}/../tools/
python3
-m
unittest
-v
nni_annotation/test_annotation.py
#
python3 -m unittest -v nni_annotation/test_annotation.py
## Export certain environment variables for unittest code to work
## Export certain environment variables for unittest code to work
export
NNI_TRIAL_JOB_ID
=
test_trial_job_id
export
NNI_TRIAL_JOB_ID
=
test_trial_job_id
...
@@ -17,23 +17,23 @@ export NNI_PLATFORM=unittest
...
@@ -17,23 +17,23 @@ export NNI_PLATFORM=unittest
## ------Run sdk test------
## ------Run sdk test------
echo
""
echo
""
echo
"===========================Testing: nni_sdk==========================="
echo
"===========================Testing: nni_sdk==========================="
cd
${
CWD
}
/../src/sdk/pynni/
#
cd ${CWD}/../src/sdk/pynni/
python3
-m
unittest discover
-v
tests
#
python3 -m unittest discover -v tests
# -------------For typescript unittest-------------
# -------------For typescript unittest-------------
cd
${
CWD
}
/../s
rc
/nni_manager
#
cd ${CWD}/../
t
s/nni_manager
echo
""
echo
""
echo
"===========================Testing: nni_manager==========================="
echo
"===========================Testing: nni_manager==========================="
npm run
test
#
npm run test
# -------------For NASUI unittest-------------
# -------------For NASUI unittest-------------
cd
${
CWD
}
/../s
rc
/nasui
#
cd ${CWD}/../
t
s/nasui
echo
""
echo
""
echo
"===========================Testing: nasui==========================="
echo
"===========================Testing: nasui==========================="
CI
=
true
npm
test
#
CI=true npm test
## ------Run nnictl unit test------
## ------Run nnictl unit test------
echo
""
echo
""
echo
"===========================Testing: nnictl==========================="
echo
"===========================Testing: nnictl==========================="
cd
${
CWD
}
/../tools/nni_cmd/
#
cd ${CWD}/../tools/nni_cmd/
python3
-m
unittest discover
-v
tests
#
python3 -m unittest discover -v tests
s
rc
/nasui/.gitignore
→
t
s/nasui/.gitignore
View file @
f98ee672
File moved
s
rc
/nasui/assets/darts/graph.json
→
t
s/nasui/assets/darts/graph.json
View file @
f98ee672
File moved
s
rc
/nasui/assets/darts/log
→
t
s/nasui/assets/darts/log
View file @
f98ee672
File moved
s
rc
/nasui/assets/naive/graph.json
→
t
s/nasui/assets/naive/graph.json
View file @
f98ee672
File moved
s
rc
/nasui/assets/naive/log
→
t
s/nasui/assets/naive/log
View file @
f98ee672
File moved
s
rc
/nasui/package.json
→
t
s/nasui/package.json
View file @
f98ee672
File moved
s
rc
/nasui/public/icon.png
→
t
s/nasui/public/icon.png
View file @
f98ee672
File moved
s
rc
/nasui/public/index.html
→
t
s/nasui/public/index.html
View file @
f98ee672
File moved
s
rc
/nasui/server.js
→
t
s/nasui/server.js
View file @
f98ee672
File moved
s
rc
/nasui/src/App.css
→
t
s/nasui/src/App.css
View file @
f98ee672
File moved
s
rc
/nasui/src/App.tsx
→
t
s/nasui/src/App.tsx
View file @
f98ee672
File moved
s
rc
/nasui/src/Chart.tsx
→
t
s/nasui/src/Chart.tsx
View file @
f98ee672
File moved
Prev
1
…
15
16
17
18
19
20
21
22
23
…
33
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