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
2c5d89a7
"git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "969f0d99d333f07dc1f7086214762224c7d5cb6a"
Unverified
Commit
2c5d89a7
authored
Nov 25, 2020
by
J-shang
Committed by
GitHub
Nov 25, 2020
Browse files
quick fix unknow trial report to resume experiment (#3096)
parent
c55300df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
nni/runtime/msg_dispatcher.py
nni/runtime/msg_dispatcher.py
+5
-2
ts/nni_manager/core/nnimanager.ts
ts/nni_manager/core/nnimanager.ts
+8
-4
No files found.
nni/runtime/msg_dispatcher.py
View file @
2c5d89a7
...
...
@@ -39,7 +39,7 @@ def _sort_history(history):
# Tuner global variables
_next_parameter_id
=
0
_trial_params
=
{}
'''key:
trial job
ID; value: parameters'''
'''key:
parameter
ID; value: parameters'''
_customized_parameter_ids
=
set
()
...
...
@@ -114,7 +114,7 @@ class MsgDispatcher(MsgDispatcherBase):
data: a list of dictionaries, each of which has at least two keys, 'parameter' and 'value'
"""
for
entry
in
data
:
entry
[
'value'
]
=
entry
[
'value'
]
if
type
(
entry
[
'value'
])
is
str
else
json_tricks
.
dumps
(
entry
[
'value'
])
entry
[
'value'
]
=
entry
[
'value'
]
if
type
(
entry
[
'value'
])
is
str
else
json_tricks
.
dumps
(
entry
[
'value'
])
entry
[
'value'
]
=
json_tricks
.
loads
(
entry
[
'value'
])
self
.
tuner
.
import_data
(
data
)
...
...
@@ -182,8 +182,11 @@ class MsgDispatcher(MsgDispatcherBase):
customized
=
True
else
:
customized
=
False
if
id_
in
_trial_params
:
self
.
tuner
.
receive_trial_result
(
id_
,
_trial_params
[
id_
],
value
,
customized
=
customized
,
trial_job_id
=
data
.
get
(
'trial_job_id'
))
else
:
_logger
.
warning
(
'Find unknown job parameter id %s, maybe something goes wrong.'
,
_trial_params
[
id_
])
def
_handle_intermediate_metric_data
(
self
,
data
):
"""Call assessor to process intermediate results
...
...
ts/nni_manager/core/nnimanager.ts
View file @
2c5d89a7
...
...
@@ -678,11 +678,15 @@ class NNIManager implements Manager {
private
async
onTrialJobMetrics
(
metric
:
TrialJobMetric
):
Promise
<
void
>
{
this
.
log
.
debug
(
`NNIManager received trial job metrics:
${
metric
}
`
);
await
this
.
dataStore
.
storeMetricData
(
metric
.
id
,
metric
.
data
);
if
(
this
.
dispatcher
===
undefined
)
{
throw
new
Error
(
'
Error: tuner has not been setup
'
);
if
(
this
.
trialJobs
.
has
(
metric
.
id
)){
await
this
.
dataStore
.
storeMetricData
(
metric
.
id
,
metric
.
data
);
if
(
this
.
dispatcher
===
undefined
)
{
throw
new
Error
(
'
Error: tuner has not been setup
'
);
}
this
.
dispatcher
.
sendCommand
(
REPORT_METRIC_DATA
,
metric
.
data
);
}
else
{
this
.
log
.
warning
(
`NNIManager received non-existent trial job metrics:
${
metric
}
`
);
}
this
.
dispatcher
.
sendCommand
(
REPORT_METRIC_DATA
,
metric
.
data
);
}
private
requestTrialJobs
(
jobNum
:
number
):
void
{
...
...
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