MCPcopy Create free account
hub / github.com/pytorch/pytorch / process_failures

Function process_failures

test/test_proxy_tensor.py:49–80  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

47
48
49def 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
83USE_TORCHVISION = False

Callers

nothing calls this directly

Calls 3

process_failure_stringFunction · 0.85
create_normalized_nameFunction · 0.85
stripMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…