| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat: add excel support Co-authored-by: wangrui<wangrui124@huawei.com> # message auto-generated for no-merge-commit merge: !185 merge br_aclnn into master feat: add excel support Created-by: wangrui_ Commit-by: wangrui Merged-by: cann-robot Description: ### 当前PR是否有AI参与: [ ] 否 [x] 是 1. AI Agent 平台: opencode 2. AI 模型: glm-5.2 3. Prompt上下文: TTK 4 通路 Excel 用例输入适配 ### PR功能描述 / 为什么需要这个合入**: 为 4 条测试通路(Kernel/GEIR/ACLNN/E2E)增加 Excel(.xlsx/.xlsm) 用例输入支持,与 CSV 等价、可互换。 - 新增表格读取层 ttk/utilities/table_reader.py(read_table/read_csv_rows/resolved_sheet),CSV 走标准库、XLSX 走 openpyxl,单元格统一 str+strip 对齐 CSV 行为。 - UniversalTestcaseFactory 新增 from_path(path, sheet),4 通路共用,模式自动识别与字段解析零改动。 - CLI 新增 --sheet(默认首个工作表,CSV 忽略);_detect_framework 改用 read_table 兼容 xlsx。 - InstanceBase 按后缀路由 xlsx(避免误入 zip);默认输出名嵌入实际 sheet 名(如 cases_T2_result.csv),多 sheet 互不覆盖;输出仍为 CSV。 - SWITCHES 新增 sheet 字段;新增 openpyxl>=3.1 依赖。 - 新增每通路多 sheet xlsx 示例及各 Case Writing / Test Guide / Task_Execution / Test_Case_Generation / AGENTS 文档说明。 - 顺手清理 instance_base / testcase_manager / testcase_aclnn / classes / utilities.__init__ 既有 ruff 告警(E722/B904/UP031/F841/F821/F401/F403/B007)。 ### 该PR关联的issue fixes #127 ### 希望检视人员了解: - xlsx 单元格一律按文本处理(None→""、str()+strip),与 CSV 一致;数值列建议在 Excel 中预设为文本格式,避免 01→1、1e-8→浮点等类型推断。 - 同一 xlsx 用 --sheet 跑不同 sheet,输出名各异、互不覆盖。 - dOut 从 ACLNN backward 排除名移除(代码 + 文档一致)。 ## 测试 - 4 通路 --validate 全过(kernel 4 / geir 2 / aclnn 2 / e2e 4 用例均 valid)。 - kernel 端到端 ttk kernel -i examples/case_store/kernel/add.xlsx --sheet T2:编译 SUCC、精度 PASS、4/4 PASS。 ## 文档更新 - docs/Task_Execution.md:通用参数表新增 --sheet,--input 说明改 csv/xlsx。 - docs/Test_Case_Generation.md:新增「输入文件格式(CSV / Excel)」小节。 - docs/Operator_Test_Guides/*_Test_Guide.md:各通路「常用场景示例」补 xlsx 多 sheet 命令。 - docs/Operator_Test_Guides/*_Case_Writing.md:各通路「参考用例」表补每个 csv 的验证特性与关键列。 - AGENTS.md / examples/case_store/README.md:xlsx 说明。 ## 类型标签 - [x] 新特性 - [ ] Bug修复 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他 See merge request: cann/ops-test-kit!185 | 12 天前 | |
feat: registry_accessor + error_manager_cleaner + cext_loader 公共能力 Co-authored-by: dengguojie<dengguojie@huawei.com> # message auto-generated for no-merge-commit merge: !6 merge master into master feat: registry_accessor + error_manager_cleaner + cext_loader 公共能力 Created-by: dengguojie Commit-by: dengguojie Merged-by: cann-robot Description: ## 描述 1. cext_loader: 提取 C 扩展在线编译+加载公共逻辑(per-target flock + atomic marker) 2. error_manager_cleaner: 清理 ErrorManager 残留错误,防止跨用例污染 tiling 判定 3. op_registry_accessor: split API(Find + Invoke gen_simplifiedkey),支持 simplifiedKeyMode=2 算子 4. platform: 兼容新旧 CANN 目录结构(vendors/ built-in/op_impl vs op_impl/built-in),fallback 无 config.ini 时走 custom 路径 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-test-kit!6 | 3 个月前 | |
feat: 新增 --clear-l0 选项,初始化 L0A/L0B/L0C Co-authored-by: guigui_jzh<jinzhonghao@huawei.com> # message auto-generated for no-merge-commit merge: !219 merge master into master feat: 新增 --clear-l0 选项,初始化 L0A/L0B/L0C Created-by: guigui_jzh Commit-by: guigui_jzh Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [] 否 [x] 是 __1. AI Agent 平台: opencode __2. AI 模型: glm5.3 __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: A5质量加固,模拟复杂网络情况,对L0进行注入 ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes #151 ### 希望检视人员了解: ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-test-kit!219 | 4 天前 | |
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 | 9 天前 | |
fix: uniform 大 tensor 分块生成降内存(复用 CHUNK_ELEMS=4M,与单次全量逐位相同) Co-authored-by: dengguojie<dengguojie@huawei.com> # message auto-generated for no-merge-commit merge: !213 merge 0903 into master fix: uniform 大 tensor 分块生成降内存(复用 CHUNK_ELEMS=4M,与单次全量逐位相同) Created-by: dengguojie Commit-by: dengguojie Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 是 __1. AI Agent 平台: OpenCode __2. AI 模型: GLM __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: fix: uniform 大 tensor 分块生成降内存(复用 CHUNK_ELEMS=4M,与单次全量逐位相同) numpy.random.uniform 单次全量生成恒产 float64 中间数组(8B/元素)+ astype 副本,大 shape 下峰值 ~12B/元素(fp32)。 改为分块直写预分配 typed 缓冲(复用 normal 的 CHUNK_ELEMS=4M): - 177M 元素 fp32 峰值:2032MB -> 747MB(约 12B/元素 -> 4.4B/元素) - e8m0 分支的同款单次全量 uniform 一并替换(data.py:81,修掉无 copy=False 的多余拷贝) - 输出与单次全量 uniform(...).astype(dtype) 逐位相同(uniform 逐元素消费 RandomState 流:low + (high-low)*next_double,每元素固定 2xuint32, 固定 seed 下完全可复现) - fp16/bf16 >10M 的 torch 快路径、_gen_exponential_data、float64 分支不受影响 - 测试覆盖:8 dtype 位等价(含非 4M 对齐尾块 1/CHUNK-1、整除 3xCHUNK、 多维 shape)、分块路径 spy 防退化、generate 入口 dtype 保持 ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-test-kit!213 | 5 天前 | |
fix(ttk): fix GEIR numpy import, add e8m0fnu dtype alias, and preload plugin modules Co-authored-by: wangqi_ai<wangqi195@hisilicon.com> # message auto-generated for no-merge-commit merge: !182 merge fix/geir-numpy-and-e8m0-dtype into master fix(ttk): fix GEIR numpy import, add e8m0fnu dtype alias, and preload plugin modules Created-by: wangqi_ai Commit-by: wangqi_ai Merged-by: cann-robot Description: ## 问题背景 本次修改解决四个独立问题: 1. **GEIR 模式 FP4 输出处理报错**: ttk/core_modules/geir/profiling.py 中使用 numpy.dtype("uint8"),但该文件导入的是 import numpy as np,直接引用 numpy 会导致 NameError: name 'numpy' is not defined,影响 GEIR 模式下 FP4 输出的处理。 2. **ACLNN 模式 mxscale 输出报错**:PyTorch 使用 float8_e8m0fnu 作为 E8M0 的 dtype 名称,但 TTK 的 DATA_TYPE_DICT 只包含 float8_e8m0,缺少 float8_e8m0fnu 映射。这会导致在 ACLNN 模式下为 mxscale 输出创建 aclTensor 时抛出 KeyError: 'float8_e8m0fnu'。 3. **插件懒加载导致校验误报**:golden.py 模块在导入时调用 FrameworkApiInfoKeeper().register() 声明 OpOverloadPacket API 的参数信息。若插件未预先加载,用例校验会在插件懒加载之前执行,导致 INPUT_COUNT_EXCEEDED 误报。 4. **CI 静态检查失败**:本 PR 触碰 dtypes.py 后,CI pre-commit 增量检查暴露了该文件预存的 ruff B904(except 内 raise 缺 from None)和 F841(未使用变量)违规,导致 /compile 触发的 CodeCheck 阶段失败。 ## 修改内容 **commit a4e7bd0** 1. **ttk/core_modules/geir/profiling.py**:将 numpy.dtype("uint8") 修正为 np.dtype("uint8"),与文件已有的 import numpy as np 保持一致。 2. **ttk/utilities/dtypes.py**:在 DATA_TYPE_DICT 中新增 "float8_e8m0fnu": 37,与 PyTorch 的 dtype 命名对齐。 3. **ttk/cli/bridge.py**:新增 _preload_plugin_modules() 函数(自 PR #173 迁移)。该函数在用例校验前导入 --plugin 目录下的所有 .py 模块,确保 golden.py 中声明的 API 参数信息在校验前已注册。 **commit c32f03a** 4. **ttk/utilities/dtypes.py** 修复 ruff 违规:10 处 except 内 raise 补 from None(B904);移除 4 处未使用变量(F841),包括 _mx_calculate_share_exp_nv 中的 FP32_EXPONENT_BIAS/FP32_MIN_NORMAL/ele_emax(copy-paste 残留死码,该函数用位操作算法不需要它们)以及 trans_np_fp4_e1m2_tensor_to_bfloat16/trans_np_fp4_e2m1_tensor_to_bfloat16 中的 out_tensor;并应用 pre-commit 安全修复(import 排序、无占位符 f-string 转普通字符串)。 **commit a774858** 5. **ttk/cli/bridge.py 与 ttk/core_modules/geir/profiling.py**:应用 pre-commit --fix 自动生成的安全风格修复,包括 import 排序、open() 冗余 "r" 参数移除、多行调用折叠,使本 PR 触碰的文件通过 CI 静态检查。 ## 验证情况 - GEIR 模式下 FP4 输出处理不再报 NameError,能正常完成 profiling。 - ACLNN 模式下 mxscale 输出能正确创建 aclTensor,不再抛出 KeyError。 - 启用 --plugin 的用例不再出现 INPUT_COUNT_EXCEEDED 误报,校验流程正常通过。 - pre-commit 全钩子通过(ruff-check/ruff-format/codespell 等)。 - ruff 全规则检查 3 文件(dtypes.py/bridge.py/profiling.py)0 错误,ruff format --check 全部已格式化。 - pytest tests/utilities/ tests/core_modules/comparison/ tests/core_modules/testcase_manager/test_normalize.py 共 227 个用例通过。 - LSP 诊断 dtypes.py 无 error;模块导入、DATA_TYPE_DICT['float8_e8m0fnu']==37、trans_np_fp4_* 与 _mx_calculate_share_exp_nv 运行正常。 ## 关联 - _preload_plugin_modules() 实现迁移自 PR #173。 See merge request: cann/ops-test-kit!182 | 13 天前 | |
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 | 9 天前 | |
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 | 9 天前 | |
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 | 9 天前 | |
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 | 9 天前 | |
feat: 新增 --clear-l0 选项,初始化 L0A/L0B/L0C Co-authored-by: guigui_jzh<jinzhonghao@huawei.com> # message auto-generated for no-merge-commit merge: !219 merge master into master feat: 新增 --clear-l0 选项,初始化 L0A/L0B/L0C Created-by: guigui_jzh Commit-by: guigui_jzh Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [] 否 [x] 是 __1. AI Agent 平台: opencode __2. AI 模型: glm5.3 __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: A5质量加固,模拟复杂网络情况,对L0进行注入 ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes #151 ### 希望检视人员了解: ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-test-kit!219 | 4 天前 | |
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 | 9 天前 | |
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 | 9 天前 | |
fix: support custom torch extension package Co-authored-by: wangrui<wangrui124@huawei.com> # message auto-generated for no-merge-commit merge: !193 merge br_bugfix into master fix: support custom torch extension package Created-by: wangrui_ Commit-by: wangrui Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 ### PR功能描述 / 为什么需要这个合入: 1. **torch_ops_package_loader 去硬编码,改约定探测**:删除 NAMESPACE_PACKAGES 映射表,从 torch.ops.<ns>.<op> 的 api_name 按约定取 ns(namespace == 包名)自动 import 扩展包。CANN site-packages 定向 find_spec + 全局兜底,builtin(aten/prim)自动跳过。新增 cann_ops_transformer/cann_ops_nn 等包无需改源码。 2. **删除 _preload_plugin_modules**:bridge.py 中 blanket exec 所有 --plugin/*.py 的预加载逻辑已删除。它唯一服务于 golden 文件顶层的 register() 调用,签名解析改由算子自带 schema(_schemas)自动获取后不再需要。 3. **删除 3 处 worker 冗余 ensure_registered**:input_generation.py、api_resolver.py、simple_param_extractor.py 中的 ensure_registered 调用已删除。父进程校验期(FrameworkApiInfoKeeper.get cache-miss)已 import,fork 的 worker 继承 sys.modules。 4. **issue #122 修复:extract_api_params 按对象判 schema,不按名字判**:去掉 startswith("torch.ops.") 前缀门控,由 hasattr(obj, "_schemas") 对象级短路。3 段 cann_ops_transformer.<op>(Python wrapper function)也能走 inspect.signature 解析 kw-only。_extract_params_from_aten_schemas 的 namespace 改从 schema.name 取(ns::op → ns),不再写死四段拆名。新增 _try_upgrade_to_inspect_if_kw_mismatch:docstring 解析 kw 全 False 但 inspect 有 KEYWORD_ONLY 时升级到 inspect。 5. **补充 validate_testcase_params 的 scalar 校验**:原代码读取 api_scalar_count 但未使用(F841),补上 scalar 数量比较。 6. **文档 + 示例用例**:E2E_Case_Writing.md / e2e-case.md / write-plugin SKILL.md 补充 torch.ops 自定义算子测试方法(4 段 api_name + 自动装包 + schema 签名)。examples/case_store/e2e/torch_ops.csv 合并 torch_add + torch_npu_conv2d + causal_conv1d 示例,配套 torch_ops_causal_conv1d_golden.py。 ### 该PR关联的issue fixes #122 ### 希望检视人员了解: - FrameworkApiInfoKeeper.register() 保留(可手动调),但 _preload_plugin_modules 已删除,golden 顶层 register() 不再自动 exec。 - 4 段 torch.ops.<ns>.<op> 推荐(走 _schemas 权威签名),3 段 cann_ops_transformer.<op> 也支持(走 inspect.signature)。 - ruff 全过,1305 测试通过。 ## 测试 - causal_conv1d_fn E2E 用例(4 段 + 3 段)均 PASS。 - 1305 passed, 20 skipped。 - ruff check 全过。 ## 文档更新 - docs/Operator_Test_Guides/E2E_Case_Writing.md:torch.ops 自定义算子测试方法 - .claude/skills/ttk-how-write-case/references/e2e-case.md:同步 - .claude/skills/ttk-how-write-plugin/SKILL.md:禁 register 规则 ## 类型标签 - [x] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-test-kit!193 | 11 天前 | |
TTK init repo | 3 个月前 | |
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 | 9 天前 | |
feat: add excel support Co-authored-by: wangrui<wangrui124@huawei.com> # message auto-generated for no-merge-commit merge: !185 merge br_aclnn into master feat: add excel support Created-by: wangrui_ Commit-by: wangrui Merged-by: cann-robot Description: ### 当前PR是否有AI参与: [ ] 否 [x] 是 1. AI Agent 平台: opencode 2. AI 模型: glm-5.2 3. Prompt上下文: TTK 4 通路 Excel 用例输入适配 ### PR功能描述 / 为什么需要这个合入**: 为 4 条测试通路(Kernel/GEIR/ACLNN/E2E)增加 Excel(.xlsx/.xlsm) 用例输入支持,与 CSV 等价、可互换。 - 新增表格读取层 ttk/utilities/table_reader.py(read_table/read_csv_rows/resolved_sheet),CSV 走标准库、XLSX 走 openpyxl,单元格统一 str+strip 对齐 CSV 行为。 - UniversalTestcaseFactory 新增 from_path(path, sheet),4 通路共用,模式自动识别与字段解析零改动。 - CLI 新增 --sheet(默认首个工作表,CSV 忽略);_detect_framework 改用 read_table 兼容 xlsx。 - InstanceBase 按后缀路由 xlsx(避免误入 zip);默认输出名嵌入实际 sheet 名(如 cases_T2_result.csv),多 sheet 互不覆盖;输出仍为 CSV。 - SWITCHES 新增 sheet 字段;新增 openpyxl>=3.1 依赖。 - 新增每通路多 sheet xlsx 示例及各 Case Writing / Test Guide / Task_Execution / Test_Case_Generation / AGENTS 文档说明。 - 顺手清理 instance_base / testcase_manager / testcase_aclnn / classes / utilities.__init__ 既有 ruff 告警(E722/B904/UP031/F841/F821/F401/F403/B007)。 ### 该PR关联的issue fixes #127 ### 希望检视人员了解: - xlsx 单元格一律按文本处理(None→""、str()+strip),与 CSV 一致;数值列建议在 Excel 中预设为文本格式,避免 01→1、1e-8→浮点等类型推断。 - 同一 xlsx 用 --sheet 跑不同 sheet,输出名各异、互不覆盖。 - dOut 从 ACLNN backward 排除名移除(代码 + 文档一致)。 ## 测试 - 4 通路 --validate 全过(kernel 4 / geir 2 / aclnn 2 / e2e 4 用例均 valid)。 - kernel 端到端 ttk kernel -i examples/case_store/kernel/add.xlsx --sheet T2:编译 SUCC、精度 PASS、4/4 PASS。 ## 文档更新 - docs/Task_Execution.md:通用参数表新增 --sheet,--input 说明改 csv/xlsx。 - docs/Test_Case_Generation.md:新增「输入文件格式(CSV / Excel)」小节。 - docs/Operator_Test_Guides/*_Test_Guide.md:各通路「常用场景示例」补 xlsx 多 sheet 命令。 - docs/Operator_Test_Guides/*_Case_Writing.md:各通路「参考用例」表补每个 csv 的验证特性与关键列。 - AGENTS.md / examples/case_store/README.md:xlsx 说明。 ## 类型标签 - [x] 新特性 - [ ] Bug修复 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他 See merge request: cann/ops-test-kit!185 | 12 天前 | |
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 | 9 天前 | |
fix: support custom torch extension package Co-authored-by: wangrui<wangrui124@huawei.com> # message auto-generated for no-merge-commit merge: !193 merge br_bugfix into master fix: support custom torch extension package Created-by: wangrui_ Commit-by: wangrui Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 ### PR功能描述 / 为什么需要这个合入: 1. **torch_ops_package_loader 去硬编码,改约定探测**:删除 NAMESPACE_PACKAGES 映射表,从 torch.ops.<ns>.<op> 的 api_name 按约定取 ns(namespace == 包名)自动 import 扩展包。CANN site-packages 定向 find_spec + 全局兜底,builtin(aten/prim)自动跳过。新增 cann_ops_transformer/cann_ops_nn 等包无需改源码。 2. **删除 _preload_plugin_modules**:bridge.py 中 blanket exec 所有 --plugin/*.py 的预加载逻辑已删除。它唯一服务于 golden 文件顶层的 register() 调用,签名解析改由算子自带 schema(_schemas)自动获取后不再需要。 3. **删除 3 处 worker 冗余 ensure_registered**:input_generation.py、api_resolver.py、simple_param_extractor.py 中的 ensure_registered 调用已删除。父进程校验期(FrameworkApiInfoKeeper.get cache-miss)已 import,fork 的 worker 继承 sys.modules。 4. **issue #122 修复:extract_api_params 按对象判 schema,不按名字判**:去掉 startswith("torch.ops.") 前缀门控,由 hasattr(obj, "_schemas") 对象级短路。3 段 cann_ops_transformer.<op>(Python wrapper function)也能走 inspect.signature 解析 kw-only。_extract_params_from_aten_schemas 的 namespace 改从 schema.name 取(ns::op → ns),不再写死四段拆名。新增 _try_upgrade_to_inspect_if_kw_mismatch:docstring 解析 kw 全 False 但 inspect 有 KEYWORD_ONLY 时升级到 inspect。 5. **补充 validate_testcase_params 的 scalar 校验**:原代码读取 api_scalar_count 但未使用(F841),补上 scalar 数量比较。 6. **文档 + 示例用例**:E2E_Case_Writing.md / e2e-case.md / write-plugin SKILL.md 补充 torch.ops 自定义算子测试方法(4 段 api_name + 自动装包 + schema 签名)。examples/case_store/e2e/torch_ops.csv 合并 torch_add + torch_npu_conv2d + causal_conv1d 示例,配套 torch_ops_causal_conv1d_golden.py。 ### 该PR关联的issue fixes #122 ### 希望检视人员了解: - FrameworkApiInfoKeeper.register() 保留(可手动调),但 _preload_plugin_modules 已删除,golden 顶层 register() 不再自动 exec。 - 4 段 torch.ops.<ns>.<op> 推荐(走 _schemas 权威签名),3 段 cann_ops_transformer.<op> 也支持(走 inspect.signature)。 - ruff 全过,1305 测试通过。 ## 测试 - causal_conv1d_fn E2E 用例(4 段 + 3 段)均 PASS。 - 1305 passed, 20 skipped。 - ruff check 全过。 ## 文档更新 - docs/Operator_Test_Guides/E2E_Case_Writing.md:torch.ops 自定义算子测试方法 - .claude/skills/ttk-how-write-case/references/e2e-case.md:同步 - .claude/skills/ttk-how-write-plugin/SKILL.md:禁 register 规则 ## 类型标签 - [x] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-test-kit!193 | 11 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 12 天前 | ||
| 3 个月前 | ||
| 4 天前 | ||
| 9 天前 | ||
| 5 天前 | ||
| 13 天前 | ||
| 9 天前 | ||
| 9 天前 | ||
| 9 天前 | ||
| 9 天前 | ||
| 4 天前 | ||
| 9 天前 | ||
| 9 天前 | ||
| 11 天前 | ||
| 3 个月前 | ||
| 9 天前 | ||
| 12 天前 | ||
| 9 天前 | ||
| 11 天前 |