| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[master][Fix] Fix static check errors detected by CODESPELL Co-authored-by: thickhair<zp2165064878@163.com> # message auto-generated for no-merge-commit merge: !38552 merge code_spell_fix_master into master [master][Fix] Fix static check errors detected by CODESPELL Created-by: thickhair Commit-by: thickhair Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 https://gitcode.com/Ascend/pytorch/issues/1865 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” # 【功能验证】  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!38552 | 3 个月前 | |
Revert "compat(v2.13): fix the compat with upstream master 2.13, create compat module for csrc." Co-authored-by: chz34<chenhaozhe1@huawei.com> # message auto-generated for no-merge-commit merge: !35634 merge revert-0416 into master Revert "compat(v2.13): fix the compat with upstream master 2.13, create compat module for csrc." Created-by: c_34 Commit-by: chz34 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> 原PR为了适配最新的2.13上的torch重构,同时保留了master对2.12版本的支持,上游的这个重构https://github.com/pytorch/pytorch/pull/181782, 发生在4月29日 原PR的master门禁还是跑的2.12的版本所以没有问题 然后这个commit 把master的配套torch,切换到了4月16日的2.13版本,是2.13,但是是上游重构前的版本 https://gitcode.com/Ascend/pytorch/commit/ad12f8f48463f31f99a2091e65be9984ef245c08?ref=master 导致和已经合入master的重构所依赖的上游版本不匹配了,编译报错 当前先回退对新版本的支持,待CI镜像升级后重新适配上游重构 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!35634 | 4 个月前 | |
add control of python GC before capture npugraph Co-authored-by: 周锐淇<zhouruiqi5@huawei.com> # message auto-generated for no-merge-commit merge: !27715 merge master into master add control of python GC before capture npugraph Created-by: rich9527 Commit-by: 周锐淇 Merged-by: ascend-robot Description: <!-- Thanks for sending a pull request! --> **What type of PR is this?** > /kind task **What does this PR do / why do we need it**: add control of python GC before capture npugraph **Which issue(s) this PR fixes**: <!-- *Automatically closes linked issue when PR is merged. Usage: Fixes #<issue number>, or Fixes (paste link of issue). --> Fixes # **Special notes for your reviewers**: See merge request: Ascend/pytorch!27715 | 9 个月前 | |
add_triton_warning | 3 个月前 | |
fix lazy_init and api export Co-authored-by: bellatan<tanmei2@huawei.com> # message auto-generated for no-merge-commit merge: !36703 merge torch_npu_init_refactor into master fix lazy_init and api export Created-by: bellatan Commit-by: bellatan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [ ] issue/工单 - [x] 重构优化 - [ ] 资料更新 # 【修改方案】 **问题1**:test/test_npu.py的test_lazy_init用例失败  **根因**: 重构前 torch_npu/__init__.py 中,先做 accelerator 冲突检查,即_check_device_conflict 接口调用,再 import torch_npu.npu、torch_npu.utils 等内部模块,不会触发 NPU device count 提前枚举 重构后 torch_npu/__init__.py 中,先调用了_check_device_conflict 接口,再 import torch_npu.npu、torch_npu.utils 等内部模块,_check_device_conflict 接口调用顺序被延后,调用 _get_accelerator() 时 NPU backend 状态已经被拉起,触发底层设备探测,导致 _npu_getDeviceCount() 提前枚举真实设备数 8。 **解决** : 在 torch_npu/__init__.py 中,保持和重构前一样的调用顺序,即_check_device_conflict 接口调用提前到所有的 import 之前。 **问题2**:缺失子模块导出的 API: python torch_npu.asd.checksum torch_npu.utils.syncbatchnorm **现象**:  **根因分析**: 旧版 torch_npu/__init__.py 是一个大顶层初始化脚本,里面直接写了很多顶层 import: python from torch_npu.asd.checksum import _matmul_checksum as matmul_checksum import torch_npu.utils.syncbatchnorm 这些 import 会产生父包属性挂载副作用: python torch_npu.asd.checksum torch_npu.utils.syncbatchnorm 重构后初始化逻辑被拆分到 _init/core/module_loader.py、_exports.py 等模块中,部分旧版顶层 import 副作用没有恢复,因此这些子模块路径在 import torch_npu 后不可见。 **解决方案**: 在 _load_registration_modules() 中补充子模块父包属性: python import torch_npu.asd.checksum # noqa: F401 import torch_npu.utils.syncbatchnorm # noqa: F401 **问题3**:顶层属性缺失 API python torch_npu.ParallelStore torch_npu._ShardedGradScaler **现象**:  **根因分析**: 旧版顶层有: python from torch_npu._C._distributed_c10d import ParallelStore from torch_npu.npu.amp.sharded_grad_scaler import _ShardedGradScaler 因此旧版支持: python torch_npu.ParallelStore torch_npu._ShardedGradScaler 重构后 _distributed_c10d 子模块初始化逻辑被集中到 C 扩展子模块初始化流程中,但没有把 ParallelStore 恢复到 torch_npu 顶层,导致旧版顶层访问路径缺失。_ShardedGradScaler 只在 distributed patch 逻辑中局部 import: python def _apply_sharded_grad_scaler_patch(torch): from torch.distributed.fsdp import sharded_grad_scaler from torch_npu.npu.amp.sharded_grad_scaler import _ShardedGradScaler sharded_grad_scaler.ShardedGradScaler = _ShardedGradScaler 这能保证 patch 行为一致,但没有恢复旧版顶层属性torch_npu._ShardedGradScaler **解决方案**: 在 _exports.py 中补 legacy 顶层属性: python def _export_distributed_apis(globals_dict): """ Export legacy distributed-related top-level APIs. Rule: - torch_npu._C._distributed_c10d.ParallelStore -> torch_npu.ParallelStore - torch_npu.npu.amp.sharded_grad_scaler._ShardedGradScaler -> torch_npu._ShardedGradScaler Note: These APIs are kept for compatibility and should not be added to __all__. """ from torch_npu._C._distributed_c10d import ParallelStore from torch_npu.npu.amp.sharded_grad_scaler import _ShardedGradScaler globals_dict["ParallelStore"] = ParallelStore globals_dict["_ShardedGradScaler"] = _ShardedGradScaler # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 test/test_torch_npu_init.py 新增对应的测试项本地验证pass,CI pass  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!36703 | 4 个月前 | |
feat: [graph partition] aclgraph support graph partition Co-authored-by: luochao60<luochao60@huawei.com> # message auto-generated for no-merge-commit merge: !35324 merge pta_support_graph_partition_20260414_master into master feat: [graph partition] aclgraph support graph partition Created-by: luochao60 Commit-by: luochao60 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > (如有)请关联需求文档/issue链接 > 关联 issue: #1911 (https://gitcode.com/Ascend/pytorch/issues/1911) - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 1. ** torch_npu/utils/_graph_tree.py — 新增 get_manager monkey-patch** 上游 torch._inductor.output_code.maybe_handle_backward_generation 和 torch._dynamo.backends.cudagraphs 会直接调用 torch._inductor.cudagraph_trees.get_manager,依赖它返回真实的 manager 实例来推进 backward 的 cudagraph 状态机。NPU 把自己的 NPUGraphTreeManager 注册在独立 registry(torch_npu.npu._graph_tree),导致上游那两条路径在 NPU 设备上拿不到 manager,触发 AssertionError 或 AttributeError。在 _apply_npugraph_tree_methods() 末尾把 torch._inductor.cudagraph_trees.get_manager 重指到 NPU 的 get_manager(签名一致、duck-typing 兼容),打通 backward 状态机闭环。 2. **torch_npu/_inductor/codegen/wrapper.py — wrapper 体系重构以支持 graph partition** 提取 _NPUKernelCodegenMixin 混入类,把 NPU 特化逻辑(define_kernel 中 user_autotune → user_autotune_npu、PrecomputedGrid → PrecomputedGridNpu、FixedGrid → FixedGridNpu 替换;get_next_kernel_suffix、make_buffer_free 等)从原 NPUWrapperCodeGen 上移;新增 NPUSubgraphWrapperCodegen(_NPUKernelCodegenMixin, SubgraphPythonWrapperCodegen) 让 subgraph wrapper 共享 NPU 适配;NPUWrapperCodeGen.create() 在 is_subgraph=True 时返回新的 subgraph wrapper。 3. **torch_npu/_inductor/lowering_op_list.py — graph partition 所需算子注册** GENERATE_LIST 新增 prims.device_put、aten.unbind、torch.ops.higher_order.cond。 4. **torch_npu/csrc/core/npu/NPUHooksInterface.{h,cpp} — Pinned memory 接口实现** override 上游 at::PrivateUse1HooksInterface 新增的虚函数:isPinnedPtr() 走 CachingHostAllocator_isPinned,getPinnedMemoryAllocator() 返回 getPinnedMemoryAllocator()。同时新增 CachingHostAllocator.h 包含。 5. **test/_inductor/test_inductor_graph_partition.py — graph partition 测试集** 新增 graph partition 场景的系列用例:dynamic shapes、condition op、custom op 拆分、subgraph wrapper user_autotune 兜底、forward cudagraph + backward fallback 等。 # 【资料变更】 不涉及 # 【接口变更】 不涉及。C++ 层 NPUHooksInterface::isPinnedPtr 和 getPinnedMemoryAllocator 是对上游 PrivateUse1HooksInterface 已有虚函数的 override 实现,非新增对外 API。 # 【功能验证】 在 test/_inductor/test_inductor_graph_partition.py 中新增覆盖 graph partition 场景的用例: - test_graph_partition_dynamic_shapes:动态 shape 下产生 3 个 npugraph - test_graph_partition_condition_op:cond / higher-order op 切图 - test_graph_partition_custom_op:cudagraph_unsafe 自定义算子切分边界 - test_graph_partition_subgraph_wrapper_user_autotune:子图 wrapper 的 user_autotune 替换路径 - forward cudagraph + backward fallback 的混合路径 通过 python test/_inductor/test_inductor_graph_partition.py 在 NPU 设备上跑通全部用例。 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!35324 | 4 个月前 | |
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [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!35981 | 4 个月前 | |
[master][Fix] Fix static check errors detected by CODESPELL Co-authored-by: thickhair<zp2165064878@163.com> # message auto-generated for no-merge-commit merge: !38552 merge code_spell_fix_master into master [master][Fix] Fix static check errors detected by CODESPELL Created-by: thickhair Commit-by: thickhair Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 https://gitcode.com/Ascend/pytorch/issues/1865 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” # 【功能验证】  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!38552 | 3 个月前 | |
[new memconfig] add max_non_split_rounding_mb and release_lock_on_npumalloc Co-authored-by: xuyun15<xuyun15@huawei.com> # message auto-generated for no-merge-commit merge: !35689 merge xy_dev into master [new memconfig] add max_non_split_rounding_mb and release_lock_on_npumalloc Created-by: xuyun15 Commit-by: xuyun15 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 与torch社区一致,补充对应的配置到分支即可。 ### 1. Feature 核心工作机制 本 PR 为 NPU Caching Allocator 新增两个可配置项: - ** max_non_split_rounding_mb**:将空闲块选择逻辑中硬编码的 kLargeBuffer(20MB)取整阈值替换为可配置值。用户可通过环境变量或运行时 API 调整该阈值,控制大块分配时的内存浪费容忍度。该配置委托给 c10 基类 AcceleratorAllocatorConfig 管理。 - **release_lock_on_npumalloc**:在 NPU 内存分配(AclrtMallocAlign32)期间释放分配器互斥锁,允许其他线程并发执行分配器操作,提升多线程场景下的并发性能。利用 c10::make_scope_exit 实现 RAII 式的锁恢复,保证异常安全。 ### 2. 核心调用路径 - **配置解析**:PYTORCH_NPU_ALLOC_CONF / _set_allocator_settings() → NPUAllocatorConfig::parseArgs() → AcceleratorAllocatorConfig::parseMaxNonSplitRoundingSize() / NPUAllocatorConfig::parseReleaseLockOnNpuMalloc() - **取整阈值使用**:get_free_block() → NPUAllocatorConfig::max_non_split_rounding_size() → 块选择判断 - **锁释放使用**:alloc_block() → NPUAllocatorConfig::release_lock_on_npumalloc() → lock.unlock() → AclrtMallocAlign32 → scope_exit → lock.lock() ### 3. 核心数据结构 - AcceleratorAllocatorConfig::max_non_split_rounding_size_:std::atomic<size_t>,存储取整阈值(字节),默认 20MB - NPUAllocatorConfig::m_release_lock_on_npumalloc:bool,是否在 malloc 期间释放锁,默认 false - c10::scope_exit:RAII 作用域守卫,析构时自动执行回调 ### 4. 用户使用 - 配置如下:参数含义与社区一致/或者使用export PYTORCH_NPU_ALLOC_CONF环境变量的方式 - torch.npu.memory._set_allocator_settings("max_split_size_mb:50,max_non_split_rounding_mb:30") - `torch.npu.memory._set_allocator_settings("release_lock_on_npumalloc:True") # 【资料变更】 > 不涉及 # 【接口变更】 > 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!35689 | 3 个月前 | |
[fix] use_compatible_impl defualt value change in gather Co-authored-by: adelaideliu<adelaideliu@163.com> # message auto-generated for no-merge-commit merge: !38217 merge master_A5 into master [fix] use_compatible_impl defualt value change in gather Created-by: adelaideliu Commit-by: adelaideliu Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 https://gitcode.com/Ascend/pytorch/issues/2359 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 gather实际实现在python侧,所以在python增加机型判断,A5机器时无效化兼容接口torch_npu.npu.use_compatible_impl(),直接走原实现 # 【资料变更】 “不涉及” # 【接口变更】 “不涉及” # 【功能验证】 放到issue里 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!38217 | 3 个月前 | |
fix:lazy torchair print import error Co-authored-by: ChengLyric<licheng236@huawei.com> # message auto-generated for no-merge-commit merge: !36679 merge master_fix_torchair_import_error into master fix:lazy torchair print import error 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、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) 删掉torchair懒加载时抛出的异常链,直接返回原始报错,修改原始报错args # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 已验证问题场景ok # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!36679 | 4 个月前 | |
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [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!35981 | 4 个月前 | |
【fix】batcnnorm_check_fix Co-authored-by: 1479518308<cuiduo1@huawei.com> # message auto-generated for no-merge-commit merge: !36325 merge master into master 【fix】batcnnorm_check_fix Created-by: cuiduo Commit-by: 1479518308 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 为batcnnorm修改校验位置,适配NestedTensor以对其社区 # 【资料变更】 > 不涉及 # 【接口变更】 > 不涉及 # 【功能验证】 > 本地验证pass # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!36325 | 4 个月前 | |
【bugfix】npugraph_ex.scope.limit_core_num增加默认参数stream Co-authored-by: wangkai<wangkai579@huawei.com> # message auto-generated for no-merge-commit merge: !38928 merge master into master 【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!38928 | 3 个月前 | |
[onnx] fix group_norm_silu and rotary_mul onnx api. Co-authored-by: shi-jiaxin9<shijiaxin10@h-partners.com> # message auto-generated for no-merge-commit merge: !31954 merge master into master [onnx] fix group_norm_silu and rotary_mul onnx api. Created-by: shi-jiaxin9 Commit-by: shi-jiaxin9 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 问题单 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!31954 | 6 个月前 | |
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [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!35981 | 4 个月前 | |
[test]profiler fix uttest Co-authored-by: hehongzhe<935062458@qq.com> # message auto-generated for no-merge-commit merge: !38683 merge tem into master [test]profiler fix uttest Created-by: hhz0 Commit-by: hehongzhe Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 https://gitcode.com/Ascend/pytorch/issues/2347 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) 之前删除函数没有删除对应ut测试用例,补充删除 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!38683 | 3 个月前 | |
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [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!35981 | 4 个月前 | |
add_triton_warning | 3 个月前 | |
fix lazy_init and api export Co-authored-by: bellatan<tanmei2@huawei.com> # message auto-generated for no-merge-commit merge: !36703 merge torch_npu_init_refactor into master fix lazy_init and api export Created-by: bellatan Commit-by: bellatan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [ ] issue/工单 - [x] 重构优化 - [ ] 资料更新 # 【修改方案】 **问题1**:test/test_npu.py的test_lazy_init用例失败  **根因**: 重构前 torch_npu/__init__.py 中,先做 accelerator 冲突检查,即_check_device_conflict 接口调用,再 import torch_npu.npu、torch_npu.utils 等内部模块,不会触发 NPU device count 提前枚举 重构后 torch_npu/__init__.py 中,先调用了_check_device_conflict 接口,再 import torch_npu.npu、torch_npu.utils 等内部模块,_check_device_conflict 接口调用顺序被延后,调用 _get_accelerator() 时 NPU backend 状态已经被拉起,触发底层设备探测,导致 _npu_getDeviceCount() 提前枚举真实设备数 8。 **解决** : 在 torch_npu/__init__.py 中,保持和重构前一样的调用顺序,即_check_device_conflict 接口调用提前到所有的 import 之前。 **问题2**:缺失子模块导出的 API: python torch_npu.asd.checksum torch_npu.utils.syncbatchnorm **现象**:  **根因分析**: 旧版 torch_npu/__init__.py 是一个大顶层初始化脚本,里面直接写了很多顶层 import: python from torch_npu.asd.checksum import _matmul_checksum as matmul_checksum import torch_npu.utils.syncbatchnorm 这些 import 会产生父包属性挂载副作用: python torch_npu.asd.checksum torch_npu.utils.syncbatchnorm 重构后初始化逻辑被拆分到 _init/core/module_loader.py、_exports.py 等模块中,部分旧版顶层 import 副作用没有恢复,因此这些子模块路径在 import torch_npu 后不可见。 **解决方案**: 在 _load_registration_modules() 中补充子模块父包属性: python import torch_npu.asd.checksum # noqa: F401 import torch_npu.utils.syncbatchnorm # noqa: F401 **问题3**:顶层属性缺失 API python torch_npu.ParallelStore torch_npu._ShardedGradScaler **现象**:  **根因分析**: 旧版顶层有: python from torch_npu._C._distributed_c10d import ParallelStore from torch_npu.npu.amp.sharded_grad_scaler import _ShardedGradScaler 因此旧版支持: python torch_npu.ParallelStore torch_npu._ShardedGradScaler 重构后 _distributed_c10d 子模块初始化逻辑被集中到 C 扩展子模块初始化流程中,但没有把 ParallelStore 恢复到 torch_npu 顶层,导致旧版顶层访问路径缺失。_ShardedGradScaler 只在 distributed patch 逻辑中局部 import: python def _apply_sharded_grad_scaler_patch(torch): from torch.distributed.fsdp import sharded_grad_scaler from torch_npu.npu.amp.sharded_grad_scaler import _ShardedGradScaler sharded_grad_scaler.ShardedGradScaler = _ShardedGradScaler 这能保证 patch 行为一致,但没有恢复旧版顶层属性torch_npu._ShardedGradScaler **解决方案**: 在 _exports.py 中补 legacy 顶层属性: python def _export_distributed_apis(globals_dict): """ Export legacy distributed-related top-level APIs. Rule: - torch_npu._C._distributed_c10d.ParallelStore -> torch_npu.ParallelStore - torch_npu.npu.amp.sharded_grad_scaler._ShardedGradScaler -> torch_npu._ShardedGradScaler Note: These APIs are kept for compatibility and should not be added to __all__. """ from torch_npu._C._distributed_c10d import ParallelStore from torch_npu.npu.amp.sharded_grad_scaler import _ShardedGradScaler globals_dict["ParallelStore"] = ParallelStore globals_dict["_ShardedGradScaler"] = _ShardedGradScaler # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 test/test_torch_npu_init.py 新增对应的测试项本地验证pass,CI pass  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!36703 | 4 个月前 | |
| 1 年前 | ||
| 1 年前 |