可帮助用户基于PyTorch框架和torch_npu插件在昇腾NPU上使用图模式进行推理。继承自PyTorch Dynamo模式,能将PyTorch FX图转换为GE计算图,并提供GE计算图在昇腾NPU的编译与执行能力。【此简介由AI生成】
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
chore: 移除 superpowers skill 配置及 AGENTS.md 相关引用(#801) Co-authored-by: stevenaw0<huangguijun@huawei.com> # message auto-generated for no-merge-commit merge: !3724 merge chore/remove-superpowers-skill into master chore: 移除 superpowers skill 配置及 AGENTS.md 相关引用(#801) Created-by: stevenaw0 Commit-by: stevenaw0 Merged-by: ascend-robot Description: # Pull Request ## 描述 移除仓库中第三方 superpowers skill/插件的启用配置,并同步改写 AGENTS.md 中引用 superpowers 的段落。 具体变更: - .claude/settings.json:删除 enabledPlugins 中的 superpowers@claude-plugins-official 条目 - .opencode/opencode.json:删除 plugin 中的 superpowers@git+https://github.com/obra/superpowers.git 条目 - AGENTS.md:"设计文档输出规范"章节去掉 superpowers brainstorming skill 表述,改为通用表述(仍必须先读取 docs/zh/contributions/design_document_template.md 并按模板输出) 变更原因: 1. superpowers 插件需从 github.com 拉取,离线/内网环境下 opencode 启动会失败或长时间等待 2. 插件注入的 brainstorming 等流程与仓库自有设计文档规范冲突,AGENTS.md 需额外声明兜底规则 3. 第三方插件随仓库配置分发但未登记在开源软件清单中,存在合规风险 4. 仓库已有等价能力(设计文档模板 + 自建 skill),无需保留外部插件 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue https://gitcode.com/Ascend/torchair/issues/801 ## 如何测试 描述测试此变更的步骤和前提条件: 1. python3 -c "import json; json.load(open('.claude/settings.json')); json.load(open('.opencode/opencode.json'))",JSON 解析通过 2. grep -ri superpower .claude/settings.json .opencode/opencode.json AGENTS.md,无残留引用 3. git diff --name-only HEAD~1 | xargs pre-commit run --files,全部 Passed(gitleaks-offline-scan 因本地缺少 ./gitleaks 二进制无法执行,属环境限制;本变更为纯删除配置行与文档改写,未引入任何凭据) 4. 启动 AI 编码助手不再拉取 superpowers 插件,仓库自有 skill 与设计文档模板流程不受影响 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本次变更仅涉及 AI 编码助手配置文件与贡献者指引文档,不涉及任何运行时代码、构建脚本和测试用例。 设计文档输出规范保持不变:仍必须读取仓库设计文档模板并覆盖模板中的每个章节。 See merge request: Ascend/torchair!3724 | 19 天前 | |
ttfhw-解决关联issue Co-authored-by: guanlongfeng<guanlongfeng1@huawei.com> # message auto-generated for no-merge-commit merge: !3483 merge ttfhw_v2 into master ttfhw-解决关联issue Created-by: glf2016 Commit-by: guanlongfeng Merged-by: ascend-robot Description: Description: 网站:https://gitcode.com/TTFHVV/ttfhw-skills ttfhw-verify-baseos torchair 让大模型来搭建 环境,并执行ut、st验证 See merge request: Ascend/torchair!3483 | 2 个月前 | |
[CI] 新增 GitCode CI/CD 流水线:PR构建测试与覆盖率(master) Co-authored-by: w30057661<wangshusheng7@h-partners.com> # message auto-generated for no-merge-commit merge: !3692 merge master into master [CI] 新增 GitCode CI/CD 流水线:PR构建测试与覆盖率(master) Created-by: WSs_321 Commit-by: w30057661 Merged-by: ascend-robot Description: 关联 issue: #780 新增 .gitcode/workflows 下的 CI 流水线配置与覆盖率脚本: - PR 流水线:代码检查(pre-commit)、SCA、构建、UT,按变更文件门控 - 构建 job:编译并上传 wheel 产物 - ST job:系统测试 + 覆盖率报告生成脚本(scripts/coverage) See merge request: Ascend/torchair!3692 | 25 天前 | |
chore: 移除 superpowers skill 配置及 AGENTS.md 相关引用(#801) Co-authored-by: stevenaw0<huangguijun@huawei.com> # message auto-generated for no-merge-commit merge: !3724 merge chore/remove-superpowers-skill into master chore: 移除 superpowers skill 配置及 AGENTS.md 相关引用(#801) Created-by: stevenaw0 Commit-by: stevenaw0 Merged-by: ascend-robot Description: # Pull Request ## 描述 移除仓库中第三方 superpowers skill/插件的启用配置,并同步改写 AGENTS.md 中引用 superpowers 的段落。 具体变更: - .claude/settings.json:删除 enabledPlugins 中的 superpowers@claude-plugins-official 条目 - .opencode/opencode.json:删除 plugin 中的 superpowers@git+https://github.com/obra/superpowers.git 条目 - AGENTS.md:"设计文档输出规范"章节去掉 superpowers brainstorming skill 表述,改为通用表述(仍必须先读取 docs/zh/contributions/design_document_template.md 并按模板输出) 变更原因: 1. superpowers 插件需从 github.com 拉取,离线/内网环境下 opencode 启动会失败或长时间等待 2. 插件注入的 brainstorming 等流程与仓库自有设计文档规范冲突,AGENTS.md 需额外声明兜底规则 3. 第三方插件随仓库配置分发但未登记在开源软件清单中,存在合规风险 4. 仓库已有等价能力(设计文档模板 + 自建 skill),无需保留外部插件 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue https://gitcode.com/Ascend/torchair/issues/801 ## 如何测试 描述测试此变更的步骤和前提条件: 1. python3 -c "import json; json.load(open('.claude/settings.json')); json.load(open('.opencode/opencode.json'))",JSON 解析通过 2. grep -ri superpower .claude/settings.json .opencode/opencode.json AGENTS.md,无残留引用 3. git diff --name-only HEAD~1 | xargs pre-commit run --files,全部 Passed(gitleaks-offline-scan 因本地缺少 ./gitleaks 二进制无法执行,属环境限制;本变更为纯删除配置行与文档改写,未引入任何凭据) 4. 启动 AI 编码助手不再拉取 superpowers 插件,仓库自有 skill 与设计文档模板流程不受影响 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本次变更仅涉及 AI 编码助手配置文件与贡献者指引文档,不涉及任何运行时代码、构建脚本和测试用例。 设计文档输出规范保持不变:仍必须读取仓库设计文档模板并覆盖模板中的每个章节。 See merge request: Ascend/torchair!3724 | 19 天前 | |
[Bugfix] support CANN version with beta string Co-authored-by: ganon0327<zhoujialong4@huawei.com> # message auto-generated for no-merge-commit merge: !3493 merge cann_version into master [Bugfix] support CANN version with beta string Created-by: ganon0327 Commit-by: ganon0327 Merged-by: ascend-robot Description: Bugfix: support CANN version with beta string like 9.2.0.beta1 See merge request: Ascend/torchair!3493 | 2 个月前 | |
pre-commit by rule=trailing-whitespace Co-authored-by: guanlongfeng<guanlongfeng1@huawei.com> # message auto-generated for no-merge-commit merge: !2931 merge clean_code into master pre-commit by rule=trailing-whitespace Created-by: glf2016 Commit-by: guanlongfeng Merged-by: ascend-robot Description: pre-commit-clean-code-rule=trailing-whitespace See merge request: Ascend/torchair!2931 | 5 个月前 | |
ttfhw-解决关联issue Co-authored-by: guanlongfeng<guanlongfeng1@huawei.com> # message auto-generated for no-merge-commit merge: !3483 merge ttfhw_v2 into master ttfhw-解决关联issue Created-by: glf2016 Commit-by: guanlongfeng Merged-by: ascend-robot Description: Description: 网站:https://gitcode.com/TTFHVV/ttfhw-skills ttfhw-verify-baseos torchair 让大模型来搭建 环境,并执行ut、st验证 See merge request: Ascend/torchair!3483 | 2 个月前 | |
docs:增加自定义算子领交付件入图特性文档 Co-authored-by: Chang-an-HW<machangan@huawei.com> # message auto-generated for no-merge-commit merge: !3712 merge docs_custom_op_feat into master docs:增加自定义算子领交付件入图特性文档 Created-by: Chang-an-HW Commit-by: Chang-an-HW Merged-by: ascend-robot Description: 增加自定义算子领交付件入图特性文档 See merge request: Ascend/torchair!3712 | 17 天前 | |
fix: correct mixed Chinese/English punctuation in documentation Co-authored-by: tmj1128<tanmengjie2@huawei.com> # message auto-generated for no-merge-commit merge: !3570 merge fix/master-punctuation-mixed into master fix: correct mixed Chinese/English punctuation in documentation Created-by: tmj1128 Commit-by: tmj1128 Merged-by: ascend-robot Description: ## 问题描述 文档中存在中英文标点符号混用问题。 ## 修改内容 ### 1. examples/_kernel_extension_aclgraph/torch_library/README.md - 英文逗号 , -> 中文顿号 、(2 处,用于中文语境下的枚举) - 英文逗号 , -> 中文逗号 ,(1 处,用于中文句子中的分隔) ### 2. npugraph_ex/design_principles.md - 英文逗号 , -> 中文逗号 ,(2 处,用于代码引用与中文文档之间的分隔) ## 修改统计 - 修改文件数:2 - 涉及提交数:1 See merge request: Ascend/torchair!3570 | 1 个月前 | |
docs(inductor_npu_ext): note TOPN autotune requires static shape | 17 天前 | |
(master)torch npu is renamed to TorchNPU Co-authored-by: lyz0328<liyanzhen@huawei.com> # message auto-generated for no-merge-commit merge: !3359 merge master into master (master)torch npu is renamed to TorchNPU Created-by: lyz0328 Commit-by: lyz0328 Merged-by: ascend-robot Description: (master)torch npu is renamed to TorchNPU See merge request: Ascend/torchair!3359 | 2 个月前 | |
fix: avoid double execution in static kernel compilation Co-authored-by: rich9527<zhouruiqi5@huawei.com> # message auto-generated for no-merge-commit merge: !3722 merge static into master fix: avoid double execution in static kernel compilation Created-by: rich9527 Commit-by: rich9527 Merged-by: ascend-robot Description: 使用静态编译功能时,会执行一遍单算子用来dump算子json文件,此次修改将静态编译中的单算子调用结果作为第一个step的输出返回,避免在原地算子等场景二次执行产生副作用 See merge request: Ascend/torchair!3722 | 19 天前 | |
放开pylint规则,并修复现存的pylint问题 Co-authored-by: 冯振强<fengzhenqiang@huawei.com> # message auto-generated for no-merge-commit merge: !3417 merge pre_commit_test into master 放开pylint规则,并修复现存的pylint问题 Created-by: feng_zhenqiang Commit-by: 冯振强 Merged-by: ascend-robot Description: | 工具 | 错误码 | 问题描述 | 处理数量 | 处理方式 | 验证结果 | | --- | --- | --- | ---: | --- | --- | | Pylint | C0412 | 导入未按包分组。 | 9 | 回退 import 分组调整,在触发的 import 代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | C0412 局部屏蔽后定向验证通过,退出码 0 | | Pylint | C2801 | 直接调用双下划线方法。 | 2 | 在对应 __setattr__ 调用代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | C2801 局部屏蔽后定向验证通过,退出码 0 | | Pylint | E0402 | 相对导入层级越过包顶层。 | 18 | 尽量替换为绝对导入,保留函数内延迟导入语义;未新增屏蔽配置 | E0402 定向验证通过,退出码 0 | | Pylint | E0710 | raise 的对象不是异常。 | 1 | 按要求将 raise out 改为 return out,保持 converter 返回语义 | E0710 定向验证通过,退出码 0 | | Pylint | R0402 | 可将模块导入改成显式成员导入。 | 6 | 将对应导入改为 from module import name 形式;setup 文件保留 C0412 局部屏蔽 | R0402 定向验证通过,退出码 0;setup 文件 C0412 复查通过 | | Pylint | R1711 | 函数末尾存在无实际作用的 return。 | 105 | 删除函数末尾无效 return / return None,必要处改为 pass | --enable=R1711 全量验证通过 | | Pylint | W0102 | 函数参数使用可变默认值。 | 2117 | 在 1842 个唯一触发代码行添加行级 dangerous-default-value 屏蔽;未在配置或文件顶部全局屏蔽 | 15 个普通文件 Pylint 验证通过,自动生成文件静态校验通过 | | Pylint | W0401 | 使用星号导入,导入名称集合无法被静态明确。 | 936 | 在 942 处星号导入代码行添加行级 wildcard-import,unused-wildcard-import 屏蔽;未在配置中全局屏蔽 | 代表性文件 Pylint 验证通过,937 个文件、942 处 import * 行静态校验通过 | | Pylint | W0404 | 同一名称被重复导入。 | 4 | 在对应 import 代码处添加 reimported 局部屏蔽,保留导入语义 | W0404 定向验证通过,退出码 0 | | Pylint | W0406 | 模块导入了自身。 | 4 | 对包初始化入口的副作用导入添加行级 import-self 屏蔽,保留初始化语义 | W0406 定向验证通过,退出码 0 | | Pylint | W0614 | 星号导入带来了未被使用的名称。 | 936 | 在 942 处星号导入代码行添加行级 wildcard-import,unused-wildcard-import 屏蔽;未在配置中全局屏蔽 | 代表性文件 Pylint 验证通过,937 个文件、942 处 import * 行静态校验通过 | | Pylint | W1203 | 日志使用了 f-string。 | 279 | 在对应日志调用代码处添加 # pylint: disable=logging-fstring-interpolation,保留原 f-string 日志写法 | pylint --disable=all --enable=W1203 定向验证通过 | | Pylint | W1201 | 日志在调用前就完成了字符串求值。 | 1 | 在对应 logger.info 调用处添加 # pylint: disable=logging-not-lazy,保留原日志拼接写法 | pylint --disable=all --enable=W1201 定向验证通过 | | Pylint | W1401 | 字符串中包含异常反斜杠转义。 | 15 | 将 ASCII 图中的反斜杠改为 \,保留示意图语义 | pylint --disable=all --enable=W1401 定向验证通过(3 个文件) | | Pylint | W2301 | 省略号占位写法没有必要。 | 4 | 在抽象方法中改为 pass,保留抽象接口语义 | pylint --disable=all --enable=W2301,W3301 定向验证通过 | | Pylint | W3301 | 嵌套 min 可简化。 | 1 | 将嵌套 min 改为单层 min(...) 写法,保持边界截断语义 | pylint --disable=all --enable=W2301,W3301 定向验证通过 | | Pylint | W0105 | 出现独立字符串语句。 | 28 | 在对应代码处将独立字符串改为注释,保留原说明内容 | pylint --disable=all --enable=W0105 定向验证通过(24 个文件) | | Pylint | E0611 | 动态扩展、编译产物或运行时模块成员无法被静态导入分析识别。 | 15 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | E1101 | 动态属性或运行时注入成员无法被 Pylint 静态识别。 | 3 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | E1102 | 动态可调用对象被 Pylint 判断为不可调用。 | 4 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | E1121 | 动态接口调用参数数量与 Pylint 推断签名不一致。 | 7 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | E1123 | 动态接口调用使用了 Pylint 推断签名未声明的关键字参数。 | 1 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | E1125 | 动态接口调用缺少 Pylint 推断签名要求的关键字参数。 | 5 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | R0401 | 模块之间存在循环导入关系。 | 12 | 在对应文件顶部添加 pylint 文件级屏蔽;诊断落在模块入口,放在 shebang 后顶部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | R0801 | 多个文件存在重复代码片段。 | 516 | 在对应代码处添加 pylint 局部屏蔽;诊断落在模块入口,放在 shebang 后顶部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | W0236 | 子类覆盖父类成员时方法和属性形态不一致。 | 6 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | W1116 | isinstance() 第二个参数由动态对象提供,Pylint 无法确认其为类型。 | 2 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | W4901 | 使用了 Pylint 标记为废弃的模块。 | 4 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | E0102 | 同名函数或方法重复定义。 | 13 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | E0203 | 成员在定义前被访问。 | 2 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | E0602 | 引用了未定义变量或名称。 | 6 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | E0606 | 变量可能在赋值前被使用。 | 9 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R0124 | 条件在和自身比较。 | 1 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R0205 | 继承 object 没有实际意义。 | 3 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R0916 | 布尔条件过于复杂。 | 7 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R1701 | 多个 isinstance 可合并。 | 4 | 使用元组合并类型判断,保持原判断语义 | R1701 定向验证通过,退出码 0 | | Pylint | R1702 | 嵌套层级过深。 | 8 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R1704 | 局部变量重用了参数名。 | 7 | 在对应代码处添加 pylint 局部屏蔽;自动生成文件按当前源码 AST 定位;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R1710 | 不同分支返回值不一致。 | 14 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R1714 | 等值判断链可改成成员判断。 | 87 | 在 85 条当前诊断对应代码处添加 pylint 局部屏蔽;2 条旧基线诊断对应文件已不存在;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R1716 | 多个比较可合并为链式比较。 | 3 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R1719 | if 表达式可以进一步简化。 | 10 | 将布尔三元表达式改为直接条件判断或 not 表达式 | R1719 定向验证通过,退出码 0 | | Pylint | R1721 | 推导式外层包装多余。 | 36 | 将不必要的推导式改为 list(...)、range(...) 或 dict(...) 标准构造 | R1721 定向验证通过,退出码 0 | | Pylint | R1724 | continue 后存在冗余 else。 | 1 | 删除 continue 后的 else 并顺延后续分支 | R1724/R1728/R1729/R1730/R1733/R1736 定向验证通过,退出码 0 | | Pylint | R1728 | 可用生成器替代临时列表。 | 3 | 将 max([...])、tuple([...]) 改为生成器表达式 | R1724/R1728/R1729/R1730/R1733/R1736 定向验证通过,退出码 0 | | Pylint | R1729 | all() 中不需要构造临时列表。 | 21 | 去掉 all([...]) 外层列表,改为生成器表达式 | R1724/R1728/R1729/R1730/R1733/R1736 定向验证通过,退出码 0 | | Pylint | R1730 | 手写条件可用 min() 表达。 | 1 | 将条件赋值改为 axis = min(axis, -1) | R1724/R1728/R1729/R1730/R1733/R1736 定向验证通过,退出码 0 | | Pylint | R1733 | 遍历字典时又通过 key 取值。 | 8 | 改为直接遍历字典 values 并使用当前 value | R1724/R1728/R1729/R1730/R1733/R1736 定向验证通过,退出码 0 | | Pylint | R1736 | 遍历列表时又通过 index 取当前列表元素。 | 4 | 使用 enumerate 得到的元素替代同列表索引访问 | R1724/R1728/R1729/R1730/R1733/R1736 定向验证通过,退出码 0 | | Pylint | R1725 | super() 还在使用显式参数形式。 | 28 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0106 | 表达式求值后没有被使用。 | 2 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0108 | lambda 可以直接用普通函数替代。 | 2 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0122 | 使用了 exec。 | 6 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0123 | 使用了 eval。 | 7 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0127 | 变量被自赋值。 | 1 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0133 | 单独写了异常对象但没有抛出。 | 1 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0201 | 属性在 __init__ 之外定义。 | 2 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0211 | @staticmethod 仍接收实例或类参数。 | 1 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0221 | 重写方法参数与父类不一致。 | 1 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0231 | 子类初始化未调用父类 __init__。 | 2 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0246 | 重写方法只是原样委托给父类。 | 2 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0511 | 代码中保留了 FIXME/TODO 标记。 | 1 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0602 | 使用了 global,但未形成有效全局赋值。 | 8 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0621 | 局部名称遮蔽了外层作用域变量。 | 20 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0622 | 覆盖了 Python 内置名称。 | 259 | 在对应代码处添加 pylint 局部屏蔽;自动生成文件按当前源码 AST 定位;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0631 | 循环变量在循环外被引用。 | 1 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0632 | 解包数量与数据结构不匹配。 | 9 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0640 | 闭包捕获了循环变量。 | 5 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W1508 | 环境变量默认值类型不合适。 | 3 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | See merge request: Ascend/torchair!3417 | 2 个月前 | |
support hif8 for graph Co-authored-by: huangfei<huangfei32@huawei.com> # message auto-generated for no-merge-commit merge: !2145 merge master into master [Feature] [Feature] support hif8 for graph Created-by: dddxhh Commit-by: huangfei Merged-by: ascend-robot Description: <!-- 请根据您的Pull Request类型,保留以下相应的一个模板部分,并删除其他无关部分 --> <!-- 请根据您的Pull Request类型,在Pull request标题中标记[Feature]\[Bugfix]\[Refactor] --> <!-------------------- 新功能模板 BEGIN --------------------> ### **【新功能提交】** **功能描述** support hif8 for graph **相关Issue** <!-- 如有关联的Issue,请在此处填写,例如: [Fixes issue xxx](链接) --> **Checklist** - [x] 符合编程规范&&代码红线 - [x] 具备UT测试用例看护&&测试用例为有效用例(若无测试用例看护请说明原因) - [ ] 是否涉及对外接口变更 - [ ] 是否涉及官网文档修改 <!-------------------- 新功能模板 END --------------------> See merge request: Ascend/torchair!2145 | 10 个月前 | |
支持 Ascend350 的 arch35 平台判断及量化 matmul converter Co-authored-by: guiruoyu<guiruoyu@h-partners.com> # message auto-generated for no-merge-commit merge: !3703 merge codex/quant-matmul-ascend350 into master 支持 Ascend350 的 arch35 平台判断及量化 matmul converter Created-by: guiruoyu Commit-by: guiruoyu Merged-by: ascend-robot Description: 现有 is_arch35() 仅识别 Ascend910_95/Ascend950,导致 Ascend350 无法进入对应的平台分支。 在公共 is_arch35() 中加入设备名称包含 Ascend350 的判断,兼容 Ascend350_355e 等名称。所有现有 is_arch35() 调用方统一识别 Ascend350;quantmatmul 使用现有 arch35 分支进入 QuantBatchMatmulV4,quant_matmul_inplace_add 的原地和非原地接口使用同一判断。同步更新这两个 converter 的错误提示,列明 Ascend350 支持。 验证:3 个文件 Python 语法编译及 git diff --check 通过。本地 stub GE/Torch 测试执行生产 converter 函数体,4 项测试通过,覆盖 9 种设备名称的 int8/FP8 路由和两个 add 接口(36 组组合)、旧平台拒绝逻辑、TensorMove/原地输出语义、group_size 传递、缺少 torch_npu 的回退,以及 Ascend350 的公共 is_arch35() 判断。 未执行完整 TorchAir ST 或 Ascend350 真机验证;本地测试仅验证 Python 平台分支和调用参数,其他公共判断调用方未执行全量回归。 关联 Issue:#816 https://gitcode.com/Ascend/torchair/issues/816 See merge request: Ascend/torchair!3703 | 17 天前 | |
增强可选输入处理,确保None值正确映射为缺失输入,添加dtype值归一化逻辑 Co-authored-by: Chang-an-HW<machangan@huawei.com> # message auto-generated for no-merge-commit merge: !3718 merge fix_torch_dtype_converter into master 增强可选输入处理,确保None值正确映射为缺失输入,添加dtype值归一化逻辑 Created-by: Chang-an-HW Commit-by: Chang-an-HW Merged-by: ascend-robot Description: 增强可选输入处理,确保None值正确映射为缺失输入,添加dtype值归一化逻辑 See merge request: Ascend/torchair!3718 | 19 天前 | |
delete quant_all_reduce & quant_reduce_scatter Co-authored-by: yifux<xiongyifu1@huawei.com> # message auto-generated for no-merge-commit merge: !3377 merge pr_del into master delete quant_all_reduce & quant_reduce_scatter Created-by: xiongyifu Commit-by: yifux Merged-by: ascend-robot Description: delete quant_all_reduce & quant_reduce_scatter See merge request: Ascend/torchair!3377 | 2 个月前 | |
[feature]npugraph_ex support dead lock check Co-authored-by: chenweiheng<chenweiheng1@hisilicon.com> # message auto-generated for no-merge-commit merge: !2782 merge master into master [feature]npugraph_ex support dead lock check Created-by: chenweiheng Commit-by: chenweiheng Merged-by: ascend-robot Description: [feature]npugraph_ex support dead lock check See merge request: Ascend/torchair!2782 | 6 个月前 | |
[fix] skip external graph memory bases for autofuse Co-authored-by: ChengLyric<licheng236@huawei.com> # message auto-generated for no-merge-commit merge: !3671 merge fix/autofuse-skip-external-memory-base into master [fix] skip external graph memory bases for autofuse Created-by: LyriCheng Commit-by: ChengLyric Merged-by: ascend-robot Description: [fix] skip external graph memory bases for autofuse See merge request: Ascend/torchair!3671 | 28 天前 | |
pre-commit by rule=trailing-whitespace Co-authored-by: guanlongfeng<guanlongfeng1@huawei.com> # message auto-generated for no-merge-commit merge: !2931 merge clean_code into master pre-commit by rule=trailing-whitespace Created-by: glf2016 Commit-by: guanlongfeng Merged-by: ascend-robot Description: pre-commit-clean-code-rule=trailing-whitespace See merge request: Ascend/torchair!2931 | 5 个月前 | |
fix: 同一输出被多路view场景下transpose拆分单独kernel报错 Co-authored-by: fu-hao-huawei<fuhao16@huawei.com> # message auto-generated for no-merge-commit merge: !3521 merge load_trans_view into master fix: 同一输出被多路view场景下transpose拆分单独kernel报错 Created-by: fu-hao-huawei Commit-by: fu-hao-huawei Merged-by: ascend-robot Description: ## PR 描述 修复 load-transpose 拆分在「同一物理 buffer 被多路不同 view 读取」场景下的保护性报错。此前当同一输入 buffer 被以不同转置视图多次 load 时, _load_contiguous 会直接抛 load-transpose split unsupported: ... different view,导致模型编译失败。 ## 主要改动 ### inductor_npu_ext/npu.py 1. **按 view 分配独立 transpose slot** - 新增 _assign_transpose_slot():为每个不同 view 各分一个独立 slot(首个 view 沿用物理名,额外 view 用合成名 name__lt{k} 并注册轻量 buffer);同一 view 二次 load 复用同一 slot / 转置 kernel。 - 新增 _loader_slots_by_name、_registered_slot_buffers、_raw_slots、_name_used_raw 等字段管理 slot 生命周期。 2. **转置 view + 连续 view 混读支持** - 物理槽已被转置占用时,连续读(road 为空)单独开一个「原始 slot」直传物理 buffer(不经转置 kernel),从而转置 view 与连续 view 可同时读同一物理 buffer。 - 连续读先占物理槽时,后续转置 view 改走合成 slot,避免转置结果覆盖原始数据(顺序耦合)。 3. **codegen 适配** - _emit_fused_layout_checks:跳过合成 slot 的布局检查(调用点名字不是真实变量)。 - _rewrite_call_args:合成 slot 的 call_arg 改写为物理 buffer 名(转置 slot → transpose(physical, syms...);原始 slot → 直接传物理名)。 - NPUScheduling._get_transpose_map:mapping key 用 slot 调用点名,value 记物理名;原始 slot 以 tname=None 标识。 ### tests/smoke/load_transpose_test.py - 原 test_c3_same_buffer_twice_guard(断言报错)替换为 test_c3_same_buffer_two_slice_views(2D 最小多 view,数值对齐)。 - 新增 test_c4_transpose_buffer_multi_view_rope:RoPE/concat 模式 4D 多 view 场景,断言编译通过 + 数值对齐 + >=2 处转置调用点。 - 新增 test_c5_transpose_and_contiguous_mixed:转置 + 连续混读数值正确性保证。 ## Checklist - [x] 代码已自测 - [x] 新增 / 更新冒烟用例覆盖多 view、RoPE 多 view、转置+连续混读场景 - [x] 同一 view 二次 load 复用同一 slot(无多余转置 kernel) - [x] 向后兼容:单 view 场景与现状逐字节一致 See merge request: Ascend/torchair!3521 | 2 个月前 | |
update submodiles Co-authored-by: guanlongfeng<guanlongfeng1@huawei.com> # message auto-generated for no-merge-commit merge: !3375 merge update_submodel_url into master update submodiles Created-by: glf2016 Commit-by: guanlongfeng Merged-by: ascend-robot Description: 社区要求三方库链接切换使用问题的gitcode网站 See merge request: Ascend/torchair!3375 | 2 个月前 | |
放开pylint规则,并修复现存的pylint问题 Co-authored-by: 冯振强<fengzhenqiang@huawei.com> # message auto-generated for no-merge-commit merge: !3417 merge pre_commit_test into master 放开pylint规则,并修复现存的pylint问题 Created-by: feng_zhenqiang Commit-by: 冯振强 Merged-by: ascend-robot Description: | 工具 | 错误码 | 问题描述 | 处理数量 | 处理方式 | 验证结果 | | --- | --- | --- | ---: | --- | --- | | Pylint | C0412 | 导入未按包分组。 | 9 | 回退 import 分组调整,在触发的 import 代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | C0412 局部屏蔽后定向验证通过,退出码 0 | | Pylint | C2801 | 直接调用双下划线方法。 | 2 | 在对应 __setattr__ 调用代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | C2801 局部屏蔽后定向验证通过,退出码 0 | | Pylint | E0402 | 相对导入层级越过包顶层。 | 18 | 尽量替换为绝对导入,保留函数内延迟导入语义;未新增屏蔽配置 | E0402 定向验证通过,退出码 0 | | Pylint | E0710 | raise 的对象不是异常。 | 1 | 按要求将 raise out 改为 return out,保持 converter 返回语义 | E0710 定向验证通过,退出码 0 | | Pylint | R0402 | 可将模块导入改成显式成员导入。 | 6 | 将对应导入改为 from module import name 形式;setup 文件保留 C0412 局部屏蔽 | R0402 定向验证通过,退出码 0;setup 文件 C0412 复查通过 | | Pylint | R1711 | 函数末尾存在无实际作用的 return。 | 105 | 删除函数末尾无效 return / return None,必要处改为 pass | --enable=R1711 全量验证通过 | | Pylint | W0102 | 函数参数使用可变默认值。 | 2117 | 在 1842 个唯一触发代码行添加行级 dangerous-default-value 屏蔽;未在配置或文件顶部全局屏蔽 | 15 个普通文件 Pylint 验证通过,自动生成文件静态校验通过 | | Pylint | W0401 | 使用星号导入,导入名称集合无法被静态明确。 | 936 | 在 942 处星号导入代码行添加行级 wildcard-import,unused-wildcard-import 屏蔽;未在配置中全局屏蔽 | 代表性文件 Pylint 验证通过,937 个文件、942 处 import * 行静态校验通过 | | Pylint | W0404 | 同一名称被重复导入。 | 4 | 在对应 import 代码处添加 reimported 局部屏蔽,保留导入语义 | W0404 定向验证通过,退出码 0 | | Pylint | W0406 | 模块导入了自身。 | 4 | 对包初始化入口的副作用导入添加行级 import-self 屏蔽,保留初始化语义 | W0406 定向验证通过,退出码 0 | | Pylint | W0614 | 星号导入带来了未被使用的名称。 | 936 | 在 942 处星号导入代码行添加行级 wildcard-import,unused-wildcard-import 屏蔽;未在配置中全局屏蔽 | 代表性文件 Pylint 验证通过,937 个文件、942 处 import * 行静态校验通过 | | Pylint | W1203 | 日志使用了 f-string。 | 279 | 在对应日志调用代码处添加 # pylint: disable=logging-fstring-interpolation,保留原 f-string 日志写法 | pylint --disable=all --enable=W1203 定向验证通过 | | Pylint | W1201 | 日志在调用前就完成了字符串求值。 | 1 | 在对应 logger.info 调用处添加 # pylint: disable=logging-not-lazy,保留原日志拼接写法 | pylint --disable=all --enable=W1201 定向验证通过 | | Pylint | W1401 | 字符串中包含异常反斜杠转义。 | 15 | 将 ASCII 图中的反斜杠改为 \,保留示意图语义 | pylint --disable=all --enable=W1401 定向验证通过(3 个文件) | | Pylint | W2301 | 省略号占位写法没有必要。 | 4 | 在抽象方法中改为 pass,保留抽象接口语义 | pylint --disable=all --enable=W2301,W3301 定向验证通过 | | Pylint | W3301 | 嵌套 min 可简化。 | 1 | 将嵌套 min 改为单层 min(...) 写法,保持边界截断语义 | pylint --disable=all --enable=W2301,W3301 定向验证通过 | | Pylint | W0105 | 出现独立字符串语句。 | 28 | 在对应代码处将独立字符串改为注释,保留原说明内容 | pylint --disable=all --enable=W0105 定向验证通过(24 个文件) | | Pylint | E0611 | 动态扩展、编译产物或运行时模块成员无法被静态导入分析识别。 | 15 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | E1101 | 动态属性或运行时注入成员无法被 Pylint 静态识别。 | 3 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | E1102 | 动态可调用对象被 Pylint 判断为不可调用。 | 4 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | E1121 | 动态接口调用参数数量与 Pylint 推断签名不一致。 | 7 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | E1123 | 动态接口调用使用了 Pylint 推断签名未声明的关键字参数。 | 1 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | E1125 | 动态接口调用缺少 Pylint 推断签名要求的关键字参数。 | 5 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | R0401 | 模块之间存在循环导入关系。 | 12 | 在对应文件顶部添加 pylint 文件级屏蔽;诊断落在模块入口,放在 shebang 后顶部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | R0801 | 多个文件存在重复代码片段。 | 516 | 在对应代码处添加 pylint 局部屏蔽;诊断落在模块入口,放在 shebang 后顶部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | W0236 | 子类覆盖父类成员时方法和属性形态不一致。 | 6 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | W1116 | isinstance() 第二个参数由动态对象提供,Pylint 无法确认其为类型。 | 2 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | W4901 | 使用了 Pylint 标记为废弃的模块。 | 4 | 在对应代码处添加 pylint 局部屏蔽;本次未新增全局屏蔽配置 | 20 个涉及文件定向验证通过,51 个屏蔽位置静态校验通过 | | Pylint | E0102 | 同名函数或方法重复定义。 | 13 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | E0203 | 成员在定义前被访问。 | 2 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | E0602 | 引用了未定义变量或名称。 | 6 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | E0606 | 变量可能在赋值前被使用。 | 9 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R0124 | 条件在和自身比较。 | 1 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R0205 | 继承 object 没有实际意义。 | 3 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R0916 | 布尔条件过于复杂。 | 7 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R1701 | 多个 isinstance 可合并。 | 4 | 使用元组合并类型判断,保持原判断语义 | R1701 定向验证通过,退出码 0 | | Pylint | R1702 | 嵌套层级过深。 | 8 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R1704 | 局部变量重用了参数名。 | 7 | 在对应代码处添加 pylint 局部屏蔽;自动生成文件按当前源码 AST 定位;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R1710 | 不同分支返回值不一致。 | 14 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R1714 | 等值判断链可改成成员判断。 | 87 | 在 85 条当前诊断对应代码处添加 pylint 局部屏蔽;2 条旧基线诊断对应文件已不存在;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R1716 | 多个比较可合并为链式比较。 | 3 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | R1719 | if 表达式可以进一步简化。 | 10 | 将布尔三元表达式改为直接条件判断或 not 表达式 | R1719 定向验证通过,退出码 0 | | Pylint | R1721 | 推导式外层包装多余。 | 36 | 将不必要的推导式改为 list(...)、range(...) 或 dict(...) 标准构造 | R1721 定向验证通过,退出码 0 | | Pylint | R1724 | continue 后存在冗余 else。 | 1 | 删除 continue 后的 else 并顺延后续分支 | R1724/R1728/R1729/R1730/R1733/R1736 定向验证通过,退出码 0 | | Pylint | R1728 | 可用生成器替代临时列表。 | 3 | 将 max([...])、tuple([...]) 改为生成器表达式 | R1724/R1728/R1729/R1730/R1733/R1736 定向验证通过,退出码 0 | | Pylint | R1729 | all() 中不需要构造临时列表。 | 21 | 去掉 all([...]) 外层列表,改为生成器表达式 | R1724/R1728/R1729/R1730/R1733/R1736 定向验证通过,退出码 0 | | Pylint | R1730 | 手写条件可用 min() 表达。 | 1 | 将条件赋值改为 axis = min(axis, -1) | R1724/R1728/R1729/R1730/R1733/R1736 定向验证通过,退出码 0 | | Pylint | R1733 | 遍历字典时又通过 key 取值。 | 8 | 改为直接遍历字典 values 并使用当前 value | R1724/R1728/R1729/R1730/R1733/R1736 定向验证通过,退出码 0 | | Pylint | R1736 | 遍历列表时又通过 index 取当前列表元素。 | 4 | 使用 enumerate 得到的元素替代同列表索引访问 | R1724/R1728/R1729/R1730/R1733/R1736 定向验证通过,退出码 0 | | Pylint | R1725 | super() 还在使用显式参数形式。 | 28 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0106 | 表达式求值后没有被使用。 | 2 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0108 | lambda 可以直接用普通函数替代。 | 2 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0122 | 使用了 exec。 | 6 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0123 | 使用了 eval。 | 7 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0127 | 变量被自赋值。 | 1 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0133 | 单独写了异常对象但没有抛出。 | 1 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0201 | 属性在 __init__ 之外定义。 | 2 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0211 | @staticmethod 仍接收实例或类参数。 | 1 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0221 | 重写方法参数与父类不一致。 | 1 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0231 | 子类初始化未调用父类 __init__。 | 2 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0246 | 重写方法只是原样委托给父类。 | 2 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0511 | 代码中保留了 FIXME/TODO 标记。 | 1 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0602 | 使用了 global,但未形成有效全局赋值。 | 8 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0621 | 局部名称遮蔽了外层作用域变量。 | 20 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0622 | 覆盖了 Python 内置名称。 | 259 | 在对应代码处添加 pylint 局部屏蔽;自动生成文件按当前源码 AST 定位;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0631 | 循环变量在循环外被引用。 | 1 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0632 | 解包数量与数据结构不匹配。 | 9 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W0640 | 闭包捕获了循环变量。 | 5 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | | Pylint | W1508 | 环境变量默认值类型不合适。 | 3 | 在对应代码处添加 pylint 局部屏蔽;未新增全局屏蔽配置 | 186 个非生成涉及文件定向验证通过,513 个屏蔽位置静态校验通过 | See merge request: Ascend/torchair!3417 | 2 个月前 | |
chore: 移除 superpowers skill 配置及 AGENTS.md 相关引用(#801) Co-authored-by: stevenaw0<huangguijun@huawei.com> # message auto-generated for no-merge-commit merge: !3724 merge chore/remove-superpowers-skill into master chore: 移除 superpowers skill 配置及 AGENTS.md 相关引用(#801) Created-by: stevenaw0 Commit-by: stevenaw0 Merged-by: ascend-robot Description: # Pull Request ## 描述 移除仓库中第三方 superpowers skill/插件的启用配置,并同步改写 AGENTS.md 中引用 superpowers 的段落。 具体变更: - .claude/settings.json:删除 enabledPlugins 中的 superpowers@claude-plugins-official 条目 - .opencode/opencode.json:删除 plugin 中的 superpowers@git+https://github.com/obra/superpowers.git 条目 - AGENTS.md:"设计文档输出规范"章节去掉 superpowers brainstorming skill 表述,改为通用表述(仍必须先读取 docs/zh/contributions/design_document_template.md 并按模板输出) 变更原因: 1. superpowers 插件需从 github.com 拉取,离线/内网环境下 opencode 启动会失败或长时间等待 2. 插件注入的 brainstorming 等流程与仓库自有设计文档规范冲突,AGENTS.md 需额外声明兜底规则 3. 第三方插件随仓库配置分发但未登记在开源软件清单中,存在合规风险 4. 仓库已有等价能力(设计文档模板 + 自建 skill),无需保留外部插件 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue https://gitcode.com/Ascend/torchair/issues/801 ## 如何测试 描述测试此变更的步骤和前提条件: 1. python3 -c "import json; json.load(open('.claude/settings.json')); json.load(open('.opencode/opencode.json'))",JSON 解析通过 2. grep -ri superpower .claude/settings.json .opencode/opencode.json AGENTS.md,无残留引用 3. git diff --name-only HEAD~1 | xargs pre-commit run --files,全部 Passed(gitleaks-offline-scan 因本地缺少 ./gitleaks 二进制无法执行,属环境限制;本变更为纯删除配置行与文档改写,未引入任何凭据) 4. 启动 AI 编码助手不再拉取 superpowers 插件,仓库自有 skill 与设计文档模板流程不受影响 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本次变更仅涉及 AI 编码助手配置文件与贡献者指引文档,不涉及任何运行时代码、构建脚本和测试用例。 设计文档输出规范保持不变:仍必须读取仓库设计文档模板并覆盖模板中的每个章节。 See merge request: Ascend/torchair!3724 | 19 天前 | |
fix: 根据 PyTorch 版本选择 C++ 编译标准 (#757) Co-authored-by: stevenaw0<huangguijun@huawei.com> # message auto-generated for no-merge-commit merge: !3669 merge fix/issue-757-cxx-standard into master fix: 根据 PyTorch 版本选择 C++ 编译标准 (#757) Created-by: stevenaw0 Commit-by: stevenaw0 Merged-by: ascend-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 根据当前 PyTorch 版本选择 TorchAir 的 C++ 编译标准:PyTorch < 2.13 使用 C++17,PyTorch >= 2.13 使用 C++20。同步覆盖 CMake 构建、TorchAir 自定义算子编译和 Inductor wrapper 运行时编译路径。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/Ascend/torchair/issues/757 ## 测试 <!--描述进行了哪些测试来验证你的改动。--> 1. 在 torch-npu-build-2.13.0-py311 环境确认 PyTorch 2.13.0+cpu 选择 c++20。 2. 验证 PyTorch 2.12.0 选择 c++17。 3. 使用 PyTorch 2.13 配置并完成完整 torchair CMake 编译。 4. Python 文件通过 py_compile,git diff --check 通过。 ## 类型标签 <!-- [x] 表示选中 --> - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: Ascend/torchair!3669 | 25 天前 | |
fix(docs):modify the path Co-authored-by: lyz0328<liyanzhen@huawei.com> # message auto-generated for no-merge-commit merge: !3690 merge master into master fix(docs):modify the path Created-by: lyz0328 Commit-by: lyz0328 Merged-by: ascend-robot Description: 修改《TorchNPU快速安装》路径 See merge request: Ascend/torchair!3690 | 25 天前 | |
pre-commit by rule=trailing-whitespace Co-authored-by: guanlongfeng<guanlongfeng1@huawei.com> # message auto-generated for no-merge-commit merge: !2931 merge clean_code into master pre-commit by rule=trailing-whitespace Created-by: glf2016 Commit-by: guanlongfeng Merged-by: ascend-robot Description: pre-commit-clean-code-rule=trailing-whitespace See merge request: Ascend/torchair!2931 | 5 个月前 | |
Add yurongkun to the repository approvers and reviewers Co-authored-by: dingdairong<dingdairong@huawei.com> # message auto-generated for no-merge-commit merge: !3533 merge chore/add-committer into master Add yurongkun to the repository approvers and reviewers Created-by: dingdairong Commit-by: dingdairong Merged-by: ascend-robot Description: - Add yurongkun to approvers - Add yurongkun to reviewers See merge request: Ascend/torchair!3533 | 1 个月前 | |
fix: 修复README.md中英文标点混用问题 Co-authored-by: tmj1128<tanmengjie2@huawei.com> # message auto-generated for no-merge-commit merge: !3578 merge fix/master-punctuation-mixed into master fix: 修复README.md中英文标点混用问题 Created-by: tmj1128 Commit-by: tmj1128 Merged-by: ascend-robot Description: ## 问题描述 README.md(master分支)中存在中英文标点混用问题,在中文语境下使用了英文括号、英文逗号和英文冒号,不符合中文排版规范。 ## 修改详情 共修复 **8处** 标点符号问题,涉及 **1个文件**(README.md): | 行号 | 问题 | 修改 | |------|------|------| | 3 | TorchAir(Torch Ascend...) 英文括号 | → TorchAir(Torch Ascend...) 中文括号 | | 61 | 设置,仅编译构建 英文逗号 | → 设置,仅编译构建 中文逗号 | | 98 | 调试(最小CPU调试): 英文括号+冒号 | → 调试(最小CPU调试): 中文括号+冒号 | | 100 | 如(ASCEND_SDK_PATH=...) 英文括号 | → 如(ASCEND_SDK_PATH=...) 中文括号 | | 112 | 安装,请参照 英文逗号 | → 安装,请参照 中文逗号 | | 121 | torch_npu,需要把 英文逗号 | → torch_npu,需要把 中文逗号 | | 196 | [版本配套表],下载地址 英文逗号 | → [版本配套表],下载地址 中文逗号 | | 198 | 示例: 英文冒号 | → 示例: 中文冒号 | ## 修改范围 - 文件数:1 - 行数变化:8 insertions, 8 deletions ## 未修复项 无。所有识别到的中英文标点混用问题均已修复。 See merge request: Ascend/torchair!3578 | 1 个月前 | |
torch air framework supported now | 3 年前 | |
fix: 修复README.md中英文标点混用问题 Co-authored-by: tmj1128<tanmengjie2@huawei.com> # message auto-generated for no-merge-commit merge: !3578 merge fix/master-punctuation-mixed into master fix: 修复README.md中英文标点混用问题 Created-by: tmj1128 Commit-by: tmj1128 Merged-by: ascend-robot Description: ## 问题描述 README.md(master分支)中存在中英文标点混用问题,在中文语境下使用了英文括号、英文逗号和英文冒号,不符合中文排版规范。 ## 修改详情 共修复 **8处** 标点符号问题,涉及 **1个文件**(README.md): | 行号 | 问题 | 修改 | |------|------|------| | 3 | TorchAir(Torch Ascend...) 英文括号 | → TorchAir(Torch Ascend...) 中文括号 | | 61 | 设置,仅编译构建 英文逗号 | → 设置,仅编译构建 中文逗号 | | 98 | 调试(最小CPU调试): 英文括号+冒号 | → 调试(最小CPU调试): 中文括号+冒号 | | 100 | 如(ASCEND_SDK_PATH=...) 英文括号 | → 如(ASCEND_SDK_PATH=...) 中文括号 | | 112 | 安装,请参照 英文逗号 | → 安装,请参照 中文逗号 | | 121 | torch_npu,需要把 英文逗号 | → torch_npu,需要把 中文逗号 | | 196 | [版本配套表],下载地址 英文逗号 | → [版本配套表],下载地址 中文逗号 | | 198 | 示例: 英文冒号 | → 示例: 中文冒号 | ## 修改范围 - 文件数:1 - 行数变化:8 insertions, 8 deletions ## 未修复项 无。所有识别到的中英文标点混用问题均已修复。 See merge request: Ascend/torchair!3578 | 1 个月前 | |
clean code Co-authored-by: guanlongfeng<guanlongfeng1@huawei.com> # message auto-generated for no-merge-commit merge: !3171 merge clean_code_clang-format into master clean code Created-by: glf2016 Commit-by: guanlongfeng Merged-by: ascend-robot Description: clean_code_clang-format c++ clean code See merge request: Ascend/torchair!3171 | 3 个月前 | |
更新readme文件,方便ai进行读取并部署环境 Co-authored-by: guanlongfeng<guanlongfeng1@huawei.com> # message auto-generated for no-merge-commit merge: !3467 merge master into master 更新readme文件,方便ai进行读取并部署环境 Created-by: glf2016 Commit-by: guanlongfeng Merged-by: ascend-robot Description: 更新readme文件,方便ai进行读取并部署环境 See merge request: Ascend/torchair!3467 | 2 个月前 | |
optimize torchair and pta ci time Co-authored-by: guanlongfeng<guanlongfeng1@huawei.com> # message auto-generated for no-merge-commit merge: !2987 merge ci_times into master optimize torchair and pta ci time Created-by: glf2016 Commit-by: guanlongfeng Merged-by: ascend-robot Description: optimize torchair and pta ci time See merge request: Ascend/torchair!2987 | 5 个月前 | |
add release/ut/st ci build and coverage generate | 3 年前 | |
pre-commit by rule=trailing-whitespace Co-authored-by: guanlongfeng<guanlongfeng1@huawei.com> # message auto-generated for no-merge-commit merge: !2931 merge clean_code into master pre-commit by rule=trailing-whitespace Created-by: glf2016 Commit-by: guanlongfeng Merged-by: ascend-robot Description: pre-commit-clean-code-rule=trailing-whitespace See merge request: Ascend/torchair!2931 | 5 个月前 | |
fixbug: issue#560、issue#562 Co-authored-by: PiyZZ<ling15255468810@gmail.com> # message auto-generated for no-merge-commit merge: !3325 merge master into master fixbug: issue#560、issue#562 Created-by: PiyZZ Commit-by: PiyZZ Merged-by: ascend-robot Description: fixbug: issue#560 (configure.py 使用已移除的 distutils.sysconfig,在 Python 3.12 上配置阶段崩溃) fixbug: issue#562 (configure 脚本中 config_file 变量未用 $ 引用,缓存跳过机制失效) See merge request: Ascend/torchair!3325 | 1 个月前 | |
fixbug: issue#560、issue#562 Co-authored-by: PiyZZ<ling15255468810@gmail.com> # message auto-generated for no-merge-commit merge: !3325 merge master into master fixbug: issue#560、issue#562 Created-by: PiyZZ Commit-by: PiyZZ Merged-by: ascend-robot Description: fixbug: issue#560 (configure.py 使用已移除的 distutils.sysconfig,在 Python 3.12 上配置阶段崩溃) fixbug: issue#562 (configure 脚本中 config_file 变量未用 $ 引用,缓存跳过机制失效) See merge request: Ascend/torchair!3325 | 1 个月前 | |
fix docs bug Co-authored-by: hulida<hulida@huawei.com> Co-authored-by: fu-hao-huawei<fuhao16@huawei.com> Co-authored-by: chenweiheng<chenweiheng1@hisilicon.com> Co-authored-by: SunYaping<sunyaping4@huawei.com> Co-authored-by: Achilles_d<duanchengyuan@huawei.com> Co-authored-by: zhukkk<zhuke11@huawei.com> Co-authored-by: tangjie66<tangjie66@huawei.com> # message auto-generated for no-merge-commit merge: !2811 merge ass into master fix docs bug Created-by: Sunyp01 Commit-by: Sunyp01;Achilles_d;fu-hao-huawei;chenweiheng;hulida;tangjie66;zhukkk;SunYaping Merged-by: ascend-robot Description: fix doc bug See merge request: Ascend/torchair!2811 | 6 个月前 |
简介
本项目开发了名为TorchAir(Torch Ascend Intermediate Representation)的扩展库,支持用户基于PyTorch框架和TorchNPU插件在昇腾NPU上使用图模式进行推理。 TorchAir继承自PyTorch框架Dynamo模式,将PyTorch的FX图转换为GE计算图,并提供了GE计算图在昇腾NPU的编译与执行的能力。
- 如果您想了解如何使用TorchAir,可以优先通过访问TorchAir图模式使用指南,了解关于TorchAir的更多信息。
- 如果您计划为TorchAir贡献代码,请参考README内容。
安装与卸载
1.安装
- 安装依赖
在安装TorchAir之前,请参考版本配套表和支持型号说明,确保您的硬件能够使用TorchAir,并安装最新昇腾软件栈。 建议:执行ut和简单用例请使用docker/Dockerfile中推荐的版本。
- 编译准备
克隆TorchAir代码仓
git clone https://gitcode.com/ascend/torchair.git
下载依赖三方库
cd torchair
git submodule update --init --recursive
配置编译环境,执行配置命令
配置只需要进行一次,用于获取pytorch的编译选项(如当前的torch是否开启ABI)及Ascend sdk的安装路径(如果需要在本地CPU上进行调试)。
cd ./torchair
bash ./configure
默认情况下,执行上述命会弹出如下的交互式会话窗口
您的会话可能有所不同。
Please specify the location of python with available torch 2.1.x installed. [Default is /usr/bin/python3]
(You can make this quiet by set env [TARGET_PYTHON_PATH]):
此时,要求您输入安装了 Torch 2.1 版本的python解释器路径,如果默认路径是正确的,直接回车,否则请输入正确的 python 解释器路径。
您可以通过设置
TARGET_PYTHON_PATH环境变量,来抑制交互式窗口弹出,但是要确保路径是有效的,否则,仍然会要求您输入正确的 python 解释器路径。
键入后,会耗费几秒钟以确保您的输入是有效的,接着,会弹出下面的交互式窗口
Specify the location of ascend sdk for debug on localhost or leave empty.
(You can make this quiet by set env [ASCEND_SDK_PATH]):
如果您不需要在本地CPU模拟执行,可以直接回车跳过。否则,需要输入昇腾处理器开发套件的安装路径(默认安装路径通常为/usr/local/Ascend/ascend-toolkit/latest/)。
您可以通过设置
ASCEND_SDK_PATH环境变量指定 Ascend CANN SDK 目录,你后续需要执行UT或者简单用例则需要提前设置,仅编译构建可设置NO_ASCEND_SDK环境变量指定不需要 SDK 来抑制交互式窗口弹出。
键入后,等待配置完成。
- 编译
执行以下命令,编译生成TorchAir安装包:
mkdir build
cd build
cmake ..
make torchair -j8
- 安装
编译完成后,会在build/dist/dist/目录下生成名为torchair-{version}-py3-none-any.whl的安装包文件。
您可以直接使用pip安装该安装包,或者使用make命令安装至您configure时指定的python环境中。
make install_torchair
2.卸载
torchair的卸载只需要执行命令:
pip3 uninstall torchair
如需要保存卸载日志,可在pip3 uninstall命令后面加上参数--log <PATH>,并对您指定的目录<PATH>做好权限管控。
快速上手
本地调试(最小CPU调试):
1、在执行./configure设置ASCEND_SDK_PATH如(ASCEND_SDK_PATH=xx/Ascend/ascend-toolkit/latest/)。
2、执行环境设置
source tools/env.sh
npu设备调试:
1、安装torch_npu
torch_npu版本可以根据环境要求安装,请参照[版本配套表]。
pip3 install numpy
pip3 install pyyaml
pip3 install setuptools
pip3 install torch_npu==2.12 # 通过pip安装torch_npu时会自动安装依赖的torch版本
如果安装了真实torch_npu,需要把torch_npu的stubs模块链接环境去除,否则无法正常使用。 如LD_LIBRARY_PATH中去除/workspace/build/stubs设置,如果没有设置请忽略。
2、安装CANN主线版本
npu调试依赖CANN主线版本。如果您是外部用户,可以联系对应的支撑团队获取安装包。
执行前,需要执行 CANN 安装目录下的 set_env.sh 设置 CANN 相关环境变量
例如CANN安装路径为
/usr/local/Ascend/cann,则执行:
source /usr/local/Ascend/cann/set_env.sh
执行以下python脚本快速验证TorchAir基本功能
import torch
import torchair
config = torchair.CompilerConfig()
npu_backend = torchair.get_npu_backend(compiler_config=config)
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, x, y):
return torch.add(x, y)
model = Model()
model = torch.compile(model, backend=npu_backend, dynamic=False)
x = torch.randn(2, 2)
y = torch.randn(2, 2)
model(x, y)
特性介绍
TorchAir常用特性如下,全量特性介绍请访问docs获取详细教程。
| 特性功能 | 功能介绍 |
|---|---|
| 日志功能 | 日志功能 |
| graph dump功能 | 图dump功能 |
| dynamo export功能 | air格式图导出功能 |
| data dump功能 | 精度数据dump功能 |
| graph fusion功能 | 用户自定义关闭/开启部分融合算子功能 |
| experimental性能提升功能 | 试验性质功能,不同功能适用于特定场景,详见参考资料 |
| converter功能拓展 | 用户自行扩展模型中缺失的converter功能 |
| 支持的aten API清单 | 支持的aten API清单 |
版本配套表
本项目与PyTorch、TorchNPU、CANN以及Python的版本匹配详情如下:
| TorchAir版本 | PyTorch版本 | TorchNPU版本 | CANN版本 | Python版本 |
|---|---|---|---|---|
| master(主线) | 2.7.1 + | 在研版本 | 在研版本 | Python3.10.x |
| v26.1.0 | 2.7.1 + | v26.1.0 | 9.1.0 | Python3.10.x / Python3.11.x |
| v26.0.0 | 2.7.1 + | v26.0.0 | 9.0.0 | Python3.10.x / Python3.11.x |
| 7.3.0 | 2.6.0 / 2.7.1 / 2.8.0 | 7.3.0 | 8.5.0 | Python3.9.x / Python3.10.x / Python3.11.x |
| 7.3.0 | 2.9.0 | 7.3.0 | 8.5.0 | Python3.9.x / Python3.10.x / Python3.11.x / Python3.12.x |
| 7.2.0 | 2.1.0 | 7.2.0 | 8.3.RC1 | Python3.8.x / Python3.9.x / Python3.10.x / Python3.11.x |
| 7.2.0 | 2.6.0 / 2.7.1 / 2.8.0 | 7.2.0 | 8.3.RC1 | Python3.9.x / Python3.10.x / Python3.11.x |
| 7.1.0 | 2.1.0 | 7.1.0 | 8.2.RC1 | Python3.8.x / Python3.9.x / Python3.10.x / Python3.11.x |
| 7.1.0 | 2.5.1 / 2.6.0 | 7.1.0 | 8.2.RC1 | Python3.9.x / Python3.10.x / Python3.11.x |
| 7.0.0 | 2.1.0 / 2.3.1 / 2.4.0 | 7.0.0 | 8.1.RC1 | Python3.8.x / Python3.9.x / Python3.10.x / Python3.11.x |
| 7.0.0 | 2.5.1 | 7.0.0 | 8.1.RC1 | Python3.9.x / Python3.10.x / Python3.11.x |
torch_npu的版本选择请参照[版本配套表],下载地址:TorchNPUReleases。
支持的型号
- Ascend 950PR/Ascend 950DT
- Atlas A3 训练系列产品/Atlas A3 推理系列产品
- Atlas A2 训练系列产品/Atlas A2 推理系列产品
贡献
如果您计划为TorchAir做出贡献,请参考CONTRIBUTING。
联系我们

安全声明
TorchAir安全声明参考SECURITY_README文件。
许可证
TorchAir插件使用BSD许可证。详见LICENSE文件。
免责声明
致TorchAir使用者
- TorchAir提供的模型仅供您用于非商业目的。
- 对于各模型,TorchAir平台仅提示性地向您建议可用于训练的数据集,华为不提供任何数据集,如您使用这些数据集进行训练,请您特别注意应遵守对应数据集的License,如您因使用数据集而产生侵权纠纷,华为不承担任何责任。
- 如您在使用TorchAir模型过程中,发现任何问题(包括但不限于功能问题、合规问题),请在GitCode提交issue,我们将及时审视并解决。
致数据集所有者
如果您不希望您的数据集在TorchAir中的模型被提及,或希望更新TorchAir中的模型关于您的数据集的描述,请在GitCode提交issue,我们将根据您的issue要求删除或更新您的数据集描述。衷心感谢您对TorchAir的理解和贡献。