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
e21a6984
Unverified
Commit
e21a6984
authored
Oct 26, 2020
by
liuzhe-lz
Committed by
GitHub
Oct 26, 2020
Browse files
[v2.0] Refactor code hierarchy (part 2) (#2987)
parent
f98ee672
Changes
231
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
100 additions
and
9 deletions
+100
-9
nni/tools/nnictl/command_utils.py
nni/tools/nnictl/command_utils.py
+0
-0
nni/tools/nnictl/common_utils.py
nni/tools/nnictl/common_utils.py
+0
-0
nni/tools/nnictl/config_schema.py
nni/tools/nnictl/config_schema.py
+1
-1
nni/tools/nnictl/config_utils.py
nni/tools/nnictl/config_utils.py
+0
-0
nni/tools/nnictl/constants.py
nni/tools/nnictl/constants.py
+0
-0
nni/tools/nnictl/launcher.py
nni/tools/nnictl/launcher.py
+2
-2
nni/tools/nnictl/launcher_utils.py
nni/tools/nnictl/launcher_utils.py
+0
-0
nni/tools/nnictl/nnictl.py
nni/tools/nnictl/nnictl.py
+0
-0
nni/tools/nnictl/nnictl_utils.py
nni/tools/nnictl/nnictl_utils.py
+1
-1
nni/tools/nnictl/package_management.py
nni/tools/nnictl/package_management.py
+2
-2
nni/tools/nnictl/rest_utils.py
nni/tools/nnictl/rest_utils.py
+0
-0
nni/tools/nnictl/ssh_utils.py
nni/tools/nnictl/ssh_utils.py
+0
-0
nni/tools/nnictl/tensorboard_utils.py
nni/tools/nnictl/tensorboard_utils.py
+0
-0
nni/tools/nnictl/updater.py
nni/tools/nnictl/updater.py
+0
-0
nni/tools/nnictl/url_utils.py
nni/tools/nnictl/url_utils.py
+0
-0
nni/tools/package_utils/__init__.py
nni/tools/package_utils/__init__.py
+3
-3
nni/tools/package_utils/constants.py
nni/tools/package_utils/constants.py
+91
-0
nni/tools/trial_tool/__init__.py
nni/tools/trial_tool/__init__.py
+0
-0
nni/tools/trial_tool/aml_channel.py
nni/tools/trial_tool/aml_channel.py
+0
-0
nni/tools/trial_tool/base_channel.py
nni/tools/trial_tool/base_channel.py
+0
-0
No files found.
nni/
nni_cmd
/command_utils.py
→
nni/
tools/nnictl
/command_utils.py
View file @
e21a6984
File moved
nni/
nni_cmd
/common_utils.py
→
nni/
tools/nnictl
/common_utils.py
View file @
e21a6984
File moved
nni/
nni_cmd
/config_schema.py
→
nni/
tools/nnictl
/config_schema.py
View file @
e21a6984
...
...
@@ -6,7 +6,7 @@ import logging
import
os
import
netifaces
from
schema
import
Schema
,
And
,
Optional
,
Regex
,
Or
,
SchemaError
from
nni.package_utils
import
create_validator_instance
,
get_all_builtin_names
,
get_builtin_algo_meta
from
nni.
tools.
package_utils
import
create_validator_instance
,
get_all_builtin_names
,
get_builtin_algo_meta
from
.constants
import
SCHEMA_TYPE_ERROR
,
SCHEMA_RANGE_ERROR
,
SCHEMA_PATH_ERROR
from
.common_utils
import
get_yml_content
,
print_warning
...
...
nni/
nni_cmd
/config_utils.py
→
nni/
tools/nnictl
/config_utils.py
View file @
e21a6984
File moved
nni/
nni_cmd
/constants.py
→
nni/
tools/nnictl
/constants.py
View file @
e21a6984
File moved
nni/
nni_cmd
/launcher.py
→
nni/
tools/nnictl
/launcher.py
View file @
e21a6984
...
...
@@ -9,8 +9,8 @@ import random
import
time
import
tempfile
from
subprocess
import
Popen
,
check_call
,
CalledProcessError
,
PIPE
,
STDOUT
from
nni.
nni_
annotation
import
expand_annotations
,
generate_search_space
from
nni.package_utils
import
get_builtin_module_class_name
from
nni.
tools.
annotation
import
expand_annotations
,
generate_search_space
from
nni.
tools.
package_utils
import
get_builtin_module_class_name
import
nni_node
from
.launcher_utils
import
validate_all_content
from
.rest_utils
import
rest_put
,
rest_post
,
check_rest_server
,
check_response
...
...
nni/
nni_cmd
/launcher_utils.py
→
nni/
tools/nnictl
/launcher_utils.py
View file @
e21a6984
File moved
nni/
nni_cmd
/nnictl.py
→
nni/
tools/nnictl
/nnictl.py
View file @
e21a6984
File moved
nni/
nni_cmd
/nnictl_utils.py
→
nni/
tools/nnictl
/nnictl_utils.py
View file @
e21a6984
...
...
@@ -13,7 +13,7 @@ from functools import cmp_to_key
from
datetime
import
datetime
,
timezone
from
subprocess
import
Popen
from
pyhdfs
import
HdfsClient
from
nni.
nni_
annotation
import
expand_annotations
from
nni.
tools.
annotation
import
expand_annotations
import
nni_node
from
.rest_utils
import
rest_get
,
rest_delete
,
check_rest_server_quick
,
check_response
from
.url_utils
import
trial_jobs_url
,
experiment_url
,
trial_job_id_url
,
export_data_url
,
metric_data_url
...
...
nni/
nni_cmd
/package_management.py
→
nni/
tools/nnictl
/package_management.py
View file @
e21a6984
...
...
@@ -6,7 +6,7 @@ from collections import defaultdict
import
json
import
pkginfo
import
nni
from
nni.package_utils
import
read_installed_package_meta
,
get_installed_package_meta
,
\
from
nni.
tools.
package_utils
import
read_installed_package_meta
,
get_installed_package_meta
,
\
write_package_meta
,
get_builtin_algo_meta
,
get_not_installable_builtin_names
,
ALGO_TYPES
from
.constants
import
INSTALLABLE_PACKAGE_META
...
...
@@ -19,7 +19,7 @@ def install_by_name(package_name):
if
package_name
not
in
INSTALLABLE_PACKAGE_META
:
raise
RuntimeError
(
'{} is not found in installable packages!'
.
format
(
package_name
))
requirements_path
=
os
.
path
.
join
(
nni
.
__path__
[
0
],
INSTALLABLE_PACKAGE_META
[
package_name
][
'code_sub_dir'
],
'requirements.txt'
)
requirements_path
=
os
.
path
.
join
(
nni
.
__path__
[
0
],
'algorithms/hpo'
,
INSTALLABLE_PACKAGE_META
[
package_name
][
'code_sub_dir'
],
'requirements.txt'
)
assert
os
.
path
.
exists
(
requirements_path
)
return
install_requirements_command
(
requirements_path
)
...
...
nni/
nni_cmd
/rest_utils.py
→
nni/
tools/nnictl
/rest_utils.py
View file @
e21a6984
File moved
nni/
nni_cmd
/ssh_utils.py
→
nni/
tools/nnictl
/ssh_utils.py
View file @
e21a6984
File moved
nni/
nni_cmd
/tensorboard_utils.py
→
nni/
tools/nnictl
/tensorboard_utils.py
View file @
e21a6984
File moved
nni/
nni_cmd
/updater.py
→
nni/
tools/nnictl
/updater.py
View file @
e21a6984
File moved
nni/
nni_cmd
/url_utils.py
→
nni/
tools/nnictl
/url_utils.py
View file @
e21a6984
File moved
nni/package_utils.py
→
nni/
tools/
package_utils
/__init__
.py
View file @
e21a6984
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from
collections
import
defaultdict
import
importlib
import
os
from
pathlib
import
Path
import
sys
from
collections
import
defaultdict
from
pathlib
import
Path
import
importlib
import
ruamel.yaml
as
yaml
import
nni
...
...
nni/constants.py
→
nni/
tools/package_utils/
constants.py
View file @
e21a6984
...
...
@@ -5,87 +5,87 @@ BuiltinAlgorithms = {
'tuners'
:
[
{
'name'
:
'TPE'
,
'class_name'
:
'nni.hyperopt_tuner.hyperopt_tuner.HyperoptTuner'
,
'class_name'
:
'nni.
algorithms.hpo.
hyperopt_tuner.hyperopt_tuner.HyperoptTuner'
,
'class_args'
:
{
'algorithm_name'
:
'tpe'
},
'class_args_validator'
:
'nni.hyperopt_tuner.hyperopt_tuner.HyperoptClassArgsValidator'
'class_args_validator'
:
'nni.
algorithms.hpo.
hyperopt_tuner.hyperopt_tuner.HyperoptClassArgsValidator'
},
{
'name'
:
'Random'
,
'class_name'
:
'nni.hyperopt_tuner.hyperopt_tuner.HyperoptTuner'
,
'class_name'
:
'nni.
algorithms.hpo.
hyperopt_tuner.hyperopt_tuner.HyperoptTuner'
,
'class_args'
:
{
'algorithm_name'
:
'random_search'
},
'accept_class_args'
:
False
,
'class_args_validator'
:
'nni.hyperopt_tuner.hyperopt_tuner.HyperoptClassArgsValidator'
'class_args_validator'
:
'nni.
algorithms.hpo.
hyperopt_tuner.hyperopt_tuner.HyperoptClassArgsValidator'
},
{
'name'
:
'Anneal'
,
'class_name'
:
'nni.hyperopt_tuner.hyperopt_tuner.HyperoptTuner'
,
'class_name'
:
'nni.
algorithms.hpo.
hyperopt_tuner.hyperopt_tuner.HyperoptTuner'
,
'class_args'
:
{
'algorithm_name'
:
'anneal'
},
'class_args_validator'
:
'nni.hyperopt_tuner.hyperopt_tuner.HyperoptClassArgsValidator'
'class_args_validator'
:
'nni.
algorithms.hpo.
hyperopt_tuner.hyperopt_tuner.HyperoptClassArgsValidator'
},
{
'name'
:
'Evolution'
,
'class_name'
:
'nni.evolution_tuner.evolution_tuner.EvolutionTuner'
,
'class_args_validator'
:
'nni.evolution_tuner.evolution_tuner.EvolutionClassArgsValidator'
'class_name'
:
'nni.
algorithms.hpo.
evolution_tuner.evolution_tuner.EvolutionTuner'
,
'class_args_validator'
:
'nni.
algorithms.hpo.
evolution_tuner.evolution_tuner.EvolutionClassArgsValidator'
},
{
'name'
:
'BatchTuner'
,
'class_name'
:
'nni.batch_tuner.batch_tuner.BatchTuner'
,
'class_name'
:
'nni.
algorithms.hpo.
batch_tuner.batch_tuner.BatchTuner'
,
'accept_class_args'
:
False
,
},
{
'name'
:
'GridSearch'
,
'class_name'
:
'nni.gridsearch_tuner.gridsearch_tuner.GridSearchTuner'
,
'class_name'
:
'nni.
algorithms.hpo.
gridsearch_tuner.gridsearch_tuner.GridSearchTuner'
,
'accept_class_args'
:
False
,
},
{
'name'
:
'NetworkMorphism'
,
'class_name'
:
'nni.networkmorphism_tuner.networkmorphism_tuner.NetworkMorphismTuner'
,
'class_args_validator'
:
'nni.networkmorphism_tuner.networkmorphism_tuner.NetworkMorphismClassArgsValidator'
'class_name'
:
'nni.
algorithms.hpo.
networkmorphism_tuner.networkmorphism_tuner.NetworkMorphismTuner'
,
'class_args_validator'
:
'nni.
algorithms.hpo.
networkmorphism_tuner.networkmorphism_tuner.NetworkMorphismClassArgsValidator'
},
{
'name'
:
'MetisTuner'
,
'class_name'
:
'nni.metis_tuner.metis_tuner.MetisTuner'
,
'class_args_validator'
:
'nni.metis_tuner.metis_tuner.MetisClassArgsValidator'
'class_name'
:
'nni.
algorithms.hpo.
metis_tuner.metis_tuner.MetisTuner'
,
'class_args_validator'
:
'nni.
algorithms.hpo.
metis_tuner.metis_tuner.MetisClassArgsValidator'
},
{
'name'
:
'GPTuner'
,
'class_name'
:
'nni.gp_tuner.gp_tuner.GPTuner'
,
'class_args_validator'
:
'nni.gp_tuner.gp_tuner.GPClassArgsValidator'
'class_name'
:
'nni.
algorithms.hpo.
gp_tuner.gp_tuner.GPTuner'
,
'class_args_validator'
:
'nni.
algorithms.hpo.
gp_tuner.gp_tuner.GPClassArgsValidator'
},
{
'name'
:
'PBTTuner'
,
'class_name'
:
'nni.pbt_tuner.pbt_tuner.PBTTuner'
,
'class_args_validator'
:
'nni.pbt_tuner.pbt_tuner.PBTClassArgsValidator'
'class_name'
:
'nni.
algorithms.hpo.
pbt_tuner.pbt_tuner.PBTTuner'
,
'class_args_validator'
:
'nni.
algorithms.hpo.
pbt_tuner.pbt_tuner.PBTClassArgsValidator'
},
{
'name'
:
'RegularizedEvolutionTuner'
,
'class_name'
:
'nni.regularized_evolution_tuner.regularized_evolution_tuner.RegularizedEvolutionTuner'
,
'class_args_validator'
:
'nni.regularized_evolution_tuner.regularized_evolution_tuner.EvolutionClassArgsValidator'
'class_name'
:
'nni.
algorithms.hpo.
regularized_evolution_tuner.regularized_evolution_tuner.RegularizedEvolutionTuner'
,
'class_args_validator'
:
'nni.
algorithms.hpo.
regularized_evolution_tuner.regularized_evolution_tuner.EvolutionClassArgsValidator'
}
],
'assessors'
:
[
{
'name'
:
'Medianstop'
,
'class_name'
:
'nni.medianstop_assessor.medianstop_assessor.MedianstopAssessor'
,
'class_args_validator'
:
'nni.medianstop_assessor.medianstop_assessor.MedianstopClassArgsValidator'
'class_name'
:
'nni.
algorithms.hpo.
medianstop_assessor.medianstop_assessor.MedianstopAssessor'
,
'class_args_validator'
:
'nni.
algorithms.hpo.
medianstop_assessor.medianstop_assessor.MedianstopClassArgsValidator'
},
{
'name'
:
'Curvefitting'
,
'class_name'
:
'nni.curvefitting_assessor.curvefitting_assessor.CurvefittingAssessor'
,
'class_args_validator'
:
'nni.curvefitting_assessor.curvefitting_assessor.CurvefittingClassArgsValidator'
'class_name'
:
'nni.
algorithms.hpo.
curvefitting_assessor.curvefitting_assessor.CurvefittingAssessor'
,
'class_args_validator'
:
'nni.
algorithms.hpo.
curvefitting_assessor.curvefitting_assessor.CurvefittingClassArgsValidator'
},
],
'advisors'
:
[
{
'name'
:
'Hyperband'
,
'class_name'
:
'nni.hyperband_advisor.hyperband_advisor.Hyperband'
,
'class_args_validator'
:
'nni.hyperband_advisor.hyperband_advisor.HyperbandClassArgsValidator'
'class_name'
:
'nni.
algorithms.hpo.
hyperband_advisor.hyperband_advisor.Hyperband'
,
'class_args_validator'
:
'nni.
algorithms.hpo.
hyperband_advisor.hyperband_advisor.HyperbandClassArgsValidator'
}
]
}
nni/
pbt_tuner
/__init__.py
→
nni/
tools/trial_tool
/__init__.py
View file @
e21a6984
File moved
nni/
nni_
trial_tool/aml_channel.py
→
nni/
tools/
trial_tool/aml_channel.py
View file @
e21a6984
File moved
nni/
nni_
trial_tool/base_channel.py
→
nni/
tools/
trial_tool/base_channel.py
View file @
e21a6984
File moved
Prev
1
…
6
7
8
9
10
11
12
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