APITest 测试基建:统一参数校验与 sanitizer 输出#656
Merged
cangtianhuang merged 5 commits intoJun 22, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🧭 背景
engineV2.py与engineV4.py都支持通过--api_config直接运行单条 API 配置,但 GPU 参数解析、错误提示和返回行为不完全一致engineV4.py额外支持 compute-sanitizer 包裹执行,单条用例场景下需要和普通执行路径保持一致的 GPU 选择与参数校验体验🛠️ 实现方案
[argument error],兼容性提示统一为[argument warning]CUDA_VISIBLE_DEVICES[Pass]行,保留 sanitizer error summary 并输出明确错误摘要🔧 主要变更
1. 统一 GPU 参数解析与错误提示
--gpu_ids解析,支持单个 id、逗号列表、闭区间 range 和-1全选-1与显式 id 混用、空列表等场景输出带上下文的错误信息--num_gpus、--num_workers_per_gpu、--required_memory的非法取值输出包含当前值和期望范围的错误信息2. 修复 single-case GPU 选择行为
--api_config单条运行时,GPU 模式只允许解析出一张设备CUDA_VISIBLE_DEVICES,确保 V2/V4 single-case 路径使用用户指定设备3. 完善 V4 single-case sanitizer 行为
[Pass]行,保留真实 sanitizer 错误输出并打印明确失败摘要4. 优化 CLI help 文案
--api_config_file、--api_config_file_pattern、--api_config、GPU/worker 参数和测试模式参数更直观--use_cached_numpy的布尔解析调整为更符合 CLI 直觉的显式布尔解析📁 改动文件
engineV2.pyengineV4.py