Unverified Commit 9f18dea3 authored by Yuting Jiang's avatar Yuting Jiang Committed by GitHub
Browse files

Bug - Fix bug to get metric from cmd when error happens (#506)

**Description**
Fix bug to get metric from cmd when error happens(cudnn-function/_time:4)
parent 14a4a44b
......@@ -408,23 +408,21 @@ def _process_raw_result(self, cmd_idx, raw_output):
True if the raw output string is valid and result can be extracted.
"""
self._result.add_raw_data('raw_output_' + str(cmd_idx), raw_output, self._args.log_raw_data)
metric = ''
try:
lines = raw_output.splitlines()
metric = ''
cmd_config = json.loads(self._commands[cmd_idx].split('--config_json')[-1].replace(' ', '')[1:-1])
for key in sorted(cmd_config.keys()):
if 'name' in key:
metric = key + '_' + str(cmd_config[key]) + metric
else:
metric = metric + '_' + key + '_' + str(cmd_config[key])
metric = metric.replace(' ', '').replace(',', '_')
error = False
raw_data = []
for line in lines:
if '[function config]' in line:
metric = ''
metric_json_str = line[line.index('[function config]: ') +
len('[function config]: '):].replace(' ', '').replace(':', '_')[1:-1]
metric_list = metric_json_str.split(',')
for key in metric_list:
if 'name' in key:
metric = key + metric
else:
metric = metric + '_' + key
if '[raw_data]' in line:
raw_data = line[line.index('[raw_data]: ') + len('[raw_data]: '):]
raw_data = raw_data.split(',')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment