| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 2 年前 | ||
Skip old torch(<=2.2) test case in test/dynamo/test_activate_checkpoint.py Co-authored-by: zhangafei<zhangafei@huawei.com> # message auto-generated for no-merge-commit merge: !37356 merge v2.12.0 into v2.12.0 Skip old torch(<=2.2) test case in test/dynamo/test_activate_checkpoint.py Created-by: HandsoemLemon Commit-by: zhangafei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ [Bug]: 26.1.0版本图模式Bug修复:https://gitcode.com/Ascend/pytorch/issues/1962 > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 当前测试用例为对2024年1月pytorch 2.2版本测试用例,其中存在大量与现版本API不一致问题,修改用例,检测当时torch若大于2.2,则跳过部分用例。 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!37356 | 2 个月前 | |
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
fix: preserve deferred Triton backend loading (v2.12.0) Co-authored-by: stevenaw0<huangguijun@huawei.com> # message auto-generated for no-merge-commit merge: !44737 merge sync/deferred-triton-loader-v2.12.0 into v2.12.0 fix: preserve deferred Triton backend loading (v2.12.0) Created-by: stevenaw0 Commit-by: stevenaw0 Merged-by: ascend-robot Description: ## 关联 Issue - #4094 ## 背景 import torch性能优化需求(pull/44372)将 Inductor 初始化从首次 backend 执行阶段提前到 torch.compile() wrapper 创建阶段。默认 Triton backend 因此被提前导入;在未安装 triton-ascend 的环境中,torch_npu/_inductor/runtime/triton_helpers.py 会报 tl.extra.ascend 缺失。 ## 修改内容 - 恢复默认 Inductor backend 的首次执行加载时机。 - 增加测试,验证创建 backend="inductor" wrapper 时不会加载 torch_npu._inductor。 ## 验证 环境:torch-npu-2.10.0-py311、PyTorch 2.10.0+cpu、AArch64、CANN 9.1.0。 - 原 tl.extra.ascend 缺失错误消失。 See merge request: Ascend/pytorch!44737 | 4 小时前 | |
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
[feat] deterministic_level: add graph-mode guard and EX scope API Co-authored-by: ChengLyric<licheng236@huawei.com> # message auto-generated for no-merge-commit merge: !42191 merge feature/deterministic-level-graph-mode-v2.12.0 into v2.12.0 [feat] deterministic_level: add graph-mode guard and EX scope API Created-by: Guanam2020 Commit-by: ChengLyric Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 1、新增 torch_npu.dynamo._deterministic_guard.install_npu_deterministic_level_guard()。在 Dynamo 的 TracingContext.guards_context.dynamo_guards 中注册 Lambda Guard。 2、新增 torch_npu._inductor.deterministic_cache,在 AscendC 编译 scope 内 patch。 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 自验证ok # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!42191 | 27 天前 | |
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
[sync] PR-34962: add testcase test_guard_control for dynamo tests. Co-authored-by: rmch<chenruimin2@huawei.com> # message auto-generated for no-merge-commit merge: !35011 merge sync-pr34962-v2.10.0-0507-to-master into master [sync] PR-34962: add testcase test_guard_control for dynamo tests. Created-by: ascend-ds-bot Commit-by: rmch Merged-by: ascend-robot Description: ### 1. Origin pull request: https://gitcode.com/Ascend/pytorch/merge_requests/34962 ### 2. Original pull request related issue(s): ### 3. Original pull request related commit(s): | Sha | Datetime | Message | |---|---|---| |[9c39a7df](https://gitcode.com/Ascend/pytorch/commit/9c39a7df118f645f7661a7eeda50f9e426e81c62)|2026-05-07 17:02:17 +0800 CST|add testcase test_guard_control for dynamo tests.<br><br>Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com><br>| See merge request: Ascend/pytorch!35011 | 3 个月前 | |
test: sync dynamo compile cache tests to v2.12.0 Co-authored-by: wangzili<wangzili14@huawei.com> # message auto-generated for no-merge-commit merge: !37711 merge v2.12.0 into v2.12.0 test: sync dynamo compile cache tests to v2.12.0 Created-by: wangzili121 Commit-by: wangzili Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [x] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 "基于 torch_npu 2.10 + 版本完成 dynamo 编译缓存适配"需求的单测在v2.12.0版本上报错,现已解决,将相应用例同步到高版本看护 test/dynamo/test_package.py test/dynamo/test_precompile_context.py test/dynamo/test_guard_serialization.py test/_inductor/test_codecache.py # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 本地验证用例均通过 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!37711 | 2 个月前 | |
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !36367 merge v2.12.0_lintrunner into v2.12.0 [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!36367 | 2 个月前 | |
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
Provides npugraph_ex APIs for user-defined backends and passes Co-authored-by: xuzhenhua2025<xuzhenhua4@huawei.com> # message auto-generated for no-merge-commit merge: !30229 merge master into master fix: npugraph_ex补充用户自定义backend和自定义pass缺失的接口 Created-by: xuzhenhua2025 Commit-by: xuzhenhua2025 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > (如有)请关联需求文档/issue链接 - [ ] 需求 - [x] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) 1. npugraph_ex补充用户自定义backends接口 2. npugraph_ex补充用户自定义passes相关接口 2.1 补充注册replacement接口 2.2 补充自定义pass流record接口 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 已在新版本资料中补充接口说明,资料配套发布。 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 1. 补充user-defined backends接口 python def my_backend(gm: torch.fx.GraphModule, example_inputs): compiler = torch.npu.npugraph_ex.compile_fx() return aot_module_simplified(gm, example_inputs, fw_compiler=compiler) 2. 补充user-defined passes接口 python torch.npu.npugraph_ex.register_replacement( search_fn=search_fn, replace_fn=replace_fn, example_inputs=(input_tensor(), input_tensor(), kwargs_tensor()), extra_check=extra_check ) python # record and wait should be used in pairs with torch.npu.npugraph_ex.scope.npu_stream_switch('1'): # ... record = torch.npu.npugraph_ex.ops.record() # ... torch.npu.npugraph_ex.ops.wait([record]) # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 新增测试用例看护: 1. compile_fx接口用例: /test/dynamo/test_npugraph_ex.TestNpuGraphEx.test_compile_fx 2. 自定义pass接口用例: /test/dynamo/test_npugraph_ex.TestNpuGraphEx.test_register_replacement /test/dynamo/test_npugraph_ex.TestNpuGraphEx.test_record_and_wait  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!30229 | 6 个月前 | |
【bugfix】npugraph_ex.scope.limit_core_num增加默认参数stream Co-authored-by: wangkai<wangkai579@huawei.com> # message auto-generated for no-merge-commit merge: !38938 merge v2.12.0 into v2.12.0 【bugfix】npugraph_ex.scope.limit_core_num增加默认参数stream Created-by: mihudan Commit-by: wangkai Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> https://gitcode.com/Ascend/pytorch/issues/2445 - [ ] 需求 - [ ] 问题单 - [ ] issue/工单 - [x] 重构优化 - [ ] 资料更新 torchair仓合入PR:【refeat】limit_core_num控核支持单算子和可选参数streamhttps://gitcode.com/Ascend/torchair/pull/3181 资料修改: 【doc】limit_core_num支持可选参数streamhttps://gitcode.com/Ascend/torchair/pull/3227 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” ex资料修改已合入 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” npugraph_ex接口增加默认参数,ex资料修改已合入,组内已检视 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 已增加传入stream参数场景  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!38938 | 1 个月前 | |
fix:Optimize the implementation of compile + npugraphs Co-authored-by: ygshen<ygshen@qq.com> # message auto-generated for no-merge-commit merge: !31759 merge npugrahps_opt into master fix:Optimize the implementation of compile + npugraphs Created-by: ygshen Commit-by: ygshen Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 在优化前,每次推理都需要使用npugraph_mark_step_begin() 表示一轮新的迭代。否则一直处于warmup状态, 无法进入capture和replay状态。 在走读代码过程中,发现forward_npugraphs的参数is_inference表明是否为推理模式,但是在调用下级函数时直接写成固定值flase,导致该功能有问题。 在讨论过程,发现上游社区也做了优化: https://github.com/pytorch/pytorch/commit/627c7d6799444c200f22b8fa81eec7aca5281541 因此参照社区方案进行优化。 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 优化前,用例执行失败: 截图如下:  优化后,用例执行成功:  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!31759 | 5 个月前 | |
| 2 年前 | ||
test: sync dynamo compile cache tests to v2.12.0 Co-authored-by: wangzili<wangzili14@huawei.com> # message auto-generated for no-merge-commit merge: !37711 merge v2.12.0 into v2.12.0 test: sync dynamo compile cache tests to v2.12.0 Created-by: wangzili121 Commit-by: wangzili Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [x] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 "基于 torch_npu 2.10 + 版本完成 dynamo 编译缓存适配"需求的单测在v2.12.0版本上报错,现已解决,将相应用例同步到高版本看护 test/dynamo/test_package.py test/dynamo/test_precompile_context.py test/dynamo/test_guard_serialization.py test/_inductor/test_codecache.py # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 本地验证用例均通过 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!37711 | 2 个月前 | |
| 2 年前 | ||
test: sync dynamo compile cache tests to v2.12.0 Co-authored-by: wangzili<wangzili14@huawei.com> # message auto-generated for no-merge-commit merge: !37711 merge v2.12.0 into v2.12.0 test: sync dynamo compile cache tests to v2.12.0 Created-by: wangzili121 Commit-by: wangzili Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [x] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 "基于 torch_npu 2.10 + 版本完成 dynamo 编译缓存适配"需求的单测在v2.12.0版本上报错,现已解决,将相应用例同步到高版本看护 test/dynamo/test_package.py test/dynamo/test_precompile_context.py test/dynamo/test_guard_serialization.py test/_inductor/test_codecache.py # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 本地验证用例均通过 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!37711 | 2 个月前 | |
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
fix: add PyObject_ClearWeakRefs in NPU Stream/Event tp_dealloc Co-authored-by: xiu_21<caixiuxiu1@huawei.com> # message auto-generated for no-merge-commit merge: !41678 merge dealloc_2.12 into v2.12.0 fix: add PyObject_ClearWeakRefs in NPU Stream/Event tp_dealloc Created-by: xiu_21 Commit-by: xiu_21 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [x] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 PyTorch 基础类 THPStream / THPEvent 中增加了 weakref 支持(添加了 weakreflist 字段),但 NPU 后端的 tp_dealloc 覆盖函数未同步更新。 CPython 对静态 PyType 不会自动链式调用父类 tp_dealloc,因此 THNPEvent_dealloc 和 THNPStream_dealloc 一直缺少: 1. PyObject_ClearWeakRefs() — 未清理 weakref,导致 wr_object 悬空指向已释放内存 2. Py_CLEAR(self->context)(仅 Stream)— lazy stream context 泄漏 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 pytest test/dynamo/test_stream.py -k test_npu_stream_event_weakref_callback 修改前:  修改后:  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!41678 | 1 个月前 | |
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !36367 merge v2.12.0_lintrunner into v2.12.0 [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!36367 | 2 个月前 | |
| 2 年前 | ||
test:Add test cases for torch.compiler.compile Co-authored-by: yuhuan2580<wn0010240@163.com> # message auto-generated for no-merge-commit merge: !42091 merge torch.compiler.compile-2.12.0 into v2.12.0 test:Add test cases for torch.compiler.compile Created-by: ljfnjj1234567 Commit-by: yuhuan2580 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 关联任务issue: https://gitcode.com/Ascend/pytorch/issues/2991 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 torch.compiler.compile (API 94) PyTorch 官方社区暂无针对该 API 的直接独立用例覆盖,因此自行编写用例并提交到 test 目录。 该 API 为纯 Python 实现,不涉及 NPU 适配,不需要代码修改。 新增 test/dynamo/test_torch_compiler_compile.py,验证 torch.compiler.compile 存在性、基本编译功能及模型编译功能 更新 docs/zh/native_apis/ 下所有版本的 torch-compiler.md,将 torch.compiler.compile 支持状态从"否"改为"是" # 【资料变更】 涉及。上游 PyTorch 在 test/dynamo/test_compile.py 中有相关测试,但未针对 torch.compiler.compile 公开 API 编写独立测试。本次提交补充了 3 个测试方法,覆盖 API 存在性、函数编译、Module 编译的核心行为,测试文件位于test/dynamo/test_torch_compiler_compile.py更新 docs/zh/native_apis/ 下 pytorch2-7-1 至 pytorch2-12-0 的 torch-compiler.md,将 torch.compiler.compile 标记为已支持。 # 【接口变更】 不涉及 # 【功能介绍】 torch.compiler.compile 是 PyTorch 2.x 引入的公开编译 API,用于将函数或 nn.Module 通过 TorchDynamo 进行即时编译优化。支持指定 backend(如 "eager"、"inductor" 等),返回编译后的可调用对象。 # 【功能验证】 test_torch_compiler_compile.py(torch.compiler.compile) 1.test_torch_compiler_compile_exists:验证torch.compiler.compile接口存在且可调用 2.test_torch_compiler_compile_basic:验证torch.compiler.compile对简单函数的编译功能正常 3.test_torch_compiler_compile_with_model:验证torch.compiler.compile对nn.Module模型的编译功能正常 运行命令: python -m pytest /workspace/user_data/pytorch-v2.12.0/test/dynamo/test_torch_compiler_compile.py -xvs 2>&1 运行结果:  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!42091 | 21 天前 | |
| 2 年前 | ||
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !36367 merge v2.12.0_lintrunner into v2.12.0 [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!36367 | 2 个月前 | |
| 2 年前 | ||
[fix] torch2.12 dynamo原生支持record_stream Co-authored-by: fu-hao-huawei<fuhao16@huawei.com> # message auto-generated for no-merge-commit merge: !36504 merge v2.12.0 into v2.12.0 [fix] torch2.12 dynamo原生支持record_stream Created-by: fu-hao-huawei Commit-by: fu-hao-huawei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ https://gitcode.com/Ascend/pytorch/issues/2074 > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [x] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ 去除torch2.12 版本对dynamo record_stream函数的patch > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 已有ut看护 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!36504 | 2 个月前 | |
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 2 年前 | ||
| 2 个月前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 4 小时前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 27 天前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 3 个月前 | ||
| 2 个月前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 个月前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 6 个月前 | ||
| 1 个月前 | ||
| 5 个月前 | ||
| 2 年前 | ||
| 2 个月前 | ||
| 2 年前 | ||
| 2 个月前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 个月前 | ||
| 2 个月前 | ||
| 2 年前 | ||
| 21 天前 | ||
| 2 年前 | ||
| 2 个月前 | ||
| 2 年前 | ||
| 2 个月前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 |