"vscode:/vscode.git/clone" did not exist on "1362732c79a58de5e9d89bc7fe5bdd78e607597e"
Commit 3d139316 authored by wooway777's avatar wooway777 Committed by MaYuhang
Browse files

issue/573 - fixed hardware args

fixed an issue where hardware arguments are not passed to subprocess when help information requires them to be parsed first but consequently makes them not passed
parent 559e5fe2
...@@ -182,9 +182,9 @@ pip install . -e ...@@ -182,9 +182,9 @@ pip install . -e
```bash ```bash
# 测试单算子 # 测试单算子
python test/infinicore/ops/[operator].py [--cpu | --nvidia | --cambricon | --ascend | --iluvatar | --metax | --moore | --kunlun | --Hygon] python test/infinicore/ops/[operator].py [--bench | --debug] [--cpu | --nvidia | --cambricon | --ascend | --iluvatar | --metax | --moore | --kunlun | --Hygon]
# 测试全部算子 # 测试全部算子
python test/infinicore/run.py [--cpu | --nvidia | --cambricon | --ascend | --iluvatar | --metax | --moore | --kunlun] python test/infinicore/run.py [--bench | --debug] [--cpu | --nvidia | --cambricon | --ascend | --iluvatar | --metax | --moore | --kunlun]
``` ```
使用 -h 查看更多参数。 使用 -h 查看更多参数。
......
...@@ -335,28 +335,20 @@ def main(): ...@@ -335,28 +335,20 @@ def main():
help="List all available test files without running them", help="List all available test files without running them",
) )
# Hardware platform options using shared function
from framework import get_hardware_args_group from framework import get_hardware_args_group
hardware_group = get_hardware_args_group(parser) if "-h" in sys.argv or "--help" in sys.argv:
get_hardware_args_group(parser)
# Parse known args first, leave the rest for the test scripts # Parse known args first, leave the rest for the test scripts
args, unknown_args = parser.parse_known_args() args, unknown_args = parser.parse_known_args()
get_hardware_args_group(parser)
# Handle list command # Handle list command
if args.list: if args.list:
list_available_tests(args.ops_dir) list_available_tests(args.ops_dir)
return return
# Check for --bench option in extra arguments
for arg in unknown_args:
if arg in ["--bench"]:
print("❌ ERROR: --bench option is not allowed in batch testing mode.")
print("")
print("Solution: Run individual test scripts for benchmarking:")
print(" python path/to/individual_test.py --bench --<platform>")
sys.exit(1)
# Auto-detect ops directory if not provided # Auto-detect ops directory if not provided
if args.ops_dir is None: if args.ops_dir is None:
ops_dir = find_ops_directory() ops_dir = find_ops_directory()
......
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