Unverified Commit 3f042fd3 authored by pengcheng888's avatar pengcheng888 Committed by GitHub
Browse files

Merge pull request #643 from InfiniTensor/issue/642

issue/642 - added a breakpoint in run.py debug
parents 685b6e03 36b94a18
import os import os
import sys import sys
import argparse import argparse
import traceback
from pathlib import Path from pathlib import Path
import importlib.util import importlib.util
...@@ -110,7 +111,12 @@ def import_operator_test(test_file_path): ...@@ -110,7 +111,12 @@ def import_operator_test(test_file_path):
def run_all_op_tests( def run_all_op_tests(
ops_dir=None, specific_ops=None, bench=False, bench_mode="both", verbose=False ops_dir=None,
specific_ops=None,
bench=False,
bench_mode="both",
verbose=False,
debug=False,
): ):
""" """
Run all operator test scripts in the ops directory using direct import. Run all operator test scripts in the ops directory using direct import.
...@@ -370,6 +376,10 @@ def run_all_op_tests( ...@@ -370,6 +376,10 @@ def run_all_op_tests(
print(f"{'!'*60}") print(f"{'!'*60}")
break break
if debug:
traceback.print_exc()
break
return results, cumulative_timing return results, cumulative_timing
...@@ -645,6 +655,11 @@ def main(): ...@@ -645,6 +655,11 @@ def main():
action="store_true", action="store_true",
help="Enable verbose mode to stop on first error with full traceback", help="Enable verbose mode to stop on first error with full traceback",
) )
parser.add_argument(
"--debug",
action="store_true",
help="Enable debug mode to debug value mismatches",
)
parser.add_argument( parser.add_argument(
"--bench", "--bench",
nargs="?", nargs="?",
...@@ -729,6 +744,7 @@ def main(): ...@@ -729,6 +744,7 @@ def main():
bench=bool(args.bench), bench=bool(args.bench),
bench_mode=args.bench if args.bench else "both", bench_mode=args.bench if args.bench else "both",
verbose=args.verbose, verbose=args.verbose,
debug=args.debug,
) )
# Print summary and exit with appropriate code # Print summary and exit with appropriate code
......
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