Takes file containing failures like FAILED test/test_proxy_tensor.py::TestProxyTensorOpInfoCPU::test_make_fx_symbolic_exhaustive___getitem___cpu_float32 - RuntimeError: aten.size.default - couldn't find symbolic meta function/decomposition # noqa: B950 and processes them into a list
()
| 47 | |
| 48 | |
| 49 | def process_failures(): |
| 50 | """ |
| 51 | Takes file containing failures like |
| 52 | |
| 53 | FAILED test/test_proxy_tensor.py::TestProxyTensorOpInfoCPU::test_make_fx_symbolic_exhaustive___getitem___cpu_float32 - RuntimeError: aten.size.default - couldn't find symbolic meta function/decomposition # noqa: B950 |
| 54 | |
| 55 | and processes them into a list of opinfo xfails |
| 56 | """ |
| 57 | f = open('pytest_failures') |
| 58 | failures = f.readlines() |
| 59 | failures = [i.strip() for i in failures] |
| 60 | |
| 61 | def process_failure_string(s, matcher): |
| 62 | out = re.search(matcher, s) |
| 63 | return out.groups() |
| 64 | |
| 65 | SYMBOLIC_TRACE_MATCH = r'exhaustive_(.*)_cpu.*: (.*)' |
| 66 | failures = [process_failure_string(s, SYMBOLIC_TRACE_MATCH) for s in failures] |
| 67 | |
| 68 | def create_normalized_name(op): |
| 69 | if op.variant_test_name == '': |
| 70 | s = op.name |
| 71 | else: |
| 72 | s = f"{op.name}.{op.variant_test_name}" |
| 73 | return s.replace('.', '_') |
| 74 | |
| 75 | remap_opinfo = {create_normalized_name(op): (op.name, op.variant_test_name) for op in op_db} |
| 76 | |
| 77 | print("symbolic_tensor_failures = {") |
| 78 | for failure, reason in failures: |
| 79 | print(f" xfail{remap_opinfo[failure]}, # {reason}") |
| 80 | print("}") |
| 81 | |
| 82 | |
| 83 | USE_TORCHVISION = False |
nothing calls this directly
no test coverage detected
searching dependent graphs…