From 30b43b72cfd4488736fdec80f86557ebf44aa7a8 Mon Sep 17 00:00:00 2001 From: wooway777 Date: Wed, 11 Feb 2026 16:03:11 +0800 Subject: [PATCH] issue/1016 - limiting run.py default to common operators --- README.md | 2 +- test/infinicore/run.py | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 917735265..d90316109 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,7 @@ pip install -e . ```bash # 测试单算子 python test/infinicore/ops/[operator].py [--bench | --debug | --verbose] [--cpu | --nvidia | --cambricon | --ascend | --iluvatar | --metax | --moore | --kunlun | --Hygon | --ali] -# 测试全部算子 +# 测试常见算子 python test/infinicore/run.py [--bench | --debug | --verbose] [--cpu | --nvidia | --cambricon | --ascend | --iluvatar | --metax | --moore | --kunlun | --ali] ``` diff --git a/test/infinicore/run.py b/test/infinicore/run.py index 1b5e34067..3bb95e1aa 100644 --- a/test/infinicore/run.py +++ b/test/infinicore/run.py @@ -28,7 +28,7 @@ def generate_help_epilog(ops_dir=None): # Examples section epilog_parts.append("Examples:") - epilog_parts.append(" # Run all operator tests on CPU") + epilog_parts.append(" # Run common operator tests on CPU") epilog_parts.append(" python run.py --cpu") epilog_parts.append("") epilog_parts.append(" # Run specific operators") @@ -317,7 +317,7 @@ def main(): if not valid_ops: # Case A: User input provided, but ALL were invalid. print(f"⚠️ No valid operators remained from your list.") - print(f"🔄 Fallback: Proceeding to run ALL available tests...") + print(f"🔄 Fallback: Proceeding to run common tests...") else: # Case B: At least some valid operators found. print(f"🎯 Targeted operators: {', '.join(valid_ops)}") @@ -332,6 +332,18 @@ def main(): ops_dir=args.ops_dir, verbose=args.verbose, bench_mode=args.bench ) + # default to common operators if none specified + if target_ops is None: + target_ops = [ + "add", + "causal_softmax", + "matmul", + "random_sample", + "rms_norm", + "rope", + "swiglu", + ] + success, _ = test_manager.test( target_ops=target_ops, global_exec_args=global_exec_args )