Skip to content

Commit

Permalink
return the correct information to resubmit failed tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkinnison committed Aug 3, 2018
1 parent a1bdf22 commit d4679f6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
5 changes: 4 additions & 1 deletion shadho/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,7 @@ def register_result(self, model_id, result_id, loss, results):
if not isinstance(results, dict):
results = {'results': results}
results['compute_class'] = (self.resource, self.value)
self.model_group.register_result(model_id, result_id, loss, results)
return self.model_group.register_result(model_id,
result_id,
loss,
results)
4 changes: 2 additions & 2 deletions shadho/managers/workqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ def failure(self, task):

resub = (int(task.return_status) == 137)

rid, ccid = str(task.tag).split('.')
return (rid, ccid, resub)
#rid, ccid = str(task.tag).split('.')
return (task.tag, resub)


class WQFile(object):
Expand Down
9 changes: 5 additions & 4 deletions shadho/shadho.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ def run(self):
opt = self.backend.optimal(mode='best')
key = list(opt.keys())[0]
print("Optimal result: {}".format(opt[key]['loss']))
print("With parameters: {}".format(opt[1]))
print("And additional results: {}".format(opt[2]))
print("With parameters: {}".format(opt[key]['values']))
print("And additional results: {}".format(opt[key]['results']))

def generate(self):
"""Generate hyperparameter values to test.
Expand Down Expand Up @@ -401,9 +401,10 @@ def failure(self, tag, resub):
-----
"""
submissions, params = self.backend.register_result(rid, None)
result_id, model_id, ccid = tag.split('.')
submissions, params = \
self.backend.register_result(model_id, result_id, None, {})
if resub and submissions < self.max_resubmissions:
tag = '.'.join([rid, ccid])
cc = self.ccs[ccid]
self.manager.add_task(self.cmd,
tag,
Expand Down

0 comments on commit d4679f6

Please sign in to comment.