| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[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 | 2 个月前 | |
[compat] remove get_CachingAutotuner, no longer used. Co-authored-by: chz34<chenhaozhe1@huawei.com> # message auto-generated for no-merge-commit merge: !42290 merge compat/inductor into master [compat] remove get_CachingAutotuner, no longer used. 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> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 https://gitcode.com/Ascend/pytorch/issues/3076 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) 原因是 CachingAutotuner仅在某个短暂的nightly版本移动到torch._inductor.triton_heuristics 中 正式版本中已移动回到 torch._inductor.runtime.triton_heuristics 最新的inductor逻辑重构后,这个get_CachingAutotuner接口已经不再需要没有地方引用,故直接移除。 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!42290 | 1 个月前 | |
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 个月前 | |
fix(inductor): triton_experimental UT fixes - npu_round + override list entries - npu_round: aten.round lowering - fall back to the handler for float64, else delegate to the upstream lowering. - GENERATE_LIST: add aten.remainder, aten.round; fix aten.glu trailing comma. - KEEP_UPSTREAM_LOWERING: keep _local_scalar_dense upstream lowering. | 28 天前 | |
feat: adapt FRACTAL_NZ D2H/printing and serialization UT for Ascend950 Co-authored-by: wuyouqi1<wuyouqi1@h-partners.com> # message auto-generated for no-merge-commit merge: !44320 merge feat/nz2nd-serialization-master into master feat: adapt FRACTAL_NZ D2H/printing and serialization UT for Ascend950 Created-by: wuyouqi1 Commit-by: wuyouqi1 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [ ] 问题单 - [x] issue/工单 https://gitcode.com/Ascend/pytorch/issues/2629 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 同步 #2629(A5/Ascend950 上 FRACTAL_NZ 私有格式 tensor 的 D2H、打印、序列化适配)至本分支,与 v2.7.1 实现(MR !40289)保持一致。本 PR 内容: 1. torch_npu/utils/tensor_methods.py:新增 _add_repr_patch()。私有格式(FRACTAL_NZ 系列)tensor 在 Tensor.__repr__ 中会命中 _tensor_str 内部格式守卫(cat/stack),导致打印/D2H 失败;patch 在私有格式时先 .cpu() 触发 D2H + format cast,再走原 __repr__。在 _add_tensor_methods() 末尾注册。 2. torch_npu/csrc/aten/common/FormatCastKernelNpu.cpp:IsAclnnOnly() 路径下,未显式指定 customize_dtype 时,对 element_size() >= 4 的类型(fp32/int32)将 customizeAcltype 默认置为 ACL_FLOAT16(C0=16),与 aclop 路径的历史行为对齐。 3. test/npu/test_serialization_format.py:新增 Ascend950 专属用例 TestSerializationFormatAscend950(受 @unittest.skipUnless(IS_ASCEND950, ...) 门控),覆盖 ND save/load、按 dtype 的 FRACTAL_NZ round-trip、NZ tensor D2H/repr/print;原 TestSerializationFormat 在 Ascend950 上跳过。 > 说明:本分支不含 v2.7.1 MR !40289 中的 __reduce_ex__ 序列化 patch(该 patch 在本分支不需要)。如该 patch 后续需要,将另行评估。 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 测试场景: - A2/A3(非 Ascend950):TestSerializationFormat 原用例照常执行,TestSerializationFormatAscend950 被 skipUnless(IS_ASCEND950) 跳过。 - A5/Ascend950:TestSerializationFormat 跳过,执行 TestSerializationFormatAscend950:fp16/bf16/int8/int32/int64 的 FRACTAL_NZ save/load round-trip 与 D2H/repr/print。 运行方式:python test/npu/test_serialization_format.py -v 新增/变更内容已适配 UT 用例(test_serialization_format.py)。本 PR 为跨版本同步,代码已验证在各目标分支干净 apply、无遗留依赖(不含 _reduce_ex__);具体执行结果以本分支 CI 流水线为准。 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 Fixes #2629 https://gitcode.com/Ascend/pytorch/issues/2629 See merge request: Ascend/pytorch!44320 | 29 天前 | |
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 个月前 | |
refactor: correct English grammar, spelling, and style in log/warning messages Co-authored-by: wanglijun55<wanglijun54@huawei.com> # message auto-generated for no-merge-commit merge: !44119 merge master-doc into master refactor: correct English grammar, spelling, and style in log/warning messages Created-by: wanglijun55 Commit-by: wanglijun55 Merged-by: ascend-robot Description: # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> https://gitcode.com/Ascend/pytorch/issues/3908 - [ ] 需求 - [ ] 问题单 - [ ] issue/工单 - [x] 重构优化 - [ ] 资料更新 # 【修改方案】 对 torch_npu 全仓 UserWarning / logger.warning / print 日志中的英文消息进行语法、拼写、标点审查和修复。共修复 48 处错误,涉及 39 个文件,涵盖以下类别: 1. **语法错误 (14处):** will not to be linked → will not be linked、should to be initialized → should be initialized、Create ... failed → Failed to create ... 等 2. **逗号拼接句 (8处):** 将逗号连接的两个独立句子拆分为两句或使用分号 3. **拼写错误 (1处):** Detecct_type → Detect_type 4. **缺少冠词 (7处):** in future version → in a future version、only sets Global variable → only sets the global variable 5. **主谓不一致 (5处):** Environment variable ... is not set → are not set、There is no ... events → There are no ... events 6. **标点/格式 (8处):** 中文顿号 、 → 英文逗号、多余空格、缺失句号、相邻字符串缺少空格拼接导致粘连 7. **翻译不当 (2处):** soft chain → symbolic link(软链接) 8. **冗余前缀 (2处):** warnings.warn() 中重复的 Warning: 前缀 9. **代码 Bug (1处):** serialization.py:672 — print() 传入 tuple 而非 string 10. **风格问题:** for replacement → as a replacement、Torchinductor → TorchInductor、Can not → Cannot、func/msg → function/message 等 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 仅修改日志/警告消息字符串,不影响任何功能逻辑。所有修改均为: - 英文语法/拼写/标点修正 - 字符串拼接 bug 修复(serialization.py tuple → string) - 翻译术语规范化(soft chain → symbolic link) # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!44119 | 1 个月前 | |
perf: defer dynamo and inductor imports on master Co-authored-by: stevenaw0<huangguijun@huawei.com> # message auto-generated for no-merge-commit merge: !44294 merge master_import_sync into master perf: defer dynamo and inductor imports on master Created-by: stevenaw0 Commit-by: stevenaw0 Merged-by: ascend-robot Description: ## 同步 v2.9.0_import 的 import 优化到 master ### 核心改动 将 NPU 的 Dynamo/Inductor 初始化从 import torch_npu 时立即执行改为**懒加载**: - import torch_npu 时不导入 torch._dynamo、torch._inductor、torch_npu._inductor - 仅在用户实际调用 torch.compile() 或触发 graph capture 时才初始化 Dynamo 集成 - 通过 setuptools entry points 和 meta_path finder 实现按需触发 - 支持并发首次调用、fork 后恢复、失败重试 ### 适配说明(master PyTorch 2.13+) - 保留 master 的 stream/event variable patches - 保留 make_config_entry 兼容封装(MIN_SUPPORTED >= 2.10) - 保留 master 的 _patch_flex_attention_device 和 _dump_snapshot - 合并懒加载基础设施与 master 的 new_init(name=None) 签名 ### 详见 master_syn.md 中的逐文件分类和冲突解决记录 See merge request: Ascend/pytorch!44294 | 1 个月前 | |
fix: fix getDefaultGenerator in NPUHooksInterface.h so that torch.accelerator.random APIs can use NPU backend Co-authored-by: dwoai22<oguzhan.nefesoglu@huawei.com> # message auto-generated for no-merge-commit merge: !44025 merge fix/get-generator into master fix: fix getDefaultGenerator in NPUHooksInterface.h so that torch.accelerator.random APIs can use NPU backend Created-by: dwoai22 Commit-by: dwoai22 Merged-by: ascend-robot Description: # 【合入来源】 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 关联 issue:https://gitcode.com/Ascend/pytorch/issues/3809 Fixes #3809 # 【修改方案】 1. torch_npu/csrc/core/npu/NPUHooksInterface.h 中 getDefaultGenerator 补充尾置 const 与 override,与基类 at::AcceleratorHooksInterface::getDefaultGenerator(c10::DeviceIndex) const 对齐。原实现缺少尾置 const,在 C++ 中构成隐藏(shadow)而非覆写(override); 且 at::Context::getAcceleratorHooksInterface 返回 const AcceleratorHooksInterface&,非 const 成员函数在该调用点不可调用,虚函数 分发最终落到基类 at::PrivateUse1HooksInterface::getDefaultGenerator (实现为 FAIL_PRIVATEUSE1HOOKS_FUNC),抛出 NotImplementedError。补充 override 后,上游基类签名若再次变更将直接编译失败,避免同类问题再次静默发生。 2. 补充默认参数 = -1,与基类默认值保持一致,无参调用回退到当前设备。 3. 删除函数内 static auto device_gen 缓存。函数内 static 仅在首次调用时初始化, 后续调用忽略 device_index,恒返回首次调用对应的 Generator。该缺陷此前因问题 1 不可达;仅修复问题 1 会使其立即生效,导致 manual_seed_all / seed_all / get_rng_state_all / set_rng_state_all 静默退化为只操作 device 0,因此两处需 一并修复。 4. test/npu/test_npu.py 新增 2 个 UT,详见【功能验证】。 本 PR 不改变 torch.npu.* 的任何行为,相关 API 仍走 torch.npu.default_generators 路径。 # 【资料变更】 不涉及。 # 【接口变更】 torch_npu 对外 Python API 无新增、修改或删除。 # 【功能验证】 **新增 UT**(test/npu/test_npu.py) - test_accelerator_get_default_generator:通过其中一个入口设置种子、从另一个入口 读回,验证 torch._C._accelerator_getDefaultGenerator(0) 与 torch.npu.default_generators[0] 为同一个 Generator。修改前该用例抛 NotImplementedError。用例会保存并恢复 RNG 状态。 - test_accelerator_get_default_generator_per_device:对每张卡通过 accelerator 入口 设置不同种子并逐一读回,看护第 3 项 static 缺陷。需要 ≥2 卡,单卡环境自动 skip。 **测试方法** bash # 新增用例 pytest ./npu/test_npu.py -k "test_accelerator_get_default_generator or test_accelerator_get_default_generator_per_device" lintrunner -a **修改前 / 修改后** ``python >>> import torch, torch_npu >>> torch.accelerator.random.initial_seed() NotImplementedError: You should register PrivateUse1HooksInterface ... >>> import torch, torch_npu >>> torch.accelerator.random.initial_seed() 1029742135505983 `` 测试环境:torch: main, torch_npu: master,CANN 9.0.0,2 x 910B3。 # 【CheckList】 - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR 标题正确使用类型标签,如:feat、fix、refactor、docs、test 等 - [ ] PR 持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!44025 | 28 天前 | |
fix: PTA_Feature_pipelining_UT_stage failed in A5 Co-authored-by: Chansinging<1183520536@qq.com> # message auto-generated for no-merge-commit merge: !43747 merge fix_pipelining_cxy into master fix: PTA_Feature_pipelining_UT_stage failed in A5 Created-by: chansinging Commit-by: Chansinging Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 由于950pr机器不在 elif device.type == "npu"的用户名单内,导致走了else分支,分支内没有_ProcessGroupWrapper是接口导致的报错。然后对后端对象解包进行修改,通过修改 _group 的获取与调用逻辑,在拿到 _group 后判断其类型,若为 _ProcessGroupWrapper,通过 .wrapped_pg 访问解包出底层的真实 ProcessGroupHCCL 对象,再调用 batch_isend_irecv 接口。 两个test用例修改是为了跑通ci流水线,解决历史遗留问题 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 失败用例测试通过    # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!43747 | 1 个月前 | |
perf: defer dynamo and inductor imports on master Co-authored-by: stevenaw0<huangguijun@huawei.com> # message auto-generated for no-merge-commit merge: !44294 merge master_import_sync into master perf: defer dynamo and inductor imports on master Created-by: stevenaw0 Commit-by: stevenaw0 Merged-by: ascend-robot Description: ## 同步 v2.9.0_import 的 import 优化到 master ### 核心改动 将 NPU 的 Dynamo/Inductor 初始化从 import torch_npu 时立即执行改为**懒加载**: - import torch_npu 时不导入 torch._dynamo、torch._inductor、torch_npu._inductor - 仅在用户实际调用 torch.compile() 或触发 graph capture 时才初始化 Dynamo 集成 - 通过 setuptools entry points 和 meta_path finder 实现按需触发 - 支持并发首次调用、fork 后恢复、失败重试 ### 适配说明(master PyTorch 2.13+) - 保留 master 的 stream/event variable patches - 保留 make_config_entry 兼容封装(MIN_SUPPORTED >= 2.10) - 保留 master 的 _patch_flex_attention_device 和 _dump_snapshot - 合并懒加载基础设施与 master 的 new_init(name=None) 签名 ### 详见 master_syn.md 中的逐文件分类和冲突解决记录 See merge request: Ascend/pytorch!44294 | 1 个月前 | |
[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 | 3 个月前 | |
compat(v2.13) : Update master to upstream 0610, adapt the upstream to remove NamedTensor. Co-authored-by: chz34<chenhaozhe1@huawei.com> # message auto-generated for no-merge-commit merge: !39675 merge compat/master into master compat(v2.13) : Update master to upstream 0610, adapt the upstream to remove NamedTensor. 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> - [ ] 需求 - [x] 问题单 https://gitcode.com/ascend/pytorch/issues/2325 - [ ] issue/工单 - [x] 重构优化 https://gitcode.com/Ascend/pytorch/issues/2569 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) PyTorch 2.13 removed named-tensor support entirely (at::Dimname, at::DimnameList, the at::namedinference namespace and the header ATen/NamedTensorUtils.h). Remove all corresponding interface. # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!39675 | 2 个月前 | |
perf: defer dynamo and inductor imports on master Co-authored-by: stevenaw0<huangguijun@huawei.com> # message auto-generated for no-merge-commit merge: !44294 merge master_import_sync into master perf: defer dynamo and inductor imports on master Created-by: stevenaw0 Commit-by: stevenaw0 Merged-by: ascend-robot Description: ## 同步 v2.9.0_import 的 import 优化到 master ### 核心改动 将 NPU 的 Dynamo/Inductor 初始化从 import torch_npu 时立即执行改为**懒加载**: - import torch_npu 时不导入 torch._dynamo、torch._inductor、torch_npu._inductor - 仅在用户实际调用 torch.compile() 或触发 graph capture 时才初始化 Dynamo 集成 - 通过 setuptools entry points 和 meta_path finder 实现按需触发 - 支持并发首次调用、fork 后恢复、失败重试 ### 适配说明(master PyTorch 2.13+) - 保留 master 的 stream/event variable patches - 保留 make_config_entry 兼容封装(MIN_SUPPORTED >= 2.10) - 保留 master 的 _patch_flex_attention_device 和 _dump_snapshot - 合并懒加载基础设施与 master 的 new_init(name=None) 签名 ### 详见 master_syn.md 中的逐文件分类和冲突解决记录 See merge request: Ascend/pytorch!44294 | 1 个月前 | |
[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 | 5 个月前 | |
[optim] Add distributed Muon optimizer support for Ascend NPU Co-authored-by: guoqi1024<guoqi5@huawei.com> # message auto-generated for no-merge-commit merge: !38393 merge feature/distributed-muon-optimizer into master [optim] Add distributed Muon optimizer support for Ascend NPU Created-by: guoqi1024 Commit-by: guoqi1024 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/2403 - [x] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!38393 | 2 个月前 | |
Add support of Execution Trace Observer object to torch_npu profiler (based on acl_prof). Co-authored-by: ilya_a<abanin.ilya@huawei.com> # message auto-generated for no-merge-commit merge: !43983 merge add_execution_trace_observer_support into master Add support of Execution Trace Observer object to torch_npu profiler (based on acl_prof). Created-by: ilya_a Commit-by: ilya_a Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 Re-used existing PyTorch Execution Trace Observer object with torch_npu profiler (based on acl_prof). Migrated relevant unit tests from original PyTorch test_execution_trace.py # 【资料变更】 New parameter is added to npu_profiler - execution_trace_observer. Execution Trace Observer implementation with torch_npu profiler must work the same way as with PyTorch community profiler. # 【接口变更】 New parameter is added to npu_profiler - execution_trace_observer. execution_trace_observer (ExecutionTraceObserver) : A PyTorch Execution Trace Observer object. PyTorch Execution Traces <https://arxiv.org/pdf/2305.14516.pdf>__ offer a graph based representation of AI/ML workloads and enable replay benchmarks, simulators, and emulators. When this argument is included the observer start() and stop() will be called for the same time window as npu_profiler. It is the same Execution Trace Observer as the one used by PyTorch community profiler. # 【功能验证】 Build, install, run: export MAX_JOBS=2 TORCH_DEVICE_BACKEND_AUTOLOAD=0 bash ci/build.sh --python=3.11 pip install --no-deps --force-reinstall dist/torch_npu-*.whl ASCEND_LAUNCH_BLOCKING=1 pytest -s test_npu_execution_trace.py # Test results  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!43983 | 29 天前 | |
compat(2.14): default requirements to 2.14 nightly and fix related tests Co-authored-by: chz34<chenhaozhe1@huawei.com> # message auto-generated for no-merge-commit merge: !41741 merge compat/2.14 into master compat(2.14): default requirements to 2.14 nightly and fix related tests 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> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 https://gitcode.com/Ascend/pytorch/issues/2258 https://gitcode.com/Ascend/pytorch/issues/2890 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) 1. 上游新增接口,暴露的路径与实际module不一致,实际来自_C库,添加测试白名单,与上游添加的白名单保持一致。 2. 上游新增接口,依赖额外三方库与cuda库,test_public_binding.py中增加相关过滤 3. 上游 Backedn.register_backend.__func__新增参数,修改对应patch函数,增加**kwargs,缺省忽略,同时保持与之前版本的接口兼容 4. 上游cudagraphify调用时新增额外参数kernel_free_cudagraph, user_visible_output_idxs,下游npugraphify跟随新增,函数内不处理 5. 新增requirements_2_13.txt的配置,默认配置升级到2.14 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 跟随上游变更,不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 跟随上游变更,不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 跟随上游变更,基于现有测试用例进行验证 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!41741 | 1 个月前 | |
perf: defer dynamo and inductor imports on master Co-authored-by: stevenaw0<huangguijun@huawei.com> # message auto-generated for no-merge-commit merge: !44294 merge master_import_sync into master perf: defer dynamo and inductor imports on master Created-by: stevenaw0 Commit-by: stevenaw0 Merged-by: ascend-robot Description: ## 同步 v2.9.0_import 的 import 优化到 master ### 核心改动 将 NPU 的 Dynamo/Inductor 初始化从 import torch_npu 时立即执行改为**懒加载**: - import torch_npu 时不导入 torch._dynamo、torch._inductor、torch_npu._inductor - 仅在用户实际调用 torch.compile() 或触发 graph capture 时才初始化 Dynamo 集成 - 通过 setuptools entry points 和 meta_path finder 实现按需触发 - 支持并发首次调用、fork 后恢复、失败重试 ### 适配说明(master PyTorch 2.13+) - 保留 master 的 stream/event variable patches - 保留 make_config_entry 兼容封装(MIN_SUPPORTED >= 2.10) - 保留 master 的 _patch_flex_attention_device 和 _dump_snapshot - 合并懒加载基础设施与 master 的 new_init(name=None) 签名 ### 详见 master_syn.md 中的逐文件分类和冲突解决记录 See merge request: Ascend/pytorch!44294 | 1 个月前 | |
[sync] PR-39678: revert: detect Ascend950 SoC for TORCH_NPU_USE_COMPATIBLE_IMPL default Co-authored-by: wuyouqi1<wuyouqi1@h-partners.com> # message auto-generated for no-merge-commit merge: !39703 merge sync-pr39678-revert/compat-impl-socname-routing-26.1.0-to-master into master [sync] PR-39678: revert: detect Ascend950 SoC for TORCH_NPU_USE_COMPATIBLE_IMPL default Created-by: ascend-ds-bot Commit-by: wuyouqi1 Merged-by: ascend-robot Description: ### 1. Origin pull request: https://gitcode.com/Ascend/pytorch/merge_requests/39678 ### 2. Original pull request related issue(s): https://gitcode.com/Ascend/pytorch/issues/2561 ### 3. Original pull request related commit(s): | Sha | Datetime | Message | |---|---|---| |[8539c290](https://gitcode.com/Ascend/pytorch/commit/8539c290bd0035b66335b3e92ac28540de8c2805)|2026-06-30 21:08:41 +0800 CST|Revert "feat: detect Ascend950 SoC for TORCH_NPU_USE_COMPATIBLE_IMPL default"<br><br>This reverts commit acebf35339791ea6fcac6f116acdb242a1c09096.<br><br>Removes the _is_ascend950() SoC auto-detection and the SoC-based default-value assignment for TORCH_NPU_USE_COMPATIBLE_IMPL in torch_npu/__init__.py, and drops test_compatible_impl_soc_detect.py.<br><br>Co-Authored-By: Claude <noreply@anthropic.com><br>| See merge request: Ascend/pytorch!39703 | 2 个月前 | |
| 1 年前 | ||
| 1 年前 |