| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix: resolve memory leak issue during recompute forward in context parallel attention Co-authored-by: pengjingyou<pengjingyou@huawei.com> # message auto-generated for no-merge-commit merge: !39895 merge fix_cp_memory_leak_v2.10.0 into v2.10.0 fix: resolve memory leak issue during recompute forward in context parallel attention Created-by: pengjingyou Commit-by: pengjingyou Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 _npu_fa_v3_handler(): python _step_cache_stack.append( (step_caches, is_causal, attn_output.detach(), merged_lse.detach()) ) _npu_fa_grad_v3_handler(): python step_caches, is_causal, merged_out, merged_lse = stack.pop() 这个设计需要保证 forward 和 backward 严格 1:1:每 push 一次,必须有且仅有一次对应的 backward pop。 但重计算场景下,forward 和 backward 2:1,导致全局变量_step_cache_stack 存在内存泄漏 用 torch._C._current_graph_task_id() 标记 recompute,修复全局变量 _step_cache_stack 的push/pop平衡 在保存forward中间结果时,进行是否为重计算的判断,如果当前执行的是recompute forward,则不需要执行push操作 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” # 【功能验证】 执行训练任务,开启cp和重计算,内存占用稳定:  context_parallel ut结果:  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!39895 | 1 个月前 | |
perf: defer dynamo and inductor imports on v2.10.0 (#2788) Co-authored-by: stevenaw0<huangguijun@huawei.com> # message auto-generated for no-merge-commit merge: !44372 merge import_opt_pr2_v2.10.0 into v2.10.0 perf: defer dynamo and inductor imports on v2.10.0 (#2788) Created-by: stevenaw0 Commit-by: stevenaw0 Merged-by: ascend-robot Description: # 【合入来源】 > 同步 v2.9.0_import 分支的 import 优化 PR (#2788),commit 范围 8fe9dbf643..e00227b824(19个commit) - [x] 重构优化 # 【修改方案】 > 将 torch._dynamo 和 torch._inductor 的导入延迟到首次 torch.compile 调用,减少 torch_npu 导入时间。 1. 从 registry_manager._register_components() 中移除 _register_dynamo(),改为延迟注册 2. 在 _dynamo.py 中实现 lazy setup 机制:_lazy_dynamo_setup / _lazy_inductor_setup / _setup_inductor_for_compile 3. 在 setup.py 中注册 torch_dynamo_backends entry points(npu / npugraph_ex / npugraphs) 4. 在 dynamo/__init__.py 中新增 entry point callable 和 _NpugraphsBackendEntryPoint 5. 将 npugraph_ex、npugraphs、deterministic 等模块改为 lazy import 6. 新增 _graph_tree_state.py 轻量状态模块,分离 mark_step_begin 状态 7. 清理 erfc decomposition 注册前重复 ## v2.10.0 适配(Adapted) - EventVariable 在 PyTorch 2.10 中从 ctx_manager 移至 streams 模块 - 移除 patch_variable_builder:PyTorch 2.10 原生 VariableBuilder._wrap 已处理 torch.Event(含 npu 子类) - 保留 v2.10.0 独有的 patch_npu_stream_context 和 apply_dataclass_with_cached_hash_patch - 保留 v2.10.0 独有的 aten.addmm 和 aten.repeat_interleave decomposition # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 - test/dynamo/test_compile_trigger.py: 21 passed, 1 skipped (onnxscript 未安装) - test/test_torch_npu_init.py: 15 passed - test/_inductor/test_current_device.py: 1 passed - 验证环境: conda torch-npu-2.10.0-py311 - test_mlir_enable.py 失败为 MLIR 后端已有问题(_module_lowering API mismatch),非本次改动引入 # 【CheckList】 - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!44372 | 13 天前 | |
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !36365 merge v2.10.0_lintrunner into v2.10.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!36365 | 3 个月前 | |
register strategy for npu_grouped_matmul Co-authored-by: jizewei<jizewei@huawei.com> # message auto-generated for no-merge-commit merge: !28932 merge master_gmm_strategy into master register strategy for npu_grouped_matmul Created-by: jizewei Commit-by: jizewei Merged-by: ascend-robot Description: <!-- Thanks for sending a pull request! --> **What type of PR is this?** > Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line: > > /kind bug > /kind task > /kind feature /kind feature **What does this PR do / why do we need it**: register strategy for npu_grouped_matmul **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!28932 | 7 个月前 | |
[fix] register strategy for npu_fusion_attention Co-authored-by: jizewei<jizewei@huawei.com> # message auto-generated for no-merge-commit merge: !27780 merge master_fusion_attention_strategy into master fix sharding strategy for npu_fusion_attention Created-by: jizewei Commit-by: jizewei Merged-by: ascend-robot Description: <!-- Thanks for sending a pull request! --> **What type of PR is this?** > Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line: > > /kind bug > /kind task > /kind feature /kind bug **What does this PR do / why do we need it**: fix npu_fusion_attention strategy: 1. <https://github.com/pytorch/pytorch/pull/168249> supports register_sharding for operation with Tensor kwargs. Apply a patch for previous pytorch version. 2. The previous strategy followed query's placements, which may lead to inconsistent results compared single-device computation if sharing the dim of S/D. The new strategy focuses on SDPA scenario and supports DP/TP. 3. For TP, the head dim of qkv local tensors does not match the head_num arg, so head_num needs to be reset before local computation. 4. For npu_fusion_attention_backward, redistribution handling of DTensors in kwargs is added(official pytorch ops rarely have Tensor in kwargs, so most DTensor processing only considers args and ignores kwargs). **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!27780 | 8 个月前 | |
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !36365 merge v2.10.0_lintrunner into v2.10.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!36365 | 3 个月前 | |
refactor dtensor rules Co-authored-by: kisnwang<wangkaisheng2@huawei.com> # message auto-generated for no-merge-commit merge: !34586 merge v2.10.0 into v2.10.0 refactor dtensor rules Created-by: kisnwang Commit-by: kisnwang Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [ ] issue/工单 - [x] 重构优化 [#1743](https://gitcode.com/Ascend/pytorch/issues/1743) - [ ] 资料更新 # 【修改方案】 自定义算子注册与社区对齐,删除utils/dtensor.py # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 适配UT测试用例看护 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!34586 | 3 个月前 | |
[sync] PR-40312: Update moe token unpermute DTensor support Co-authored-by: shawnylee233<lixiangyi1@huawei.com> # message auto-generated for no-merge-commit merge: !42531 merge sync-pr40312-feature/moe_token_permute_memory_opt-to-v2.10.0 into v2.10.0 [sync] PR-40312: Update moe token unpermute DTensor support Created-by: ascend-ds-bot Commit-by: shawnylee233 Merged-by: ascend-robot Description: ### 1. Origin pull request: https://gitcode.com/Ascend/pytorch/merge_requests/40312 ### 2. Original pull request related issue(s): https://gitcode.com/Ascend/pytorch/issues/3108 ### 3. Original pull request related commit(s): | Sha | Datetime | Message | |---|---|---| |[fc5ecd2f](https://gitcode.com/Ascend/pytorch/commit/fc5ecd2f0f2456827110f8f0a635d9cb51668594)|2026-07-16 09:43:21 +0800 CST|Update moe token unpermute DTensor support<br>| See merge request: Ascend/pytorch!42531 | 1 个月前 | |
refactor dtensor rules Co-authored-by: kisnwang<wangkaisheng2@huawei.com> # message auto-generated for no-merge-commit merge: !34586 merge v2.10.0 into v2.10.0 refactor dtensor rules Created-by: kisnwang Commit-by: kisnwang Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [ ] issue/工单 - [x] 重构优化 [#1743](https://gitcode.com/Ascend/pytorch/issues/1743) - [ ] 资料更新 # 【修改方案】 自定义算子注册与社区对齐,删除utils/dtensor.py # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 适配UT测试用例看护 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!34586 | 3 个月前 | |
modify test case Co-authored-by: pta-robot<pta_robot@163.com> Co-authored-by: gcw_Dgfy2aKk<dujunjie2@huawei.com> # message auto-generated for no-merge-commit merge: !29184 merge correct_testcase_260107 into master modify test case Created-by: gcw_Dgfy2aKk Commit-by: gcw_Dgfy2aKk;pta-robot Merged-by: ascend-robot Description: <!-- Thanks for sending a pull request! --> **What type of PR is this?** > Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line: > > /kind bug > /kind task > /kind feature **What does this PR do / why do we need it**: **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!29184 | 7 个月前 | |
refactor dtensor rules Co-authored-by: kisnwang<wangkaisheng2@huawei.com> # message auto-generated for no-merge-commit merge: !34586 merge v2.10.0 into v2.10.0 refactor dtensor rules Created-by: kisnwang Commit-by: kisnwang Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [ ] issue/工单 - [x] 重构优化 [#1743](https://gitcode.com/Ascend/pytorch/issues/1743) - [ ] 资料更新 # 【修改方案】 自定义算子注册与社区对齐,删除utils/dtensor.py # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 适配UT测试用例看护 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!34586 | 3 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 个月前 | ||
| 13 天前 | ||
| 3 个月前 | ||
| 7 个月前 | ||
| 8 个月前 | ||
| 3 个月前 | ||
| 3 个月前 | ||
| 1 个月前 | ||
| 3 个月前 | ||
| 7 个月前 | ||
| 3 个月前 |