50 lines
1.5 KiB
Python
50 lines
1.5 KiB
Python
|
|
"""一键运行所有测试"""
|
||
|
|
import subprocess
|
||
|
|
import sys
|
||
|
|
import os
|
||
|
|
import time
|
||
|
|
|
||
|
|
|
||
|
|
SCRIPTS = [
|
||
|
|
("环境检查", "vsp/qwen3.5-9b/setup_env.py"),
|
||
|
|
("模型下载", "vsp/qwen3.5-9b/download_model.py"),
|
||
|
|
("基础推理测试", "vsp/qwen3.5-9b/test_basic_inference.py"),
|
||
|
|
("性能基准测试", "vsp/qwen3.5-9b/benchmark_speed.py"),
|
||
|
|
("精度评估", "vsp/qwen3.5-9b/test_accuracy.py"),
|
||
|
|
("并发压测", "vsp/qwen3.5-9b/test_concurrency.py"),
|
||
|
|
("GPU需求分析", "vsp/qwen3.5-9b/gpu_requirements.py"),
|
||
|
|
("生成报告", "vsp/qwen3.5-9b/generate_report.py"),
|
||
|
|
]
|
||
|
|
|
||
|
|
|
||
|
|
def main():
|
||
|
|
os.chdir(os.path.dirname(os.path.abspath(__file__)) + "/../..")
|
||
|
|
print("=" * 60)
|
||
|
|
print("Qwen3.5-9B 全量测试")
|
||
|
|
print("=" * 60)
|
||
|
|
|
||
|
|
for name, script in SCRIPTS:
|
||
|
|
print(f"\n{'='*60}")
|
||
|
|
print(f"[{name}] 运行 {script}")
|
||
|
|
print("=" * 60)
|
||
|
|
|
||
|
|
t0 = time.time()
|
||
|
|
result = subprocess.run([sys.executable, script], capture_output=False)
|
||
|
|
elapsed = time.time() - t0
|
||
|
|
|
||
|
|
if result.returncode != 0:
|
||
|
|
print(f"\n[ERROR] {name} 失败 (退出码: {result.returncode})")
|
||
|
|
choice = input("继续运行后续测试?(y/n): ").strip().lower()
|
||
|
|
if choice != "y":
|
||
|
|
sys.exit(1)
|
||
|
|
else:
|
||
|
|
print(f"\n[OK] {name} 完成 ({elapsed:.1f}s)")
|
||
|
|
|
||
|
|
print(f"\n{'='*60}")
|
||
|
|
print("所有测试完成!查看报告: vsp/qwen3.5-9b/results/REPORT.md")
|
||
|
|
print("=" * 60)
|
||
|
|
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
main()
|