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
c7cc8db3
Unverified
Commit
c7cc8db3
authored
Apr 29, 2019
by
chicm-ms
Committed by
GitHub
Apr 29, 2019
Browse files
Merge pull request #1030 from Microsoft/v0.7
V0.7 merge back to master
parents
71e8ced7
1680f2e5
Changes
26
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
22 deletions
+37
-22
src/sdk/pynni/nni/msg_dispatcher_base.py
src/sdk/pynni/nni/msg_dispatcher_base.py
+2
-0
src/webui/src/components/trial-detail/DefaultMetricPoint.tsx
src/webui/src/components/trial-detail/DefaultMetricPoint.tsx
+9
-7
tools/nni_cmd/common_utils.py
tools/nni_cmd/common_utils.py
+7
-4
tools/nni_cmd/launcher.py
tools/nni_cmd/launcher.py
+5
-2
tools/nni_cmd/updater.py
tools/nni_cmd/updater.py
+1
-1
tools/nni_gpu_tool/gpu_metrics_collector.py
tools/nni_gpu_tool/gpu_metrics_collector.py
+13
-8
No files found.
src/sdk/pynni/nni/msg_dispatcher_base.py
View file @
c7cc8db3
...
@@ -77,6 +77,8 @@ class MsgDispatcherBase(Recoverable):
...
@@ -77,6 +77,8 @@ class MsgDispatcherBase(Recoverable):
break
break
else
:
else
:
self
.
enqueue_command
(
command
,
data
)
self
.
enqueue_command
(
command
,
data
)
if
self
.
worker_exceptions
:
break
_logger
.
info
(
'Dispatcher exiting...'
)
_logger
.
info
(
'Dispatcher exiting...'
)
self
.
stopping
=
True
self
.
stopping
=
True
...
...
src/webui/src/components/trial-detail/DefaultMetricPoint.tsx
View file @
c7cc8db3
...
@@ -30,7 +30,8 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
...
@@ -30,7 +30,8 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
const
accSource
:
Array
<
DetailAccurPoint
>
=
[];
const
accSource
:
Array
<
DetailAccurPoint
>
=
[];
Object
.
keys
(
showSource
).
map
(
item
=>
{
Object
.
keys
(
showSource
).
map
(
item
=>
{
const
temp
=
showSource
[
item
];
const
temp
=
showSource
[
item
];
if
(
temp
.
status
===
'
SUCCEEDED
'
&&
temp
.
acc
.
default
!==
undefined
)
{
if
(
temp
.
status
===
'
SUCCEEDED
'
&&
temp
.
acc
!==
undefined
)
{
if
(
temp
.
acc
.
default
!==
undefined
)
{
const
searchSpace
=
temp
.
description
.
parameters
;
const
searchSpace
=
temp
.
description
.
parameters
;
accSource
.
push
({
accSource
.
push
({
acc
:
temp
.
acc
.
default
,
acc
:
temp
.
acc
.
default
,
...
@@ -38,6 +39,7 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
...
@@ -38,6 +39,7 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
searchSpace
:
JSON
.
stringify
(
searchSpace
)
searchSpace
:
JSON
.
stringify
(
searchSpace
)
});
});
}
}
}
});
});
const
resultList
:
Array
<
number
|
string
>
[]
=
[];
const
resultList
:
Array
<
number
|
string
>
[]
=
[];
Object
.
keys
(
accSource
).
map
(
item
=>
{
Object
.
keys
(
accSource
).
map
(
item
=>
{
...
...
tools/nni_cmd/common_utils.py
View file @
c7cc8db3
...
@@ -32,9 +32,12 @@ def get_yml_content(file_path):
...
@@ -32,9 +32,12 @@ def get_yml_content(file_path):
try
:
try
:
with
open
(
file_path
,
'r'
)
as
file
:
with
open
(
file_path
,
'r'
)
as
file
:
return
yaml
.
load
(
file
,
Loader
=
yaml
.
Loader
)
return
yaml
.
load
(
file
,
Loader
=
yaml
.
Loader
)
except
TypeError
as
err
:
except
yaml
.
scanner
.
ScannerError
as
err
:
print
(
'Error: '
,
err
)
print_error
(
'yaml file format error!'
)
return
None
exit
(
1
)
except
Exception
as
exception
:
print_error
(
exception
)
exit
(
1
)
def
get_json_content
(
file_path
):
def
get_json_content
(
file_path
):
'''Load json file content'''
'''Load json file content'''
...
@@ -42,7 +45,7 @@ def get_json_content(file_path):
...
@@ -42,7 +45,7 @@ def get_json_content(file_path):
with
open
(
file_path
,
'r'
)
as
file
:
with
open
(
file_path
,
'r'
)
as
file
:
return
json
.
load
(
file
)
return
json
.
load
(
file
)
except
TypeError
as
err
:
except
TypeError
as
err
:
print
(
'E
rror
: '
,
err
)
print
_e
rror
(
'json file format error!'
)
return
None
return
None
def
print_error
(
content
):
def
print_error
(
content
):
...
...
tools/nni_cmd/launcher.py
View file @
c7cc8db3
...
@@ -114,7 +114,10 @@ def start_rest_server(port, platform, mode, config_file_name, experiment_id=None
...
@@ -114,7 +114,10 @@ def start_rest_server(port, platform, mode, config_file_name, experiment_id=None
entry_dir
=
get_nni_installation_path
()
entry_dir
=
get_nni_installation_path
()
entry_file
=
os
.
path
.
join
(
entry_dir
,
'main.js'
)
entry_file
=
os
.
path
.
join
(
entry_dir
,
'main.js'
)
cmds
=
[
'node'
,
entry_file
,
'--port'
,
str
(
port
),
'--mode'
,
platform
,
'--start_mode'
,
mode
]
node_command
=
'node'
if
sys
.
platform
==
'win32'
:
node_command
=
os
.
path
.
join
(
entry_dir
[:
-
3
],
'Scripts'
,
'node.exe'
)
cmds
=
[
node_command
,
entry_file
,
'--port'
,
str
(
port
),
'--mode'
,
platform
,
'--start_mode'
,
mode
]
if
log_dir
is
not
None
:
if
log_dir
is
not
None
:
cmds
+=
[
'--log_dir'
,
log_dir
]
cmds
+=
[
'--log_dir'
,
log_dir
]
if
log_level
is
not
None
:
if
log_level
is
not
None
:
...
...
tools/nni_cmd/updater.py
View file @
c7cc8db3
...
@@ -136,7 +136,7 @@ def import_data(args):
...
@@ -136,7 +136,7 @@ def import_data(args):
args
.
port
=
get_experiment_port
(
args
)
args
.
port
=
get_experiment_port
(
args
)
if
args
.
port
is
not
None
:
if
args
.
port
is
not
None
:
if
import_data_to_restful_server
(
args
,
content
):
if
import_data_to_restful_server
(
args
,
content
):
p
rint_normal
(
'Import data success!'
)
p
ass
else
:
else
:
print_error
(
'Import data failed!'
)
print_error
(
'Import data failed!'
)
...
...
tools/nni_gpu_tool/gpu_metrics_collector.py
View file @
c7cc8db3
...
@@ -25,9 +25,14 @@ import time
...
@@ -25,9 +25,14 @@ import time
from
xml.dom
import
minidom
from
xml.dom
import
minidom
def
check_ready_to_run
():
def
check_ready_to_run
():
#TODO check process in windows
if
sys
.
platform
==
'win32'
:
if
sys
.
platform
==
'win32'
:
return
True
pgrep_output
=
subprocess
.
check_output
(
'wmic process where "CommandLine like
\'
%nni_gpu_tool.gpu_metrics_collector%
\'
and name like
\'
%python%
\'
" get processId'
)
pidList
=
pgrep_output
.
decode
(
"utf-8"
).
strip
().
split
()
pidList
.
pop
(
0
)
# remove the key word 'ProcessId'
pidList
=
list
(
map
(
int
,
pidList
))
pidList
.
remove
(
os
.
getpid
())
return
len
(
pidList
)
==
0
else
:
pgrep_output
=
subprocess
.
check_output
(
'pgrep -fx
\'
python3 -m nni_gpu_tool.gpu_metrics_collector
\'
'
,
shell
=
True
)
pgrep_output
=
subprocess
.
check_output
(
'pgrep -fx
\'
python3 -m nni_gpu_tool.gpu_metrics_collector
\'
'
,
shell
=
True
)
pidList
=
[]
pidList
=
[]
for
pid
in
pgrep_output
.
splitlines
():
for
pid
in
pgrep_output
.
splitlines
():
...
...
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