mirror of https://github.com/llvm/torch-mlir
parent
4148f88576
commit
d8db41b3b6
|
@ -104,10 +104,11 @@ def main():
|
|||
sys.exit(1)
|
||||
|
||||
# Run the tests.
|
||||
results = run_tests(tests, config)
|
||||
results = run_tests(tests, config, verbose=args.verbose)
|
||||
|
||||
# Report the test results.
|
||||
failed = report_results(results, XFAIL_SETS[args.config], args.verbose)
|
||||
failed = report_results(
|
||||
results, XFAIL_SETS[args.config], verbose=args.verbose)
|
||||
sys.exit(1 if failed else 0)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -284,13 +284,16 @@ def generate_golden_trace(test: Test) -> Trace:
|
|||
return trace
|
||||
|
||||
|
||||
def run_tests(tests: List[Test], config: TestConfig) -> List[TestResult]:
|
||||
def run_tests(tests: List[Test], config: TestConfig,
|
||||
verbose=False) -> List[TestResult]:
|
||||
"""Invoke the given `Test`'s with the provided `TestConfig`."""
|
||||
results = []
|
||||
for test in tests:
|
||||
# TODO: Precompile everything in parallel.
|
||||
try:
|
||||
print(f"GENERATE TRACE: {test}")
|
||||
golden_trace = generate_golden_trace(test)
|
||||
print(f"COMPILE: {test}")
|
||||
compiled = config.compile(test.program_factory())
|
||||
except Exception as e:
|
||||
# Useful for debugging:
|
||||
|
@ -307,7 +310,11 @@ def run_tests(tests: List[Test], config: TestConfig) -> List[TestResult]:
|
|||
golden_trace=None))
|
||||
continue
|
||||
# TODO: Run in parallel.
|
||||
if verbose:
|
||||
print(f"RUN: {test}")
|
||||
trace = config.run(compiled, golden_trace)
|
||||
if verbose:
|
||||
print(f"FINISHED: {test}")
|
||||
results.append(
|
||||
TestResult(unique_name=test.unique_name,
|
||||
compilation_error=None,
|
||||
|
|
Loading…
Reference in New Issue