| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix(cli): validate dump modes (#197) Co-authored-by: gcw_Z57idahf<liaopinyi714@outlook.com> # message auto-generated for no-merge-commit merge: !279 merge codex/fix-dump-mode-validation into master fix(cli): validate dump modes (#197) Created-by: gcw_Z57idahf Commit-by: gcw_Z57idahf;liaopinyi714@outlook.com Merged-by: cann-robot Description: ## 描述 本 PR 修复一个独立的质量问题:--dump 的帮助文本只列出 full、in、out、golden、xpu,但实现遇到拼写错误或未知模式时静默跳过,命令仍继续执行并可能没有生成用户要求的数据。 复现输入:调用 _apply_dump_config(config, in, typo),观察函数不报错且只启用 in 模式。 问题影响:自动化任务可能以成功状态结束,却缺少输入、golden 或 XPU 输出,后续比较结果难以解释。 ## 根因 _apply_dump_config 原来只对已知分支执行动作,没有 else 错误路径;因此任意拼写错误都会被当作空操作吞掉。 ## 修改内容 预先校验全部 dump token,发现未知值时抛出包含允许值的 ValueError;合法 token 继续支持空格和逗号列表。 - 影响范围:影响非法 --dump 值的错误反馈;full、in、out、golden、xpu 的正常行为不变。 - 变更文件:ttk/cli/bridge.py;tests/cli/test_dump_mode_validation.py。 - 仅修正边界输入、错误反馈或失败状态传播,正常输入路径保持兼容。 ## 预期结果 未知模式应在参数处理阶段明确报错并列出允许值,同时不应部分修改 dump 配置。 ## 变更类型 - [x] 🐛 Bug 修复 ## 关联的Issue 关联 Issue #197 ## 如何测试 新增未知模式拒绝和合法模式空格处理测试通过;py_compile;git diff --check;无需 CANN/NPU 环境。 回归测试覆盖问题触发条件;同时执行 py_compile 和 git diff --check。该修改不需要 CANN/NPU 硬件即可完成基础验证,仓库标准流水线可继续执行完整测试。 ## 风险与兼容性 风险等级:**L2**。修改集中在输入规范化、配置对象隔离、报告容错或工具检查,不改变正常路径的公共接口和输出结构。 ## 核对清单 - [x] 我的代码遵循了项目代码风格 - [x] 我已对代码进行了自测 - [x] 我已阅读相关贡献指南 See merge request: cann/ops-test-kit!279 | 1 个月前 | |
fix: pre-commit code Co-authored-by: wangrui<wangrui124@huawei.com> # message auto-generated for no-merge-commit merge: !199 merge br_geir into master fix: pre-commit code Created-by: wangrui_ Commit-by: wangrui Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: 让全仓代码通过 pre-commit 全套 hook(ruff check + ruff format + codespell + trailing-whitespace / end-of-file-fixer / check-yaml 等基础 hook),共涉及 255 个文件(+9975/-7615)。 #### 修复内容分类 | 类别 | 规则 | 处理方式 | 数量 | |------|------|---------|------| | 真 bug | F821 | 字符串前向注解补 TYPE_CHECKING 导入;删死代码 del cas_mm | 13 | | | F811 | 删 testcase_op.py 被覆盖的重复 @property | 2 | | | B012 | profiling.py finally 内 return 重构为 try/except 后顺序执行 | 1 | | | hccl_cascade timeout | 主线笔误 timeout 未定义(10 处 F821),提取 _get_timeout() 为变量 | 10 | | 设计类豁免 | B027/B024 | 可选 hook / 抽象基类加 # noqa | 9 | | | E402 | backend 文件调换 docstring↔__future__ 顺序;延迟导入加 # noqa | 16 | | | F405/F403 | import * 展开为显式 import | 55 | | 异常处理 | E722 | 裸 except: → except Exception: | 37 | | | B904 | raise X → raise X from e(链式)/ from None(有意屏蔽) | 9 | | 未用代码 | F401 | re-export 导入加冗余别名 import x as x(不改 import * 行为) | 35 | | | F841 | 删确未使用的局部变量赋值 | 25 | | | B007 | 未用循环变量 → _ | 15 | | 格式化 | UP031 | % 格式化 → f-string(用 float()/str() 强转保留 printf 语义) | 88 | | | E712/E741/E731/B005 等 | != True→~、模糊名 l→ci、lambda→def、rstrip 多字符精确化 | 6 | | | trailing-ws / eof | 自动修复 | 23 | #### codespell 修复 - .gitcode/ISSUE_TEMPLATE/feature-request.yml:Backgroud → Background(真错字) - codespell 忽略列表加 dOut(数据术语 derivative output,误报) ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: - **非纯格式化**:除格式化外混入了 37 处 except:→except Exception: + 9 处 from e/from None 的异常处理变更(E722/B904,ruff 无自动修复,手动逐处确认语义安全),以及 10 处 hccl_cascade timeout bug 修复。 - **F841/B007 为 unsafe fix**:项目 pre-commit 配置未启用 --unsafe-fixes,这些删除/改名是手动执行并逐一确认变量确实未使用。 - **printf→f-string 保语义**:%-14.18f → {float(x):<14.18f}(加 float() 强转,因为 ml_dtypes.int4 的 printf 会强转但 f-string :f 不会),输出逐字节一致。 - **re-export 用冗余别名**:11 个 __init__.py / shim 模块的 F401 修复用 import x as x 而非 __all__,完全不改 from module import * 行为。 ## 测试 - pre-commit 9 hook 全 Passed - ruff check / ruff format 全绿 - 1321 个非设备测试通过(0 失败,20 skip 为预存在的 torch_npu/tf 冲突) - ttk 全模块 walk-import 冒烟通过(唯一失败 executor_main 为预存在的运行时依赖) ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:代码质量清理 / lint 规范化 See merge request: cann/ops-test-kit!199 | 2 个月前 | |
fix(comparison): mix_tolerance 按精度标准锚定 ULP 动态上限并增加 ±inf 收窄比对 Co-authored-by: dengguojie<dengguojie@huawei.com> # message auto-generated for no-merge-commit merge: !292 merge 0923 into master fix(comparison): mix_tolerance 按精度标准锚定 ULP 动态上限并增加 ±inf 收窄比对 Created-by: dengguojie Commit-by: dengguojie Merged-by: cann-robot Description: ### 当前PR是否有AI参与: [x] 是 __1. AI Agent 平台:OpenCode __2. AI 模型:GLM __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: mix_tolerance 按精度标准(cann/opbase#924 §2.1.2/§2.3)实现 max_abs_error_limit 动态上限与 ±inf 收窄比对: 1. **ULP 动态上限**:固定 32*ULP(1.0) 常数改为锚定最大有限误差点 max(兜底值, 32*ULP(g_low)),上限随被测 dtype 与值域自适应缩放,修复大值域 用例被固定常数误杀;锚定无 dtype 前提(同 dtype 收窄为恒等,插件 golden / manual replay 路径同样生效) 2. **±inf 收窄比对**:actual=±inf 处 golden 按 RNE 收窄到被测 dtype(超范围→ ±inf),同号 ±inf 视为一致 3. **显式配置完全替代**:Spec 配置 max_abs_error_limit 时整条替代动态式 (配置值即最终上限);resolve 表剥离固化 32*eps(float8 两档偏差一并修正) 实测:12 条极值用例(fp16/bf16 边界、fp32 大值域)由 38/54 误报修正为全过。 适配 opbase PR:https://gitcode.com/cann/opbase/pull/924 ### 希望检视人员了解: **1. 配置语义的方案取舍**:曾考虑开放 ULP 倍数(ulp_tolerance=N,语义最贴 标准),但需改 resolve 表/Spec 白名单/文档三处链路并审计存量用例,超出本 PR 范围。故采用显式配置完全替代:默认走标准动态式,显式配置=专家模式接管。 配置影响已在 6 处文档说明(配置值即最终上限、不再叠加 ULP——大值域失去 值域自适应放行)。 **2. 已知边界**: - 锚点为 dtype 最大有限值(fp16 65504)时 spacing=inf → 特判退一格取同 binade 前驱格宽(fp16 最大 binade=32 → limit=1024 而非 inf) - 锚点超 dtype 范围时 ulp=nan → max() 依赖 floor 在前回退(代码注释钉死顺序), 该场景 rtol 腿先行拦截,limit 取值无影响 **3. 行为变更**:大值域输出(32×ULP > 旧固定上限)从误杀变放行(修复目标); 显式配置用户行为与改前一致。 ## 测试 - 新增 8 场景单测:大值域放行 / 小值域兜底 / 显式配置完全替代 / inf-cast / 同 dtype 动态生效 / 65504 binade 格宽 / resolve 契约 / 全元素 ±inf 同号 - 比对模块 136 passed;全量 1694 passed - thnn_fused_gru_cell_grad 算子实测(12 条极值用例误报修正) ## 类型标签 <!-- [x] 表示选中 --> - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-test-kit!292 | 1 个月前 | |
feat: combine offline and remote XPU output workflows Co-authored-by: gcw_YBIAEfqJ<wangweidong15@huawei.com> # message auto-generated for no-merge-commit merge: !221 merge feature/xpu-offline-dump-combined into master feat: combine offline and remote XPU output workflows Created-by: gcw_YBIAEfqJ Commit-by: gcw_YBIAEfqJ Merged-by: cann-robot Description: ### 当前PR是否有AI参与: [ ] 否 [x] 是 __1. AI Agent 平台: OpenCode __2. AI 模型: GPT-5.6 __3. Prompt上下文: 合并 PR #162 与 PR #217,并将离线 XPU 输出字段统一命名为 manual_xpu_binaries ### PR功能描述 / 为什么需要这个合入**: 本 PR 合并原 #162 和 #217 的相关功能,并基于当前 master 重新整理: - 支持 Kernel 使用 manual_xpu_binaries 回放本地 XPU 输出文件进行 cross_check,校验输入、Golden 和输出数量后跳过远端 dispatch。 - 将远端 XPU 输出落盘整合为 --dump xpu,可与 in,out,golden 组合,复用 --dump-format,覆盖多 provider、多输出和嵌套 TensorList。 - XPU dump 状态归入 DumpConfig.xpu,统一由 _apply_dump_config 解析;删除独立 --dump-xpu 参数。 - 保持 --dump full 原有 input/output/golden 语义,只有显式包含 xpu 才请求远端输出。 - 补齐 E2E/ACLNN XPU 调度路径、资源清理、CLI 文档及回归测试。 - 旧字段 manual_third_party_binaries 已统一改为 manual_xpu_binaries。 该组合 PR supersedes 原 PR #162 和 #217,避免两个 PR 分别修改相同的 XPU 处理链路。 ### 该PR关联的issue 无 ### 希望检视人员了解: 组合分支从当前 master 重新构造,未携带原 PR 的旧分支历史。 检视意见修复提交:9524dd9b9 fix: fold XPU output into dump options。 pre-commit 格式与合规修复提交:72f668e0e fix: resolve PR 221 precommit findings。 ## 测试 - pytest -q: 1386 passed, 24 skipped - pre-commit run --show-diff-on-failure --files ...: 全部通过(含 OAT) - tests/cli/test_xpu_perf_collect.py 等 XPU/CLI targeted tests: passed - ruff check --ignore E501 --select E,F,I,B(变更代码和测试): passed - python3 -m compileall -q ttk tests: passed - git diff --check: passed - python3 -m ttk kernel --help: 仅展示 --dump [DUMP],类别包含 xpu ## 文档更新 已同步更新 CLAUDE.md、运行 Skill、Dump 指南、任务执行参数和 XPU 使用指南,所有资料均使用 --dump xpu,无 --dump-xpu 残留。 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-test-kit!221 | 1 个月前 | |
feat:生态算子开源精度标准 Co-authored-by: chenqianyu<chenqianyu1@h-partners.com> # message auto-generated for no-merge-commit merge: !214 merge mix_tol into master feat:生态算子开源精度标准 Created-by: FishPotatoChen Commit-by: chenqianyu Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: 引入生态算子开源精度标准(混合容差 mix_tolerance),并作为浮点输出的默认精度比对方法,替换原默认的统计相对误差 stat_rel_err。 **主要改动:** 1. **新增 mix_tolerance 比对判据**(ttk/core_modules/comparison/mix_tolerance.py) - 逐元素通过条件:|a - g| <= atol + rtol * |g|(atol 兜底小值场景,天然避免除零;rtol 保证大值相对精度) - 整体通过条件:matched_ratio >= required_matched_ratio(0.99) 且 max_abs_error <= max_abs_error_limit(硬上限拦灾难性离群点) - NaN/Inf 特殊处理:双方同 NaN / 同号 Inf 视为一致;NaN/Inf 位置不一致视为无界误差,直接 FAIL 2. **按 dtype 的阈值表**(ttk/core_modules/comparison/resolve.py) - 覆盖 float16 / bfloat16 / float32 / hifloat32 / float8_e4m3fn / float8_e5m2,max_abs_error_limit 取 1e-X 与 32*ULP 满足任一;表外浮点 dtype(如 float64)回落 float32 档 - Spec.tolerance 中可按 dtype 覆盖 rtol / atol / required_matched_ratio / max_abs_error_limit 3. **默认路由切换**:未指定 --compare 且无 Spec.tolerance 时,普通浮点输出从 stat_rel_err 切换到 mix_tolerance;float8_e5m2/float8_e4m3fn 不再默认走 requant(requant 自动路由收窄至 hifloat8),可通过 --compare requant / --compare stat_rel_err 显式回退 4. **配置冲突护栏**:Spec.tolerance 只配 threshold(stat_rel_err 专属参数)而实际解析到 mix_tolerance 时,当场报错而非静默丢弃阈值,避免宽松阈值误报 / 严格阈值漏报 5. **CLI / Spec 接入**:--compare 新增 mix_tolerance 取值;Spec.tolerance 的 standard 字段新增 mix_tolerance 为官方标准 ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes [#144](https://gitcode.com/cann/ops-test-kit/issues/144) ### 希望检视人员了解: - **行为变更**:默认精度判据由 stat_rel_err 变为 mix_tolerance,已有用例若未显式指定比对方法,精度结果可能发生变化;需要旧行为请显式 --compare stat_rel_err - CSV 的 precision_tolerances / absolute_precision 为 legacy 字段,仅 close/cosine 读取;默认 mix_tolerance 的容差调整需在 TestSpec tolerance 中覆盖(需 --plugin) - resolve.py 仍是容差解析唯一入口,比对类不查表,只消费解析好的最终值 ## 测试 <!--描述进行了哪些测试来验证你的改动。--> - 新增单元测试 tests/core_modules/comparison/test_mix_tolerance.py:覆盖逐元素通过条件、atol/rtol 各自兜底场景、matched_ratio 边界、max_abs_error 硬上限、NaN/Inf 真值表、size 不一致 - 扩展 tests/core_modules/comparison/test_resolve_tolerance.py:默认路由切换(float32/float8 → mix_tolerance)、多输出混合 dtype 路由、阈值表默认值、表外 dtype 回落、Spec 覆盖、threshold 与 mix_tolerance 冲突报错护栏 - 更新 test_compare_integration.py / test_validator_tolerance.py 适配新默认值 - 全量单测通过(pytest tests/) ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> - docs/Precision_Comparison.md:新增混合容差章节(公式、dtype 阈值表、NaN/Inf 处理、使能方式),全文方法编号与默认值说明更新 - docs/FAQ/faq_guide.md:精度方法推荐表、容差调整说明(含 legacy CSV 字段生效范围提示) - ttk/test_spec/README.md:tolerance standard 表新增 mix_tolerance 及可覆盖参数说明 - README.md / README-EN.md / CLAUDE.md / .claude/skills/* / docs/NPUSim/* / docs/Task_Execution.md / docs/Test_Case_Generation.md / docs/XPU_Cross_Check.md:默认比对方法描述同步更新 - ttk/test_spec/examples/04_golden_tolerance_compare.py / 05_pre_compare_customize_inputs.py:示例同步 ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-test-kit!214 | 1 个月前 | |
fix(plog): honor non-positive line limits (#191) Co-authored-by: gcw_Z57idahf<liaopinyi714@outlook.com> # message auto-generated for no-merge-commit merge: !272 merge codex/fix-plog-max-lines into master fix(plog): honor non-positive line limits (#191) Created-by: gcw_Z57idahf Commit-by: gcw_Z57idahf;liaopinyi714@outlook.com Merged-by: cann-robot Description: ## 描述 本 PR 修复一个独立的质量问题:extract_plog_errors 使用 lines[-max_lines:] 截取结果,max_lines=0 会变成 lines[0:],返回全部内容;负数也会产生反直觉结果。 触发场景:调用 extract_plog_errors(max_lines=0) 或 extract_plog_errors(max_lines=-1)。 现状会导致:调用方按配置关闭日志摘录时仍会获得完整日志,增大错误报告体积并违背参数语义。 ## 根因 代码直接使用 lines[-max_lines:];当 max_lines 为 0 时表达式退化为 lines[0:],负数也会产生与参数语义相反的切片结果。 ## 修改内容 在扫描文件前处理非正 max_lines,并增加 0 与负数回归测试。 - 影响范围:影响调用方用 0 或负数关闭日志摘录的边界场景;正数截取逻辑保持不变。 - 变更文件:ttk/utilities/plog_utils.py;tests/utilities/test_plog_utils.py。 - 保持正常输入和既有接口行为不变,仅补齐边界输入的处理。 ## 预期结果 非正行数限制应返回空列表,不应泄漏或重复输出整份 plog。 ## 变更类型 - [x] 🐛 Bug 修复 ## 关联的Issue 关联 Issue #191 ## 如何测试 新增 2 项 max_lines 边界测试通过;py_compile;git diff --check;无需 CANN/NPU 环境。 复现用例覆盖触发问题的边界输入;同时执行了语法检查和 git diff --check。该修复不需要 CANN/NPU 硬件即可验证,平台流水线可继续执行仓库标准测试。 ## 风险与兼容性 风险等级:**L2**。修改集中在输入校验、编码选择、文件选择或错误处理逻辑,不改变正常路径的输出格式和公共调用方式。 ## 核对清单 - [x] 我的代码遵循了项目代码风格 - [x] 我已对代码进行了自测 - [x] 我已阅读相关贡献指南 See merge request: cann/ops-test-kit!272 | 1 个月前 | |
fix: pre-commit code Co-authored-by: wangrui<wangrui124@huawei.com> # message auto-generated for no-merge-commit merge: !199 merge br_geir into master fix: pre-commit code Created-by: wangrui_ Commit-by: wangrui Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: 让全仓代码通过 pre-commit 全套 hook(ruff check + ruff format + codespell + trailing-whitespace / end-of-file-fixer / check-yaml 等基础 hook),共涉及 255 个文件(+9975/-7615)。 #### 修复内容分类 | 类别 | 规则 | 处理方式 | 数量 | |------|------|---------|------| | 真 bug | F821 | 字符串前向注解补 TYPE_CHECKING 导入;删死代码 del cas_mm | 13 | | | F811 | 删 testcase_op.py 被覆盖的重复 @property | 2 | | | B012 | profiling.py finally 内 return 重构为 try/except 后顺序执行 | 1 | | | hccl_cascade timeout | 主线笔误 timeout 未定义(10 处 F821),提取 _get_timeout() 为变量 | 10 | | 设计类豁免 | B027/B024 | 可选 hook / 抽象基类加 # noqa | 9 | | | E402 | backend 文件调换 docstring↔__future__ 顺序;延迟导入加 # noqa | 16 | | | F405/F403 | import * 展开为显式 import | 55 | | 异常处理 | E722 | 裸 except: → except Exception: | 37 | | | B904 | raise X → raise X from e(链式)/ from None(有意屏蔽) | 9 | | 未用代码 | F401 | re-export 导入加冗余别名 import x as x(不改 import * 行为) | 35 | | | F841 | 删确未使用的局部变量赋值 | 25 | | | B007 | 未用循环变量 → _ | 15 | | 格式化 | UP031 | % 格式化 → f-string(用 float()/str() 强转保留 printf 语义) | 88 | | | E712/E741/E731/B005 等 | != True→~、模糊名 l→ci、lambda→def、rstrip 多字符精确化 | 6 | | | trailing-ws / eof | 自动修复 | 23 | #### codespell 修复 - .gitcode/ISSUE_TEMPLATE/feature-request.yml:Backgroud → Background(真错字) - codespell 忽略列表加 dOut(数据术语 derivative output,误报) ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: - **非纯格式化**:除格式化外混入了 37 处 except:→except Exception: + 9 处 from e/from None 的异常处理变更(E722/B904,ruff 无自动修复,手动逐处确认语义安全),以及 10 处 hccl_cascade timeout bug 修复。 - **F841/B007 为 unsafe fix**:项目 pre-commit 配置未启用 --unsafe-fixes,这些删除/改名是手动执行并逐一确认变量确实未使用。 - **printf→f-string 保语义**:%-14.18f → {float(x):<14.18f}(加 float() 强转,因为 ml_dtypes.int4 的 printf 会强转但 f-string :f 不会),输出逐字节一致。 - **re-export 用冗余别名**:11 个 __init__.py / shim 模块的 F401 修复用 import x as x 而非 __all__,完全不改 from module import * 行为。 ## 测试 - pre-commit 9 hook 全 Passed - ruff check / ruff format 全绿 - 1321 个非设备测试通过(0 失败,20 skip 为预存在的 torch_npu/tf 冲突) - ttk 全模块 walk-import 冒烟通过(唯一失败 executor_main 为预存在的运行时依赖) ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:代码质量清理 / lint 规范化 See merge request: cann/ops-test-kit!199 | 2 个月前 | |
fix: pre-commit code Co-authored-by: wangrui<wangrui124@huawei.com> # message auto-generated for no-merge-commit merge: !199 merge br_geir into master fix: pre-commit code Created-by: wangrui_ Commit-by: wangrui Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: 让全仓代码通过 pre-commit 全套 hook(ruff check + ruff format + codespell + trailing-whitespace / end-of-file-fixer / check-yaml 等基础 hook),共涉及 255 个文件(+9975/-7615)。 #### 修复内容分类 | 类别 | 规则 | 处理方式 | 数量 | |------|------|---------|------| | 真 bug | F821 | 字符串前向注解补 TYPE_CHECKING 导入;删死代码 del cas_mm | 13 | | | F811 | 删 testcase_op.py 被覆盖的重复 @property | 2 | | | B012 | profiling.py finally 内 return 重构为 try/except 后顺序执行 | 1 | | | hccl_cascade timeout | 主线笔误 timeout 未定义(10 处 F821),提取 _get_timeout() 为变量 | 10 | | 设计类豁免 | B027/B024 | 可选 hook / 抽象基类加 # noqa | 9 | | | E402 | backend 文件调换 docstring↔__future__ 顺序;延迟导入加 # noqa | 16 | | | F405/F403 | import * 展开为显式 import | 55 | | 异常处理 | E722 | 裸 except: → except Exception: | 37 | | | B904 | raise X → raise X from e(链式)/ from None(有意屏蔽) | 9 | | 未用代码 | F401 | re-export 导入加冗余别名 import x as x(不改 import * 行为) | 35 | | | F841 | 删确未使用的局部变量赋值 | 25 | | | B007 | 未用循环变量 → _ | 15 | | 格式化 | UP031 | % 格式化 → f-string(用 float()/str() 强转保留 printf 语义) | 88 | | | E712/E741/E731/B005 等 | != True→~、模糊名 l→ci、lambda→def、rstrip 多字符精确化 | 6 | | | trailing-ws / eof | 自动修复 | 23 | #### codespell 修复 - .gitcode/ISSUE_TEMPLATE/feature-request.yml:Backgroud → Background(真错字) - codespell 忽略列表加 dOut(数据术语 derivative output,误报) ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: - **非纯格式化**:除格式化外混入了 37 处 except:→except Exception: + 9 处 from e/from None 的异常处理变更(E722/B904,ruff 无自动修复,手动逐处确认语义安全),以及 10 处 hccl_cascade timeout bug 修复。 - **F841/B007 为 unsafe fix**:项目 pre-commit 配置未启用 --unsafe-fixes,这些删除/改名是手动执行并逐一确认变量确实未使用。 - **printf→f-string 保语义**:%-14.18f → {float(x):<14.18f}(加 float() 强转,因为 ml_dtypes.int4 的 printf 会强转但 f-string :f 不会),输出逐字节一致。 - **re-export 用冗余别名**:11 个 __init__.py / shim 模块的 F401 修复用 import x as x 而非 __all__,完全不改 from module import * 行为。 ## 测试 - pre-commit 9 hook 全 Passed - ruff check / ruff format 全绿 - 1321 个非设备测试通过(0 失败,20 skip 为预存在的 torch_npu/tf 冲突) - ttk 全模块 walk-import 冒烟通过(唯一失败 executor_main 为预存在的运行时依赖) ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:代码质量清理 / lint 规范化 See merge request: cann/ops-test-kit!199 | 2 个月前 | |
fix: avoid truncating ASCEND_OPP_PATH (issue #139) Co-authored-by: atlasleong<2235102484@qq.com> # message auto-generated for no-merge-commit merge: !222 merge fix/issue-139-opp-path into master fix: avoid truncating ASCEND_OPP_PATH (issue #139) Created-by: atlasleong Commit-by: atlasleong Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [ ] 否 [x] 是 __1. AI Agent 平台: OpenAI Codex __2. AI 模型: GPT-5 __3. Prompt上下文: 分析并修复 Issue #139 中 ASCEND_OPP_PATH 使用 str.rstrip 导致路径误截断的问题;补充回归测试,并在 CANN 9.0.0 环境中验证。 ### PR功能描述 / 为什么需要这个合入**: str.rstrip("/opp") 会把参数当作字符集合,而不是精确后缀,因此会错误截断以 o 或 p 结尾的合法路径。 本 PR 使用 os.path.normpath 规范化路径,并仅在最后一个路径组件严格等于 opp 时取其父目录。同时补充回归测试,覆盖普通路径名以及 opp 路径有无尾随分隔符的场景。 ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes #139 ### 希望检视人员了解: 项目支持 Python 3.8,因此未采用 Python 3.9 才提供的 str.removesuffix。全量非 device/e2e 测试在本地容器收集阶段因缺少可选依赖 torch 和 jinja2 未完成;本次改动相关用例与邻接测试均已通过。 ## 测试 - python -m pytest tests/test_env.py tests/cli/test_kernel_config.py -q: 8 passed - python -m ruff check ttk/_env.py tests/test_env.py: passed - python -m compileall -q ttk tests/test_env.py: passed - CANN 9.0.0 实际环境验证:ASCEND_OPP_PATH=/usr/local/Ascend/cann-9.0.0/opp 正确解析为 /usr/local/Ascend/cann-9.0.0 ## 文档更新 无。 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-test-kit!222 | 1 个月前 | |
fix: 回退 compare 钩子对 None golden 的整体禁用,抑制位置交由插件钩子自行处理 Co-authored-by: wangrui<wangrui124@huawei.com> # message auto-generated for no-merge-commit merge: !262 merge br_bugfix into master fix: 回退 compare 钩子对 None golden 的整体禁用,抑制位置交由插件钩子自行处理 Created-by: wangrui_ Commit-by: wangrui Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-test-kit!262 | 1 个月前 | |
fix(geir): dynamic 模式下 ori_shape 使用动态 shape(-1/-2) Co-authored-by: xuejinghui<xuejinghui@huawei.com> # message auto-generated for no-merge-commit merge: !148 merge geir_fix into master fix(geir): dynamic 模式下 ori_shape 使用动态 shape(-1/-2) Created-by: xuejinghui Commit-by: xuejinghui Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [ ] 否 [x] 是 __1. AI Agent 平台: opencode __2. AI 模型: kimi-k3 __3. Prompt上下文 : 用户反馈 GEIR dynamic 模式下算子编译期 infershape 的 GetInputShape 拿到正值而非 -1/-2,通过阅读 graph_builder.py / geir_op_template.cpp.j2 及 GE 侧源码(shape_inference.cc、storage_shape.h、inputs_converter.cc)定位根因并实现修复,补充看护用例。 ### PR功能描述 / 为什么需要这个合入**: GEIR 模式开启动态 shape 测试(-d=true,含 -b release 的 dynamic_binary)时,TTK 生成的 per-case JSON config 中 desc_shape 已正确为 -1/-2,但 ori_shape 仍写入 input_ori_shapes/input_shapes 的正值。 经 GE 源码确认,算子 infershape 的 InferShapeContext::GetInputShape 返回的是 StorageShape 的 origin_shape_(第一个成员),编译期 GE 构造 context 时 origin_shape_ 取自 desc.GetOriginShape()——即 TTK 写入的正值。导致算子编译期 infershape 永远看到实际正值 shape,与真实动态图场景(编译期 origin shape 应为未知维度)不符,无法暴露算子不兼容动态 shape 的问题(如 GetDim(rank-1) != 3 校验本应在 -1 时失败,却因拿到正值"碰巧通过")。 修复: - graph_builder.py write_case_config():普通输入、普通输出、DYNAMIC_OUTPUT elements 三处的 ori_shape 在 dynamic 模式下对齐 desc_shape(-1/-2),const 模式保持原逻辑不变 - graph_builder.py DYNAMIC_INPUT(TensorList) 分支:desc_shape 按元素读取 dyn_input_shapes 列(支持 -1/-2)、缺省回退 -1,补齐 ori_shape 字段(修复该分支自 76234a3 引入起 desc_shape 恒为正值的不对称问题) - geir_op_template.cpp.j2 DYNAMIC_INPUT 分支补 SetOriginShape,与普通输入分支对齐 - 新增 tests/test_geir_ori_shape.py 11 个看护用例 ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: - 修复仅影响 dynamic/dynamic_binary 模式的 JSON config 生成,const/const_binary 行为逐字节不变 - 修复后,infershape 未兼容 -1 的算子(如校验 GetDim(rank-1)!=3 未排除 -1 的)将在编译期失败,属测试应暴露的真实问题,需算子侧适配 ## 测试 1. 新增 tests/test_geir_ori_shape.py 11 个用例,覆盖 const/dynamic/const_binary/dynamic_binary 四种模式及 DYNAMIC_INPUT(TensorList) 场景下 ori_shape 与 desc_shape 的生成行为,全部通过 2. 护卫有效性验证:7 个普通输入/输出用例中 4 个 dynamic 用例在修复前代码上失败;4 个 TensorList 用例在修复前代码上全部失败;修复后 11 个全过 3. 既有 geir 相关用例回归:test_geir_complex_dtype.py、test_precision_metrics_slots.py、test_dyn_nested.py 等共 49 个用例全部通过 4. 行为矩阵验证: | mode | desc_shape | ori_shape(修复后) | |------|-----------|---------------------| | const | [8,8,8] | [8,8,8](不变) | | dynamic | [-1,-1,-1] | [-1,-1,-1] | | dynamic + dyn_input_shapes=(-2,) | [-2] | [-2] | | const_binary | [8,8,8] | [8,8,8](不变) | | dynamic_binary | [-1,-1,-1] | [-1,-1,-1] | ## 文档更新 无文档更新。 ## 类型标签 <!-- [x] 表示选中 --> - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: <!-- 提交前请手动填写: 1. fixes # 后的 issue 号 2. AI 模型栏如规范要求其他名称请修改 --> See merge request: cann/ops-test-kit!148 | 2 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 个月前 | ||
| 2 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 2 个月前 |