-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[alt] add a report merging tool (#331)
One of the items for <#300>
- Loading branch information
Showing
9 changed files
with
242 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"test_add": "PASS", | ||
"test_add_bcast": "PASS", | ||
"test_add_uint8": "PASS" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## Summary | ||
|
||
|Stage|Count| | ||
|--|--| | ||
| Total | 3 | | ||
| PASS | 3 | | ||
| Numerics | 0 | | ||
| results-summary | 0 | | ||
| postprocessing | 0 | | ||
| compiled_inference | 0 | | ||
| native_inference | 0 | | ||
| construct_inputs | 0 | | ||
| compilation | 0 | | ||
| preprocessing | 0 | | ||
| import_model | 0 | | ||
| setup | 0 | | ||
|
||
## Test Run Detail | ||
Test was run with the following arguments: | ||
Namespace(device='local-task', backend='llvm-cpu', iree_compile_args=None, mode='onnx-iree', torchtolinalg=False, stages=None, skip_stages=None, load_inputs=False, groups='all', test_filter='test_add', tolerance=None, verbose=True, rundirectory='test-run', no_artifacts=False, report=True, report_file='reports/test_add.md') | ||
|
||
| Test | Exit Status | Notes | | ||
|--|--|--| | ||
| test_add | PASS | | | ||
| test_add_bcast | PASS | | | ||
| test_add_uint8 | PASS | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"test_conv_with_autopad_same": "compilation", | ||
"test_conv_with_strides_and_asymmetric_padding": "PASS", | ||
"test_conv_with_strides_no_padding": "PASS", | ||
"test_conv_with_strides_padding": "PASS", | ||
"test_convinteger_with_padding": "PASS", | ||
"test_convinteger_without_padding": "PASS", | ||
"test_convtranspose": "PASS", | ||
"test_convtranspose_1d": "PASS", | ||
"test_convtranspose_3d": "PASS", | ||
"test_convtranspose_autopad_same": "compilation", | ||
"test_convtranspose_dilations": "PASS", | ||
"test_convtranspose_kernel_shape": "compilation", | ||
"test_convtranspose_output_shape": "compilation", | ||
"test_convtranspose_pad": "PASS", | ||
"test_convtranspose_pads": "PASS" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
## Summary | ||
|
||
|Stage|Count| | ||
|--|--| | ||
| Total | 15 | | ||
| PASS | 11 | | ||
| Numerics | 0 | | ||
| results-summary | 0 | | ||
| postprocessing | 0 | | ||
| compiled_inference | 0 | | ||
| native_inference | 0 | | ||
| construct_inputs | 0 | | ||
| compilation | 4 | | ||
| preprocessing | 0 | | ||
| import_model | 0 | | ||
| setup | 0 | | ||
|
||
## Test Run Detail | ||
Test was run with the following arguments: | ||
Namespace(device='local-task', backend='llvm-cpu', iree_compile_args=None, mode='onnx-iree', torchtolinalg=False, stages=None, skip_stages=None, load_inputs=False, groups='all', test_filter='test_conv', tolerance=None, verbose=True, rundirectory='test-run', no_artifacts=False, report=True, report_file='reports/test_conv.md') | ||
|
||
| Test | Exit Status | Notes | | ||
|--|--|--| | ||
| test_conv_with_autopad_same | compilation | | | ||
| test_conv_with_strides_and_asymmetric_padding | PASS | | | ||
| test_conv_with_strides_no_padding | PASS | | | ||
| test_conv_with_strides_padding | PASS | | | ||
| test_convinteger_with_padding | PASS | | | ||
| test_convinteger_without_padding | PASS | | | ||
| test_convtranspose | PASS | | | ||
| test_convtranspose_1d | PASS | | | ||
| test_convtranspose_3d | PASS | | | ||
| test_convtranspose_autopad_same | compilation | | | ||
| test_convtranspose_dilations | PASS | | | ||
| test_convtranspose_kernel_shape | compilation | | | ||
| test_convtranspose_output_shape | compilation | | | ||
| test_convtranspose_pad | PASS | | | ||
| test_convtranspose_pads | PASS | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"test_add": "PASS", | ||
"test_add_bcast": "PASS", | ||
"test_add_uint8": "PASS", | ||
"test_conv_with_autopad_same": "compilation", | ||
"test_conv_with_strides_and_asymmetric_padding": "PASS", | ||
"test_conv_with_strides_no_padding": "PASS", | ||
"test_conv_with_strides_padding": "PASS", | ||
"test_convinteger_with_padding": "PASS", | ||
"test_convinteger_without_padding": "PASS", | ||
"test_convtranspose": "PASS", | ||
"test_convtranspose_1d": "PASS", | ||
"test_convtranspose_3d": "PASS", | ||
"test_convtranspose_autopad_same": "compilation", | ||
"test_convtranspose_dilations": "PASS", | ||
"test_convtranspose_kernel_shape": "compilation", | ||
"test_convtranspose_output_shape": "compilation", | ||
"test_convtranspose_pad": "PASS", | ||
"test_convtranspose_pads": "PASS" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
## Summary | ||
|
||
|Stage|Count| | ||
|--|--| | ||
| Total | 18 | | ||
| PASS | 14 | | ||
| Numerics | 0 | | ||
| results-summary | 0 | | ||
| postprocessing | 0 | | ||
| compiled_inference | 0 | | ||
| native_inference | 0 | | ||
| construct_inputs | 0 | | ||
| compilation | 4 | | ||
| preprocessing | 0 | | ||
| import_model | 0 | | ||
| setup | 0 | | ||
|
||
## Test Run Detail | ||
Test was run with the following arguments: | ||
Namespace(sources=['reports/test_add.json', 'reports/test_conv.json'], output='reports/test_conv_and_add.json', report=True, report_file='reports/test_conv_and_add.md') | ||
|
||
| Test | Exit Status | Notes | | ||
|--|--|--| | ||
| test_add | PASS | | | ||
| test_add_bcast | PASS | | | ||
| test_add_uint8 | PASS | | | ||
| test_conv_with_autopad_same | compilation | | | ||
| test_conv_with_strides_and_asymmetric_padding | PASS | | | ||
| test_conv_with_strides_no_padding | PASS | | | ||
| test_conv_with_strides_padding | PASS | | | ||
| test_convinteger_with_padding | PASS | | | ||
| test_convinteger_without_padding | PASS | | | ||
| test_convtranspose | PASS | | | ||
| test_convtranspose_1d | PASS | | | ||
| test_convtranspose_3d | PASS | | | ||
| test_convtranspose_autopad_same | compilation | | | ||
| test_convtranspose_dilations | PASS | | | ||
| test_convtranspose_kernel_shape | compilation | | | ||
| test_convtranspose_output_shape | compilation | | | ||
| test_convtranspose_pad | PASS | | | ||
| test_convtranspose_pads | PASS | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import json | ||
import argparse | ||
from report import generate_report, save_dict | ||
from pathlib import Path | ||
import sys | ||
|
||
TEST_DIR = str(Path(__file__).parents[1]) | ||
sys.path.append(TEST_DIR) | ||
from run import ALL_STAGES | ||
|
||
|
||
def _get_argparse(): | ||
msg = "A script for loading two or more dictionary jsons and merging them." | ||
parser = argparse.ArgumentParser(prog="merge_dicts.py", description=msg, epilog="") | ||
parser.add_argument( | ||
"-s", | ||
"--sources", | ||
nargs="*", | ||
required=True, | ||
help="specify paths to source files for merging", | ||
) | ||
parser.add_argument( | ||
"-o", | ||
"--output", | ||
help="specify output filepath", | ||
) | ||
parser.add_argument( | ||
"-r", | ||
"--report", | ||
action="store_true", | ||
default=False, | ||
help="set this flag to generate a report from the merged status dicts", | ||
) | ||
parser.add_argument( | ||
"-f", | ||
"--report-file", | ||
default="report.md", | ||
help="specify report filepath for merged status dicts", | ||
) | ||
return parser | ||
|
||
|
||
def main(args): | ||
sources = args.sources | ||
print(sources) | ||
s0 = load(sources[0]) | ||
for s in sources[1:]: | ||
s0.update(load(s)) | ||
if args.output: | ||
save_dict(s0, args.output) | ||
if args.report_file: | ||
generate_report(args, ALL_STAGES, s0) | ||
|
||
|
||
def load(pathname): | ||
with open(pathname) as contents: | ||
loaded_dict = json.load(contents) | ||
return loaded_dict | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = _get_argparse() | ||
main(parser.parse_args()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters