| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
reduce scatter support tensorlist.size != world_size Co-authored-by: limuan<liyijie16@huawei.com> # message auto-generated for no-merge-commit merge: !44440 merge reduce_scatter_v2.7.1 into v2.7.1 reduce scatter support tensorlist.size != world_size Created-by: limuan Commit-by: limuan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 本提案修改 torch_npu 的 ProcessGroupHCCL::reduce_scatter,使其输入支持范围与 PyTorch 社区(NCCL)保持一致。 PyTorch 2.2 的 reduce_scatter 对输入张量列表有形状/计数约束(列表长度须等于 world_size、每张量 numel 须等于输出 numel 等),2.3 起去除了这些约束。pta(torch_npu)当前的 reduce_scatter 与 PyTorch 2.2 实现一致:输入是 tensor list,包含多个 tensor,数量与卡数一致。这与社区后续版本不一致,需要兼容输入只有一个 tensor 的场景等用例,和社区保持一致。 核心改动:在 reduce_scatter 的 same_size 分支新增展平函数 flatten_for_reduce_scatter,替代原先复用的 flatten_for_scatter_gather——移除"输入张量数须等于 world_size""每张量 numel 须等于输出 numel"两条校验,保留列表长度一致与 input/output 同设备校验,并新增非空检查。Python 层 torch.distributed.reduce_scatter 签名不变。) # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 1、基础功能验证:执行test_reduce_scatter.py用例  2、dtype*op*tensorshape(1D,2D)*input_tensor_list.size(==,>,< world_size)*all_input_numbel(==, >, < )all_output_numbel reduce_scatter 全耦合输入,reduce_scatter算子输出与gpu结果对比  3、性能验证,修改前后pta调用reduce_scatter,用时基本无变化  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!44440 | 4 天前 | |
| 2 年前 | ||
refactor dtensor rules Co-authored-by: kisnwang<wangkaisheng2@huawei.com> # message auto-generated for no-merge-commit merge: !34589 merge v2.7.1 into v2.7.1 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!34589 | 3 个月前 | |
test: Since the PyTorch community's test cases do not provide full coverage, we adopt the method of adding new test cases to supplement and cover all test case scenarios. Co-authored-by: xin_heyun<919112805@qq.com> # message auto-generated for no-merge-commit merge: !42824 merge test_allreduce_hook_v2.7.1 into v2.7.1 test: Since the PyTorch community's test cases do not provide full coverage, we adopt the method of adding new test cases to supplement and cover all test case scenarios. Created-by: xin_heyun Commit-by: xin_heyun Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> 社区任务issue地址:https://gitcode.com/Ascend/pytorch/issues/3129 issue分析报告地址:https://gitcode.com/Ascend/pytorch/issues/3364 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) 1. 新增 test/distributed/algorithms/ddp_comm_hooks/test_allreduce_hook.py 独立测试文件和 TestAllreduceHook 测试类。测试通过 torch.accelerator.current_accelerator() 获取设备类型,将参与运算的张量迁移到 NPU,并使用 HCCL、动态空闲端口和显式进程组清理完成分布式验证。 2. 新增 12 个测试方法,验证 torch.distributed.algorithms.ddp_comm_hooks.default_hooks.allreduce_hook 的基础 DDP 梯度一致性、gradient_as_bucket_view、static_graph、两者组合、process_group=None、注册辅助接口、自定义子进程组和多 bucket 场景。 3. 验证 torch.float32、torch.float16、torch.bfloat16 的平均结果、shape、dtype、NPU设备和 torch._C.Future 返回契约,并覆盖 FP16 溢出边界、单 rank HCCL 正常调用以及缺少参数、空 bucket、非法进程组等异常场景。 4. 对统一启动双进程测试的 _spawn helper 应用 skipIfUnsupportMultiNPU(WORLD_SIZE)。少于两张 NPU时跳过依赖双进程的 10 个测试,继续执行单 NPU契约和异常参数测试;具备至少两张 NPU时执行全部 12 个测试,避免 rank 1 使用非法设备索引。 5. PyTorch 社区相关覆盖主要集中于 CUDA/NCCL,并包含 wrapper 和 ZeRO overlap 等组合调用。新增独立测试用于补齐 HCCL/NPU 下的输入、返回契约、边界值、组合配置、异常参数和单设备执行覆盖,为该 API 的 NPU行为提供回归保护。 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 不涉及。API 本身已经适配,master/docs/zh/api/native_api 目录文档已经记录,无需资料变更。 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及。本次仅新增测试用例,不调整 torch.distributed.algorithms.ddp_comm_hooks.default_hooks.allreduce_hook 的实现或对外接口。 # 【功能验证】 ## v2.7.1 执行命令: bash python test/distributed/algorithms/ddp_comm_hooks/test_allreduce_hook.py -v 结果: text test_allreduce_hook ... ok test_allreduce_hook_custom_subgroup ... ok test_allreduce_hook_future_and_dtypes ... ok test_allreduce_hook_grad_is_view ... ok test_allreduce_hook_grad_is_view_static_graph ... ok test_allreduce_hook_invalid_arguments ... ok test_allreduce_hook_multiple_buckets ... ok test_allreduce_hook_none_pg ... ok test_allreduce_hook_overflow_boundary ... ok test_allreduce_hook_registration_helper ... ok test_allreduce_hook_single_npu_contract ... ok test_allreduce_hook_static_graph ... ok ---------------------------------------------------------------------- Ran 12 tests in 162.849s OK ## v2.11.0 执行命令: bash python test/distributed/algorithms/ddp_comm_hooks/test_allreduce_hook.py -v 结果: text test_allreduce_hook ... ok test_allreduce_hook_custom_subgroup ... ok test_allreduce_hook_future_and_dtypes ... ok test_allreduce_hook_grad_is_view ... ok test_allreduce_hook_grad_is_view_static_graph ... ok test_allreduce_hook_invalid_arguments ... ok test_allreduce_hook_multiple_buckets ... ok test_allreduce_hook_none_pg ... ok test_allreduce_hook_overflow_boundary ... ok test_allreduce_hook_registration_helper ... ok test_allreduce_hook_single_npu_contract ... ok test_allreduce_hook_static_graph ... ok ---------------------------------------------------------------------- Ran 12 tests in 163.894s OK ## v2.12.0 执行命令: bash python test/distributed/algorithms/ddp_comm_hooks/test_allreduce_hook.py -v 结果: text test_allreduce_hook ... ok test_allreduce_hook_custom_subgroup ... ok test_allreduce_hook_future_and_dtypes ... ok test_allreduce_hook_grad_is_view ... ok test_allreduce_hook_grad_is_view_static_graph ... ok test_allreduce_hook_invalid_arguments ... ok test_allreduce_hook_multiple_buckets ... ok test_allreduce_hook_none_pg ... ok test_allreduce_hook_overflow_boundary ... ok test_allreduce_hook_registration_helper ... ok test_allreduce_hook_single_npu_contract ... ok test_allreduce_hook_static_graph ... ok ---------------------------------------------------------------------- Ran 12 tests in 163.101s OK ## master 执行命令: bash python test/distributed/algorithms/ddp_comm_hooks/test_allreduce_hook.py -v 结果: text test_allreduce_hook ... ok test_allreduce_hook_custom_subgroup ... ok test_allreduce_hook_future_and_dtypes ... ok test_allreduce_hook_grad_is_view ... ok test_allreduce_hook_grad_is_view_static_graph ... ok test_allreduce_hook_invalid_arguments ... ok test_allreduce_hook_multiple_buckets ... ok test_allreduce_hook_none_pg ... ok test_allreduce_hook_overflow_boundary ... ok test_allreduce_hook_registration_helper ... ok test_allreduce_hook_single_npu_contract ... ok test_allreduce_hook_static_graph ... ok ---------------------------------------------------------------------- Ran 12 tests in 148.368s OK # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!42824 | 13 天前 | |
[v2.7.1] test: add test cases for _write_item Co-authored-by: huowentan<3294682143@qq.com> # message auto-generated for no-merge-commit merge: !42894 merge api-write-item-v2.7.1 into v2.7.1 [v2.7.1] test: add test cases for _write_item Created-by: 2501_93637465 Commit-by: huowentan Merged-by: ascend-robot Description: # 【合入来源】 任务来源:https://gitcode.com/Ascend/pytorch/issues/3148 关联 Issue:https://gitcode.com/Ascend/pytorch/issues/3148 Fixes #3148 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 API: torch.distributed.checkpoint.filesystem._write_item 目标分支:v2.7.1 # 【修改方案】 经检索,PyTorch 社区现有用例缺少对 torch.distributed.checkpoint.filesystem._write_item 的独立、充分验证,因此新增测试文件: test/distributed/checkpoint/test_write_item.py 测试覆盖: - BytesIO 基本数据、空数据和大数据写入; - Tensor 基本写入; - float32、int64 和 bool Tensor; - 二维 Tensor 和标量 Tensor; - 多个写入项连续写入; - Tensor 与 BytesIO 混合连续写入; - stream 写入内容验证; - WriteResult 的 index、size、offset、length 和 storage key; - _StorageInfo 属性验证; - 不同 PyTorch 版本 _write_item 签名的兼容调用。 该 API 的 Tensor 写入路径要求输入数据位于 CPU,并通过 torch.save 写入文件流。传入 NPU Tensor 会违反该接口的 data.device == cpu 约束, 因此本测试按照接口定义使用 CPU Tensor,不进行 NPU Tensor 迁移。 # 【资料变更】 torch.distributed.checkpoint.filesystem._write_item 是 PyTorch 私有接口。 根据 API 一致性任务指南,私有接口无需补充 docs/zh/api/native_api 支持资料,因此本 PR 不涉及资料变更。 # 【接口变更】 不涉及接口定义或功能实现变更,仅新增 API 一致性测试。 # 【功能验证】 | 测试项 | 结果 | | --- | --- | | test/distributed/checkpoint/test_write_item.py | PASS | | 13 个测试用例 | PASS | | python -m py_compile | PASS | | git diff --check | PASS | | PR CI 流水线 | PASS | 测试结果: text ---------------------------------------------------------------------- Ran 13 tests OK # 【CheckList】 - [x] 使用完整 API 名称 - [x] 新增文件包含 Huawei copyright - [x] 新增文件包含模块 docstring - [x] 使用 TestCase、run_tests 和 self.assert* - [x] CPU Tensor 使用符合 _write_item 接口约束 - [x] 不包含 print、try-except 或 import torch_npu - [x] 当前分支仅包含一个提交 - [x] CLA 和 CI 检查通过 See merge request: Ascend/pytorch!42894 | 3 天前 | |
test: add put_metric coverage Co-authored-by: lgxxx<22515063@zju.edu.cn> # message auto-generated for no-merge-commit merge: !42800 merge test-put-metric-v2.7.1 into v2.7.1 test: add put_metric coverage Created-by: lgxxx Commit-by: lgxxx Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 https://gitcode.com/Ascend/pytorch/issues/3216 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 ## API 与交付结论 - API: torch.distributed.elastic.metrics.put_metric。 - 分类:1.3。PyTorch 官方没有直接验证 put_metric 处理结果的测试。 - 交付方式:扩展 torch-npu 现有 test/distributed/elastic/metrics/test_metrics_api.py。 - API 实现:不修改。 - test_upstream patch:不涉及。 - NPU 适配:不需要设备装饰器或 NPU Tensor。put_metric 是纯 Python、非计算类指标接口。 - 资料 PR:不涉及。2.7.1、2.9.0、2.10.0、2.11.0、2.12.0 条目均已存在且支持状态为“是,暂不支持 Ascend 950DT”。 ## 分支 | 目标分支 | Fork 源分支 | | --- | --- | | v2.7.1 | test-put-metric-v2.7.1 | | v2.11.0 | test-put-metric-v2.11.0 | | v2.12.0 | test-put-metric-v2.12.0 | | master | test-put-metric-master | 任务书 Issue:Ascend/pytorch#3216。四个目标分支的 PR 均关联该 Issue。 ## 官方用例调查 PyTorch 官方存在 test/distributed/elastic/metrics/api_test.py,但现有用例只覆盖 MetricHandler、MetricStream、prof 等行为,没有直接调用并验证 put_metric 的处理器结果。 另有 test/distributed/elastic/agent/server/test/api.py 通过 mock 间接验证 put_metric 被调用,但不验证 put_metric 的默认 metric_group、自定义 metric_group、metric_name、metric_value 或实际 MetricData。 因此需要在 torch-npu 现有 metrics 测试文件中新增直接行为用例,属于场景 1.3。 ## 修改内容 新增 test_put_metric,覆盖: 1. 不传 metric_group 时使用默认 torchelastic 组。 2. 传入 custom_group 时使用自定义处理器。 3. 非空 metric_name、空 metric_name。 4. 正值、0 和负值 metric_value。 5. handler 实际收到 MetricData,验证 group_name、name、value 和 timestamp。 6. 依赖现有 setUp/addCleanup 恢复全局默认 handler 和 metrics map。 修改文件: test/distributed/elastic/metrics/test_metrics_api.py # 【资料变更】 已检查 master 分支下以下资料条目: docs/zh/api/native_api/pytorch_2-7-1/torch-distributed-elastic.md docs/zh/api/native_api/pytorch_2-9-0/torch-distributed-elastic.md docs/zh/api/native_api/pytorch_2-10-0/torch-distributed-elastic.md docs/zh/api/native_api/pytorch_2-11-0/torch-distributed-elastic.md docs/zh/api/native_api/pytorch_2-12-0/torch-distributed-elastic.md 五个版本均已有 torch.distributed.elastic.metrics.put_metric 条目,支持状态一致为“是,暂不支持 Ascend 950DT”,因此不创建无意义资料 PR。该 API 为非计算类接口,资料中不涉及数据类型支持。 # 【接口变更】 不涉及。本次不修改 PyTorch API 实现、函数签名、返回类型或跨仓接口,只新增直接测试覆盖。 # 【功能验证】 ## 本地验证环境 - 主机平台:Linux-5.10.0-216.0.0.115.oe2203sp4.aarch64-aarch64-with-glibc2.35 - Python:3.11.15 - CANN:9.1.0.beta1 - NPU:Ascend910_9382 - 可见设备数:1(物理 NPU 0) - v2.7.1:torch 2.7.1+cpu,torch-npu 2.7.1.post4 - v2.11.0:torch 2.11.0+cu130,torch-npu 2.11.0rc1 - v2.12.0:torch 2.12.0+cu130,torch-npu 2.12.0.rc1 - master:测试源码来自 master,本地复用 v2.12.0 运行环境进行兼容性预验证;目标分支验证以 PR CI 结果为准。 - 设备说明:API 为纯 Python,测试不创建 Tensor,不需要强制迁移到 NPU;运行器仍在 NPU 环境中完成导入和环境探测。 ## 执行命令 bash /workspace/user_data/tasks/scripts/run_api_python_version.sh 2.7.1 /workspace/user_data/tasks/sources/torch-npu-v2.7.1/test/distributed/elastic/metrics/test_metrics_api.py -v /workspace/user_data/tasks/scripts/run_api_python_version.sh 2.11.0 /workspace/user_data/tasks/sources/torch-npu-v2.11.0/test/distributed/elastic/metrics/test_metrics_api.py -v /workspace/user_data/tasks/scripts/run_api_python_version.sh 2.12.0 /workspace/user_data/tasks/sources/torch-npu-v2.12.0/test/distributed/elastic/metrics/test_metrics_api.py -v /workspace/user_data/tasks/scripts/run_api_python_version.sh master /workspace/user_data/tasks/sources/torch-npu-master/test/distributed/elastic/metrics/test_metrics_api.py -v ## 本地验证结果 | 目标分支 | 测试结果 | | --- | --- | | v2.7.1 | Ran 7 tests in 0.054s,OK,退出码 0 | | v2.11.0 | Ran 7 tests in 0.052s,OK,退出码 0 | | v2.12.0 | Ran 7 tests in 0.051s,OK,退出码 0 | | master | master 测试源码在 v2.12.0 环境中兼容性预验证通过,Ran 7 tests in 0.074s,OK;目标分支 CI 通过 | v2.12.0 及 master 源码兼容性预验证中有 CuTeDSL 可选依赖缺失提示;该提示与纯 Python metrics 测试无关,未影响测试结果或退出码。 # 【CheckList】 - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR 标题正确使用 test: 类型标签 - [x] PR 持续集成流水线(CI)执行通过,代码检查无异常 <!-- api-validation-evidence:start --> ## NPU 功能验证补充 以下为当前 PR head commit 对应的单卡 NPU 实测环境、命令和结果: text TASK 105 / PR #42800 / VALIDATION EVIDENCE API=torch.distributed.elastic.metrics.put_metric TARGET_BRANCH=v2.7.1 PLATFORM=Linux-5.10.0-216.0.0.115.oe2203sp4.aarch64-aarch64-with-glibc2.35 PYTHON=3.11.15 TORCH=2.7.1+cpu TORCH_NPU=2.7.1.post4 CANN=9.1.0.beta1 NPU=Ascend910_9382 VISIBLE_NPU=1 (PHYSICAL NPU 0) COMMAND=scripts/run_api_python_version.sh 2.7.1 sources/torch-npu-v2.7.1/test/distributed/elastic/metrics/test_metrics_api.py -v RESULT: Ran 7 tests in 0.054s OK test_exit_code=0 NOTE=pure Python API; no NPU tensor required > 说明:put_metric 是纯 Python、非计算类接口,测试不创建 Tensor;运行环境已完成 torch-npu 导入和 NPU 可用性探测。 <!-- api-validation-evidence:end --> <!-- PR描述模板更新日期:20260203 --> See merge request: Ascend/pytorch!42800 | 5 天前 | |
AI assist developer for python dt third batch for 2.7.1 Co-authored-by: deepSeekya<chenzhihan6@huawei.com> # message auto-generated for no-merge-commit merge: !26518 merge v2.7.1 into v2.7.1 AI assist developer for python dt third batch for 2.7.1 Created-by: deepSeekya Commit-by: deepSeekya Merged-by: ascend-robot Description: 【合入说明】 AI辅助研发python dt测试用例生成。 【合入来源】 AI辅助研发需求 dt测试文件覆盖率提升。 See merge request: Ascend/pytorch!26518 | 8 个月前 | |
| 1 年前 | ||
[fix] Fix NPU pipeline None placeholder Error Co-authored-by: Yuheng Wang<wangyuheng16@huawei.com> # message auto-generated for no-merge-commit merge: !40009 merge codex/fix-pipeline-prune-v2.7.1 into v2.7.1 [fix] Fix NPU pipeline None placeholder Error Created-by: yuheng_wang Commit-by: Yuheng Wang 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/2606 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) 当模型输入参数存在None时,会存在输入数据与GraphModule需要的输入数据不一致的问题。 通过修改GraphModule的输入参数,匹配实际非None的输入。 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!40009 | 1 个月前 | |
test(fx):Add validation cases for torch._C._distributed_rpc._is_current_rpc_agent_set on NPU Co-authored-by: jingkai-2026<2450453975@qq.com> # message auto-generated for no-merge-commit merge: !43173 merge test/add-rpc-agent-set-validation-v2.7.1 into v2.7.1 test(fx):Add validation cases for torch._C._distributed_rpc._is_current_rpc_agent_set on NPU Created-by: jingkai-2026 Commit-by: jingkai-2026 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> 关联issue:https://gitcode.com/Ascend/pytorch/issues/2748 关联issue: https://gitcode.com/Ascend/pytorch/issues/2828 ### API 功能 torch._C._distributed_rpc._is_current_rpc_agent_set:检查当前 RPC agent 是否已初始化,返回 bool。 ### 用例完备性说明 PyTorch 社区在 test/ 目录下无针对此 API 的直接测试用例(grep 结果为 0),仅在 torch/testing/_internal/distributed/rpc/rpc_test.py 中有一处非直接的辅助引用。因此新增测试文件。 ### 新增用例 本次自写用例 test/distributed/rpc/test_rpc_agent_set.py,包含 3 个测试方法: | 测试方法 | 验证内容 | |---------|---------| | test_is_current_rpc_agent_set_import | 验证 API 可导入且 callable | | test_is_current_rpc_agent_set_default | 验证 RPC 未初始化时返回 False | | test_is_current_rpc_agent_set_after_init | 验证 init_rpc 后返回 True,shutdown 后恢复 False | ## 适配方案 该 API 为框架层 RPC 状态查询接口,与底层设备无关,直接可用,无需 NPU 适配。 ## 运行结果 NPU Ascend910B4 环境测试通过:  See merge request: Ascend/pytorch!43173 | 4 天前 | |
[SHMEM] support npu shmem Co-authored-by: wangchao430<wangchao430@huawei.com> # message auto-generated for no-merge-commit merge: !25901 merge v2.7.0_shmem1 into v2.7.1 [SHMEM] support npu shmem Created-by: wangchao430 Commit-by: wangchao430 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!25901 | 9 个月前 | |
[bugfix]hcclwatchdog_save_status Co-authored-by: xiaoqi-zhou<zhouxiaoqi9@h-partners.com> # message auto-generated for no-merge-commit merge: !42728 merge processgrouphccl_v2.7.1 into v2.7.1 [bugfix]hcclwatchdog_save_status Created-by: xiaoqi-zhou Commit-by: xiaoqi-zhou Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 issue:https://gitcode.com/Ascend/pytorch/issues/3334 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 1.状态保存是辅助功能不抛异常仅打印详细日志,支持嵌套创建目录。 2.加锁全局进行写入时,锁改成全局变量;写入时先写入tmp文件,写入成功后再改成正式文件;未防止Hash扩容导致读取脏数据,读取存数据变量的深拷贝变量。 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 本地自验证通过: python集成测试:  C++单例测试:  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!42728 | 15 小时前 | |
[feature]分布式支持context parallel Co-authored-by: TrHan<hantianrui1@huawei.com> # message auto-generated for no-merge-commit merge: !35927 merge pr_cp_2.7.1_0516 into v2.7.1 [feature]分布式支持context parallel Created-by: TrHan Commit-by: TrHan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 [#2029](https://gitcode.com/Ascend/pytorch/issues/2029) # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) 参考原生torch cp实现方案,注册shard seq dim的策略,通过monkey patch将sdpa+DTensor的dispatch换成cp的dispatch,从而触发ring attention流程 详细方案见issue # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 涉及,docs/zh/native_apis/pytorch_2-7-1/torch-distributed-tensor.md # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 涉及新增接口,docs/zh/native_apis/pytorch_2-7-1/torch-distributed-tensor.md # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 围绕ring attention,对如下参数矩阵进行交叉验证  用例执行结果:  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!35927 | 2 个月前 | |
fix: lintrunner --all-files --take NEWLINE -a Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35871 merge v2.7.1_lintrunner into v2.7.1 fix: lintrunner --all-files --take NEWLINE -a 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/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用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!35871 | 2 个月前 | |
[test]fix _test_alltoall_2p_size test_mgr.load Co-authored-by: ACAES<liuyan7892@163.com> # message auto-generated for no-merge-commit merge: !32523 merge v2.7.1 into v2.7.1 [test]fix _test_alltoall_2p_size test_mgr.load Created-by: AACAES Commit-by: ACAES Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) 1. ci只提交分布式用例文件时,会被跳过导致ci跑不到,删除对应逻辑 2. https://gitcode.com/Ascend/pytorch/pull/31821 allow_internal_format默认值被改为False,_test_alltoall_2p_size 用例需手动设为True # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 本pr只修一个分布式用例,ci跑到了  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!32523 | 4 个月前 | |
[sync] PR-38965: 在A5机器调用div_时加参数rounding_mode=trunc Co-authored-by: xiaoqi-zhou<zhouxiaoqi9@h-partners.com> # message auto-generated for no-merge-commit merge: !39162 merge sync-pr38965-divs_master-to-v2.7.1 into v2.7.1 [sync] PR-38965: 在A5机器调用div_时加参数rounding_mode=trunc Created-by: ascend-ds-bot Commit-by: xiaoqi-zhou Merged-by: ascend-robot Description: ### 1. Origin pull request: https://gitcode.com/Ascend/pytorch/merge_requests/38965 ### 2. Original pull request related issue(s): https://gitcode.com/Ascend/pytorch/issues/2441 ### 3. Original pull request related commit(s): | Sha | Datetime | Message | |---|---|---| |[669448cb](https://gitcode.com/Ascend/pytorch/commit/669448cb78dfcc8442e2a16d4318ad49258860fa)|2026-06-23 15:34:11 +0800 CST|在A5机器调用div_时加参数rouding_mode=trunc<br>| See merge request: Ascend/pytorch!39162 | 1 个月前 | |
在A5环境上输入数据类型是int类型时调用tensor.div_加rounding_mode=trunc;在A5环境跳过ND->NC1HWC0格式的转换。 Co-authored-by: xiaoqi-zhou<zhouxiaoqi9@h-partners.com> # message auto-generated for no-merge-commit merge: !41482 merge npu_format_cast_v2.7.1 into v2.7.1 在A5环境上输入数据类型是int类型时调用tensor.div_加rounding_mode=trunc;在A5环境跳过ND->NC1HWC0格式的转换。 Created-by: xiaoqi-zhou Commit-by: xiaoqi-zhou Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 issue:https://gitcode.com/Ascend/pytorch/issues/2827 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 1. aclnnNpuFormatCastCalculateSizeAndFormat不支持在A5环境上数据从ND->NC1HWC0格式的转换,需要在A5环境跳过执行这样格式转换的用例。 2. aclnnInplaceDivs在A5环境上不支持输入为int类型的数据除以一个scalar类型的数据,需要在调用tensor.div的位置加上rounding_mode='trunc' # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!41482 | 1 个月前 | |
在A5环境上输入数据类型是int类型时调用tensor.div_加rounding_mode=trunc;在A5环境跳过ND->NC1HWC0格式的转换。 Co-authored-by: xiaoqi-zhou<zhouxiaoqi9@h-partners.com> # message auto-generated for no-merge-commit merge: !41482 merge npu_format_cast_v2.7.1 into v2.7.1 在A5环境上输入数据类型是int类型时调用tensor.div_加rounding_mode=trunc;在A5环境跳过ND->NC1HWC0格式的转换。 Created-by: xiaoqi-zhou Commit-by: xiaoqi-zhou Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 issue:https://gitcode.com/Ascend/pytorch/issues/2827 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 1. aclnnNpuFormatCastCalculateSizeAndFormat不支持在A5环境上数据从ND->NC1HWC0格式的转换,需要在A5环境跳过执行这样格式转换的用例。 2. aclnnInplaceDivs在A5环境上不支持输入为int类型的数据除以一个scalar类型的数据,需要在调用tensor.div的位置加上rounding_mode='trunc' # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!41482 | 1 个月前 | |
在A5环境上输入数据类型是int类型时调用tensor.div_加rounding_mode=trunc;在A5环境跳过ND->NC1HWC0格式的转换。 Co-authored-by: xiaoqi-zhou<zhouxiaoqi9@h-partners.com> # message auto-generated for no-merge-commit merge: !41482 merge npu_format_cast_v2.7.1 into v2.7.1 在A5环境上输入数据类型是int类型时调用tensor.div_加rounding_mode=trunc;在A5环境跳过ND->NC1HWC0格式的转换。 Created-by: xiaoqi-zhou Commit-by: xiaoqi-zhou Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 issue:https://gitcode.com/Ascend/pytorch/issues/2827 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 1. aclnnNpuFormatCastCalculateSizeAndFormat不支持在A5环境上数据从ND->NC1HWC0格式的转换,需要在A5环境跳过执行这样格式转换的用例。 2. aclnnInplaceDivs在A5环境上不支持输入为int类型的数据除以一个scalar类型的数据,需要在调用tensor.div的位置加上rounding_mode='trunc' # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!41482 | 1 个月前 | |
A5 dtype: make checkSupportedDataType accept uint64/fp64 on Ascend950+ Co-authored-by: limuan<liyijie16@huawei.com> # message auto-generated for no-merge-commit merge: !44706 merge reduce_support_more_dtype_v2.7.1 into v2.7.1 A5 dtype: make checkSupportedDataType accept uint64/fp64 on Ascend950+ Created-by: limuan Commit-by: limuan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 PTA reduce相关算子在processgrouphccl.cpp中有数据类型的校验,暂时未包含hccl A5新支持的数据类型uint64和fp64: 修改processgrouphccl.cpp中的数据校验函数,针对A5添加支持的数据类型uint64和fp64: # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】      # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!44706 | 13 小时前 | |
| 1 年前 | ||
| 1 年前 | ||
skip sub-comm creation when global process group was reinit'd and fix p2p longname err Co-authored-by: limuan<liyijie16@huawei.com> # message auto-generated for no-merge-commit merge: !38993 merge comm_p2p_v2.7.1 into v2.7.1 skip sub-comm creation when global process group was reinit'd and fix p2p longname err Created-by: limuan Commit-by: limuan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 - [ ] 需求 - [x] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 HCCLUdi在rootinfo场景下的P2P通信中,被覆盖为groupname,导致hccl算子拼接后hcclUdi和hcclCommname后,字符超长,拼接后名字:groupbfa08d29a349dccf55aaf7ea17c96695164d8ba6_p2p_0_1_groupbfa08d29a349dccf55aaf7ea17c96695164d8ba6_p2p_0_1 修复方案:Udi仅在rankfiletable场景下,被覆盖为groupname # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 ut用例通过:  pp并行时,正常拉起训练  Udi正常更新:  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!38993 | 1 个月前 | |
test: add Backend.Options API coverage Co-authored-by: nannan-2026<1794949109@qq.com> # message auto-generated for no-merge-commit merge: !43162 merge test-backend-options-v2.7.1 into v2.7.1 test: add Backend.Options API coverage Created-by: nannan-2026 Commit-by: nannan-2026 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 关联社区 Issue: https://gitcode.com/Ascend/pytorch/issues/3207 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) 本 PR 为 PyTorch 原生 API 一致性测试补齐,不涉及目标 API 的功能实现 修改。 目标 API: python torch._C._distributed_c10d.Backend.Options 新增测试文件: text test/distributed/test_backend_options.py ## 1. API 功能说明 torch._C._distributed_c10d.Backend.Options 是 PyTorch 分布式通信后端 Options 的基础配置类。 PyTorch v2.7.1 中的构造形式为: python Backend.Options(backend, timeout=default_timeout) 其中: 1. backend 为必选参数,表示分布式通信后端名称; 2. timeout 为可选参数,类型为 datetime.timedelta; 3. 未显式传入 timeout 时,默认值为 30 分钟; 4. backend 为只读属性; 5. _timeout 为可读写属性。 PyTorch v2.7.1 的 Backend.Options 不包含后续版本增加的: text global_ranks_in_group group_name 因此,本分支只针对 v2.7.1 实际存在的构造参数及属性进行验证。 ## 2. 修改内容 新增测试类: python TestBackendOptions 共新增以下 5 个测试方法。 ### 2.1 test_init_with_default_and_explicit_timeout 验证: - 仅传入必选参数 backend; - 返回对象类型为 Backend.Options; - backend 属性与传入值一致; - 默认 _timeout 为 30 分钟; - timeout 支持位置参数调用; - timeout 支持关键字参数调用; - 显式传入的超时与构造后的 _timeout 一致。 ### 2.2 test_init_with_boundary_values 验证: - backend 为空字符串; - timeout 为零; - timeout 为负数; - 边界值构造后的属性值与输入保持一致。 ### 2.3 test_property_access_and_instance_independence 验证: - backend 为只读属性; - 对 backend 赋值时抛出 AttributeError; - _timeout 为可写属性; - 修改一个实例的 _timeout 不影响其他实例; - 不同构造调用产生相互独立的对象。 ### 2.4 test_invalid_constructor_arguments 验证: - 缺少必选参数 backend; - backend 传入 None、整数、列表或字典; - timeout 传入 None、整数、字符串、列表或字典; - 传入额外位置参数; - 传入未定义关键字参数。 ### 2.5 test_invalid_timeout_assignment 验证: - 向 _timeout 写入 None、整数、字符串、列表或字典时抛出 TypeError; - 非法赋值后,原有 _timeout 值保持不变。 ## 3. 测试实现规范 新增测试符合以下要求: 1. 使用 TestCase 和 run_tests; 2. 测试结果使用 self.assert* 系列方法验证; 3. 异常行为使用 self.assertRaises 验证; 4. 未使用 try-except 屏蔽测试失败; 5. 未添加与测试无关的输出; 6. 新增文件包含 Huawei Copyright; 7. 新增文件包含 BSD 3-Clause License; 8. 新增文件包含英文模块用途说明; 9. 本 PR 仅新增 test/distributed/test_backend_options.py。 ## 4. PyTorch 社区用例情况及新增必要性 已检查 PyTorch 官方社区测试代码。 官方源码和测试中存在以下间接相关内容: - 具体分布式后端 Options 类使用或继承相关基础配置; - 部分 DeviceMesh 测试使用 C10dBackend.Options 作为类型标注; - 部分测试使用具体后端的 Options,例如 ProcessGroupNCCL.Options。 但是,未发现针对以下精确 API 提供直接、完整 Python 行为验证的上游 专项测试: python torch._C._distributed_c10d.Backend.Options 现有社区测试未充分覆盖: - backend 必选参数; - timeout 可选参数; - 默认超时; - 位置参数和关键字参数; - 空后端名称; - 零超时和负超时; - backend 只读行为; - _timeout 可写行为; - 不同实例之间的状态独立性; - 缺少参数、多余参数和非法参数类型; - _timeout 非法赋值后的状态保持行为。 现有继承关系、类型标注和间接使用不能替代目标 API 的直接一致性验证。 因此,有必要在 Ascend for PyTorch 的 test 目录新增独立专项测试。 ## 5. 各版本差异说明 各分支测试范围根据对应 PyTorch 版本中 Backend.Options 的实际接口能力进行区分: | 版本 | 测试方法数 | 接口差异 | |---|---:|---| | v2.7.1 | 5 | 包含 backend 和 _timeout | | v2.11.0 | 6 | 增加 global_ranks_in_group 和 group_name | | v2.12.0 | 6 | 与 v2.11.0 一致 | | master | 6 | 当前 PyTorch 2.13.0 的目标属性范围与 v2.11.0、v2.12.0 一致 | 具体说明: 1. v2.7.1 中不存在 global_ranks_in_group 和 group_name,因此本分支 不包含 test_group_metadata_properties; 2. v2.11.0 开始支持 global_ranks_in_group 和 group_name,因此对应 分支增加分组元数据属性测试; 3. v2.11.0 与 v2.12.0 的目标 API 能力一致,对应测试文件内容一致; 4. 修正后的 master 测试范围与当前 PyTorch 2.13.0 的实际接口保持一致; 5. 各分支测试内容不同是由 PyTorch 上游接口演进导致,不是测试覆盖遗漏。 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 不涉及资料文件修改。 目标 API 位于: text torch._C._distributed_c10d 其中 torch._C 和 _distributed_c10d 均属于 PyTorch 内部实现模块, 目标 API 属于 PyTorch 私有接口,不是客户可见的公开 API。 根据 Torch-NPU API 一致性任务要求,PyTorch 私有接口无需在公开原生 API 支持清单中补充资料。 同时,任务资料只要求在 master 分支检查和补充;本 API 经核查无需新增 公开资料,因此: - 不新增 Docs PR; - 不修改 docs/zh/api/native_api; - 不在 v2.7.1 分支增加资料文件。 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及。 本 PR 仅新增: text test/distributed/test_backend_options.py 用于验证: python torch._C._distributed_c10d.Backend.Options 本 PR 未修改目标 API 的: - API 名称; - 构造函数签名; - 输入参数; - 默认参数; - 属性定义; - 返回行为; - 异常行为; - Python 绑定; - 底层 C++ 实现。 本 PR 不涉及跨代码仓修改,也不涉及客户可见接口变更。 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 ## 1. 验证分支和提交 目标分支: text v2.7.1 测试分支: text test-backend-options-v2.7.1 测试提交: text b92962601fcd726f88bb66a2feeeb225e9fe131e 验证前已确认本地与远端提交一致: text Local commit: b92962601fcd726f88bb66a2feeeb225e9fe131e Remote commit: b92962601fcd726f88bb66a2feeeb225e9fe131e 本提交只新增: text test/distributed/test_backend_options.py 提交包含: text Signed-off-by: nannan-2026 <1794949109@qq.com> ## 2. 测试环境 本次验证使用与目标分支匹配的独立 Python 环境: text Python executable: /workspace/venvs/api3151-py271/bin/python Python: 3.11.13 torch: 2.7.1+cpu Expected torch: 2.7.1 Torch version match: True +cpu 是当前安装的 PyTorch wheel 构建标识。 目标 API 不执行 Tensor 运算,也不依赖 CUDA、NPU 或其他设备算子, 因此 CPU 构建不影响该 Python 绑定配置类的行为验证。 ## 3. NPU 适配说明 目标 API 是分布式后端配置对象,不接收 PyTorch Tensor,也不执行: - NPU 算子; - NPU Kernel; - CUDA 算子; - HCCL 集合通信; - CPU/NPU 数据迁移; - 与 dtype、shape 或 device 有关的计算。 因此,本测试不创建与目标 API 无关的 NPU Tensor,也不初始化 HCCL 进程组。 验证时设置: text TORCH_DEVICE_BACKEND_AUTOLOAD=0 用于避免在独立版本环境中自动加载与目标配置类无关的设备后端。 该设置不会跳过或替代 Backend.Options 的构造、属性及异常行为验证。 本次验证不依赖 torch_npu、CUDA 或 NPU 算子执行,验证对象为目标 API 的 Python 绑定行为。 ## 4. API 探针 执行目标 API 探针,验证对象类型、默认属性、属性可写性以及 v2.7.1 版本特征。 实际结果应记录为: text version_label: v2.7.1 python_executable: /workspace/venvs/api3151-py271/bin/python torch: 2.7.1+cpu expected_torch: 2.7.1 torch_version_match: True options_type: <class 'torch._C._distributed_c10d.Backend.Options'> backend: hccl _timeout: 0:30:00 has_global_ranks_in_group: False has_group_name: False backend_assignment: AttributeError updated_timeout: 0:00:07 expected_group_metadata: False API probe valid: True API probe exit code: 0 以上结果说明: 1. 目标对象类型正确; 2. 默认 backend 和 _timeout 正确; 3. backend 为只读属性; 4. _timeout 支持修改; 5. v2.7.1 不包含后续版本的分组元数据属性; 6. 目标 API 的实际接口范围与本分支测试内容一致。 ## 5. 测试方法检查 实际检测到以下 5 个测试方法: text test_init_with_default_and_explicit_timeout test_init_with_boundary_values test_property_access_and_instance_independence test_invalid_constructor_arguments test_invalid_timeout_assignment 检查结果: text Expected test count: 5 Actual test count: 5 Test method inspection exit code: 0 ## 6. Python 语法检查 执行命令: bash PYTHONDONTWRITEBYTECODE=1 \ TORCH_DEVICE_BACKEND_AUTOLOAD=0 \ /workspace/venvs/api3151-py271/bin/python \ -m py_compile \ /tmp/api3207_all_versions_latest/v2_7_1/test_backend_options.py 执行结果: text py_compile exit code: 0 ## 7. Git 差异检查 执行命令: bash git diff --check \ test-backend-options-v2.7.1^ \ test-backend-options-v2.7.1 \ -- test/distributed/test_backend_options.py 执行结果: text git diff --check exit code: 0 ## 8. unittest 验证 执行命令: bash cd /tmp PYTHONPATH= \ TORCH_DEVICE_BACKEND_AUTOLOAD=0 \ PYTHONDONTWRITEBYTECODE=1 \ /workspace/venvs/api3151-py271/bin/python \ /tmp/api3207_all_versions_latest/v2_7_1/test_backend_options.py \ -v 实际结果: text test_init_with_boundary_values ... ok test_init_with_default_and_explicit_timeout ... ok test_invalid_constructor_arguments ... ok test_invalid_timeout_assignment ... ok test_property_access_and_instance_independence ... ok ---------------------------------------------------------------------- Ran 5 tests in 1.532 s OK 执行结果: text unittest exit code: 0 ## 9. pytest 验证 执行命令: bash cd /tmp PYTHONPATH= \ TORCH_DEVICE_BACKEND_AUTOLOAD=0 \ PYTHONDONTWRITEBYTECODE=1 \ /workspace/venvs/api3151-py271/bin/python \ -m pytest -q \ /tmp/api3207_all_versions_latest/v2_7_1/test_backend_options.py 实际结果: text ..... [100%] 5 passed, 14 subtests passed in 1.3s 执行结果: text pytest exit code: 0 ## 10. 验证结果汇总 四版本测试脚本完成后,v2.7.1 对应退出码应填写为实际输出: text ENV_EXIT=0 METHOD_PARSE_EXIT=0 API_EXIT=0 COMPILE_EXIT=0 DIFF_EXIT=0 UNITTEST_EXIT=0 PYTEST_EXIT=0 最终结果: text RESULT: API #3207 v2.7.1 validation PASSED  完整日志: text /workspace/api3207_all_versions_latest/v2_7_1.log ## 11. 四版本验证说明 本任务分别在以下目标版本环境执行测试: text v2.7.1 v2.11.0 v2.12.0 master 每个版本均使用对应分支、对应 PyTorch 版本和独立运行日志,不使用其他 版本的运行结果代替当前分支验证结果。 四版本汇总文件: text /workspace/api3207_all_versions_latest/all_versions_summary.md # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!43162 | 8 天前 | |
| 2 年前 | ||
v2.7.1 enable internal format by default for hccl tests on A3 Co-authored-by: freezee<gengdongjie@huawei.com> # message auto-generated for no-merge-commit merge: !27493 merge v2.7.1 into v2.7.1 v2.7.1 enable internal format by default for hccl tests on A3 Created-by: freezee Commit-by: freezee 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!27493 | 8 个月前 | |
v2.7.1 enable internal format by default for hccl tests on A3 Co-authored-by: freezee<gengdongjie@huawei.com> # message auto-generated for no-merge-commit merge: !27493 merge v2.7.1 into v2.7.1 v2.7.1 enable internal format by default for hccl tests on A3 Created-by: freezee Commit-by: freezee 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!27493 | 8 个月前 | |
| 1 年前 | ||
test(distributed): add ProcessGroupMPI.create tests Co-authored-by: lgxxx<22515063@zju.edu.cn> # message auto-generated for no-merge-commit merge: !42948 merge test-process-group-mpi-create-v2.7.1 into v2.7.1 test(distributed): add ProcessGroupMPI.create tests Created-by: lgxxx Commit-by: lgxxx Merged-by: ascend-robot Description: # 【合入来源】 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 Issue: https://gitcode.com/Ascend/pytorch/issues/3208 # 【修改方案】 Add Python validation tests for torch.distributed.distributed_c10d.ProcessGroupMPI.create in test/distributed/test_c10d_mpi.py. The PyTorch community has C++ coverage for the MPI process group but no direct Python tests for this API. The tests cover MPI availability and import guards, factory creation and properties, non-member behavior, process-group initialization, and allreduce/broadcast/barrier operations. # 【资料变更】 不涉及。This is a backend control API and no native API documentation update is required. # 【接口变更】 不涉及。 # 【功能验证】 The test was run with an absolute path outside the source tree: python -m pytest test/distributed/test_c10d_mpi.py -q Result: 4 passed, 12 skipped. The skipped cases require an MPI runtime and a PyTorch build compiled with MPI support; this is expected in the current environment. ProcessGroupMPI is a backend/control API, so the test does not require NPU tensors. CI validation is pending. # 【CheckList】 - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 <!-- api-validation-evidence:start --> ## NPU 功能验证补充 以下为当前 PR head commit 对应的单卡 NPU 实测环境、命令和结果: text TASK 99 / PR #42948 / VALIDATION EVIDENCE API=torch.distributed.distributed_c10d.ProcessGroupMPI.create TARGET_BRANCH=v2.7.1 PLATFORM=Linux-5.10.0-216.0.0.115.oe2203sp4.aarch64-aarch64-with-glibc2.35 PYTHON=3.11.15 TORCH=2.7.1+cpu TORCH_NPU=2.7.1.post4 CANN=9.1.0.beta1 NPU=Ascend910_9382 VISIBLE_NPU=1 (PHYSICAL NPU 0) COMMAND=scripts/run_api_python_version.sh 2.7.1 sources/review/task99-v2.7.1/test/distributed/test_c10d_mpi.py -v RESULT: Ran 18 tests in 0.237s OK (skipped=14) test_exit_code=0 NOTE=MPI is not compiled; direct create cases were skipped > 说明:当前 PyTorch wheel 未编译 MPI;18 项中 14 项直接 MPI/create 用例按条件跳过。本次结果证明不可用路径及测试文件可正常执行,不表述为 ProcessGroupMPI.create 已在本机实际运行。 <!-- api-validation-evidence:end --> # 【合入来源】 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 Issue: https://gitcode.com/Ascend/pytorch/issues/3208 # 【修改方案】 Add Python validation tests for torch.distributed.distributed_c10d.ProcessGroupMPI.create in test/distributed/test_c10d_mpi.py. The PyTorch community has C++ coverage for the MPI process group but no direct Python tests for this API. The tests cover MPI availability and import guards, factory creation and properties, non-member behavior, process-group initialization, and allreduce/broadcast/barrier operations. # 【资料变更】 不涉及。This is a backend control API and no native API documentation update is required. # 【接口变更】 不涉及。 # 【功能验证】 The test was run with an absolute path outside the source tree: python -m pytest test/distributed/test_c10d_mpi.py -q Result: 4 passed, 14 skipped. The skipped cases require an MPI runtime and a PyTorch build compiled with MPI support; this is expected in the current environment. ProcessGroupMPI is a backend/control API, so the test does not require NPU tensors. # 【CheckList】 - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!42948 | 5 天前 | |
| 1 年前 | ||
check the size of tensors for alltoall Co-authored-by: tonglei<tonglei10@huawei.com> # message auto-generated for no-merge-commit merge: !29731 merge v2.7.1 into v2.7.1 check the size of tensors for alltoall Created-by: tongleicom Commit-by: tonglei 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!29731 | 6 个月前 | |
| 2 年前 | ||
| 2 年前 | ||
torch_npu.npu.Event inherits torch.Event, add GetPerStreamQueue in NPUGuardImpl's function Co-authored-by: zhaoyu<nanzhaogang@qq.com> # message auto-generated for no-merge-commit merge: !29915 merge v2.7.1-event_stream into v2.7.1 torch_npu.npu.Event inherits torch.Event, add GetPerStreamQueue in NPUGuardImpl's function Created-by: zhaoyu65 Commit-by: zhaoyu Merged-by: ascend-robot Description: # 【合入来源】 > (如有)请关联需求文档/issue链接 - [x] 需求 event/stream等接口对齐社区接入逻辑 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 1、将torch_npu.npu.Event修改为torch.Event的子类,和pytorch原生代码行为保持一致; 2、实现NPUGuardImpl::uncheckedGetDevice(); 3、NPUGuardImpl::block()、destroyEvent()支持PerStreamQueue,参考NPUEvent; 4、优化NPUGuardImpl::synchronizeEvent(); # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 1、使用isinstance、issubclass方法校验torch_npu.npu.Event和torch.Event的关系; 2、验证单流单queue场景是否正常; # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!29915 | 6 个月前 | |
[Test] Add coverage for torch.distributed.device_mesh._mesh_resources.root_to_flatten_mapping.clear Co-authored-by: nannan-2026<1794949109@qq.com> # message auto-generated for no-merge-commit merge: !42833 merge test-device-mesh-clear-v2.7.1 into v2.7.1 [Test] Add coverage for torch.distributed.device_mesh._mesh_resources.root_to_flatten_mapping.clear Created-by: nannan-2026 Commit-by: nannan-2026 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 关联社区 Issue: https://gitcode.com/Ascend/pytorch/issues/3175 本 PR 对以下 PyTorch API 补充 Torch-NPU 一致性测试: python torch.distributed.device_mesh._mesh_resources.root_to_flatten_mapping.clear # 【修改方案】 ## 1. 修改背景 在 PyTorch v2.7.1 中,torch.distributed.device_mesh._mesh_resources 是 DeviceMesh 模块内部使用的全局 _MeshEnv 实例,用于维护根 DeviceMesh、子 DeviceMesh 以及展平 DeviceMesh 之间的映射关系。 其中: python _mesh_resources.root_to_flatten_mapping 是一个字典类型的内部缓存,其结构为: python dict[DeviceMesh, dict[str, DeviceMesh]] 外层字典的键表示根 DeviceMesh,值表示该根 DeviceMesh 对应的 flattened mesh 缓存;内层字典将 flattened mesh 名称映射到对应的 DeviceMesh 实例。 目标 API: python torch.distributed.device_mesh._mesh_resources.root_to_flatten_mapping.clear() 用于原地清空上述根 Mesh 到 flattened Mesh 的全部缓存关系。 ## 2. PyTorch 官方用例核查结果 对 PyTorch v2.7.1 官方源码和测试进行检索后发现,官方已有以下 DeviceMesh flatten 相关测试: - test_flatten_mesh_3d - test_flatten_mesh_4d - test_reconstruct_mesh_with_flatten_dim 这些测试主要验证以下功能: 1. 多维 DeviceMesh 的展平结果是否正确; 2. flattened mesh 的名称是否正确; 3. flattened mesh 与 root mesh 的依赖关系是否正确; 4. 使用 flattened mesh 维度重新切分 DeviceMesh 是否正确; 5. 对已创建的 flattened mesh 是否能够正确复用。 但是,官方测试中没有发现对以下精确 API 的直接调用和验证: python torch.distributed.device_mesh._mesh_resources.root_to_flatten_mapping.clear 因此,本 PR 在 Torch-NPU 自有测试目录中补充该 API 的直接测试, 不修改 PyTorch 官方 upstream patch。 ## 3. 修改文件 本 PR 仅修改以下文件: text test/distributed/test_device_mesh.py 具体修改包括: 1. 新增 TestMeshResources 测试类; 2. 新增 test_root_to_flatten_mapping_clear 测试方法; 3. 在文件头补充 Huawei Copyright; 4. 在文件头补充 BSD 3-Clause License 声明; 5. 保留原有 Meta Platforms Copyright 和 Owner 信息。 本 PR 没有修改 Torch-NPU 运行时代码,没有修改算子实现,也没有修改 其他无关测试文件。 ## 4. Copyright 和许可证说明 根据 Torch-NPU 新增测试用例的代码规范,本 PR 在被修改的测试文件 头部补充: text Copyright (c) 2026 Huawei Technologies Co., Ltd 同时补充 BSD 3-Clause License 声明。 原文件已有的 Meta Platforms Copyright 和 Owner 信息均予以保留, 未删除或覆盖原有版权声明。 文件头当前包含: text Copyright (c) 2026 Huawei Technologies Co., Ltd BSD 3-Clause License Copyright (c) Meta Platforms, Inc. and affiliates Owner(s): ["oncall: distributed"] Huawei Copyright 在文件中仅出现一次。 本次 Copyright 和许可证修改仅用于满足新增测试用例的版权及许可证规范, 不影响测试逻辑、接口行为和运行结果。 ## 5. 新增测试类和测试方法 新增测试类: python TestMeshResources 新增测试方法: python test_root_to_flatten_mapping_clear 测试直接获取真实的共享映射对象: python mapping = _mesh_resources.root_to_flatten_mapping 并调用目标 API: python mapping.clear() ## 6. 测试覆盖场景 ### 6.1 空映射清理 首先清空当前映射,并确认映射类型和内容: python mapping.clear() self.assertIsInstance(mapping, dict) self.assertEqual(mapping, {}) 验证在映射为空的情况下调用 clear() 不会出现异常。 ### 6.2 非空映射清理 向映射中添加一条具有代表性的 root mesh 到 flattened mesh 的缓存: python root_mesh = object() flattened_mesh = object() mapping[root_mesh] = {"dp_tp": flattened_mesh} 随后确认测试数据已正确写入: python self.assertEqual(len(mapping), 1) self.assertIs(mapping[root_mesh]["dp_tp"], flattened_mesh) 然后调用目标 API: python result = mapping.clear() 并验证全部缓存条目已被删除。 ### 6.3 返回值验证 Python 字典的 clear() 应返回 None,测试对此进行验证: python self.assertIsNone(result) ### 6.4 原地清空验证 clear() 应清空原字典对象,而不是用另一个新字典替换原对象。 测试通过以下断言确认映射对象身份未发生变化: python self.assertIs( mapping, _mesh_resources.root_to_flatten_mapping, ) ### 6.5 重复清空验证 在映射已经为空的情况下再次调用: python mapping.clear() 验证重复清空不会报错,返回值仍为 None,映射仍保持为空: python self.assertIsNone(mapping.clear()) self.assertEqual(mapping, {}) ### 6.6 非法位置参数验证 dict.clear() 不接受位置参数,测试验证传入非法位置参数时抛出 TypeError: python with self.assertRaises(TypeError): mapping.clear("unexpected") ### 6.7 非法关键字参数验证 dict.clear() 不接受关键字参数,测试验证传入非法关键字参数时 抛出 TypeError: python with self.assertRaises(TypeError): mapping.clear(unexpected=True) ### 6.8 全局共享状态恢复 _mesh_resources 是 DeviceMesh 模块内部共享的全局对象, root_to_flatten_mapping 可能被同一测试进程中的其他测试使用。 为避免本测试污染其他 DeviceMesh 测试,本用例在执行前保存原始映射: python original_mapping = dict(mapping) 并通过 addCleanup 注册清理操作: python self.addCleanup(mapping.update, original_mapping) self.addCleanup(mapping.clear) 由于 cleanup 按后进先出的顺序执行,测试结束后会: 1. 清空测试过程中写入的临时数据; 2. 恢复执行测试前保存的原始映射内容。 即使测试中间出现断言失败,也能够执行清理操作,避免全局缓存状态 影响后续测试。 ## 7. NPU 适配分析 该 API 的实际对象是 Python 字典: python _mesh_resources.root_to_flatten_mapping 目标操作是 Python 字典的: python clear() 该 API 具有以下特点: 1. 不接收 Tensor; 2. 不执行 PyTorch 算子; 3. 不调用 NPU Kernel; 4. 不涉及 CPU/NPU 数据迁移; 5. 不涉及 dtype; 6. 不涉及 HCCL 集合通信; 7. 不依赖多卡环境; 8. 不需要初始化分布式进程组。 因此,本测试不添加与目标 API 无关的 NPU Tensor,也不引入不必要的 HCCL 初始化。 本次测试在 Ascend NPU 环境中执行,并单独确认: text NPU available: True NPU count: 1 NPU health: OK ## 8. 版本适配分析 对目标 API 在各版本中的存在情况进行了核查: | 分支 | 核查结果 | 本任务处理 | |---|---|---| | v2.7.1 | _mesh_resources.root_to_flatten_mapping 存在,官方无直接 clear() 测试 | 本 PR 补充测试 | | v2.9.0 | 当前任务规则中属于维护版本 | 不提交代码或测试 PR | | v2.10.0 | 当前任务规则中属于维护版本 | 不提交代码或测试 PR | | v2.11.0 | 精确 API 已不存在,缓存结构已重构 | 不补充旧 API 测试 | | v2.12.0 | 精确 API 已不存在,缓存结构已重构 | 不补充旧 API 测试 | | master | 精确 API 已不存在,缓存结构已重构 | 不补充旧 API 测试 | 在较新版本中,flattened mesh 缓存已重构为 DeviceMesh 实例上的: python DeviceMesh._flatten_mapping 该属性与 Issue #3175 指定的以下精确 API 不相同: python torch.distributed.device_mesh._mesh_resources.root_to_flatten_mapping.clear 因此,没有将新版 _flatten_mapping.clear() 强行视为同一 API,也没有 在不存在目标 API 的分支中添加无效测试。 # 【资料变更】 不涉及资料文件修改。 本次补充的 API 位于: python torch.distributed.device_mesh._mesh_resources 其中 _mesh_resources 以下划线开头,属于 PyTorch 内部私有对象, 不是面向用户公开承诺的公共 API。 根据 API 一致性任务的资料要求,PyTorch 私有 API 不需要在以下目录 补充公开资料: text docs/zh/api/native_api 因此,本任务不提交资料修改,也不创建单独的资料 PR。 本 PR 对测试文件头部补充的 Huawei Copyright 和 BSD 3-Clause License 属于测试代码版权规范调整,不属于原生 API 使用资料变更。 # 【接口变更】 不涉及。 本 PR 仅新增单元测试并补充测试文件 Copyright 和许可证声明,不修改 以下内容: 1. 不修改 Torch-NPU 运行时代码; 2. 不新增公共 Python API; 3. 不修改已有 API 的参数; 4. 不修改已有 API 的返回值; 5. 不修改算子行为; 6. 不修改跨仓调用关系; 7. 不修改客户可见接口; 8. 不修改 DeviceMesh 内部实现; 9. 不修改 PyTorch upstream patch。 # 【功能验证】 ## 1. 验证环境 text NPU: Ascend 910B4 NPU health: OK npu-smi version: 25.5.2 Python: 3.11 torch: 2.9.0+cpu torch_npu: 2.9.0rc1 NPU available: True NPU count: 1 说明: text torch 2.9.0+cpu 是当前任务镜像中安装的 PyTorch 包版本标识。NPU 能力由 torch_npu 后端扩展提供,测试过程中 torch_npu 已成功从 site-packages 加载,且: python torch.npu.is_available() 返回 True。 目标 API 在 PyTorch v2.7.1 中的存在性、定义位置及官方用例完整性, 通过 PyTorch v2.7.1 官方源码仓核查确认。 该 API 不执行 NPU 算子,测试环境中的 NPU 可用性检查用于确认测试运行 环境符合 Ascend 环境要求,不代表目标 API 本身会调用 NPU Kernel。 ## 2. 语法检查 执行: bash PYTHONDONTWRITEBYTECODE=1 \ python3 -m py_compile test/distributed/test_device_mesh.py 结果: text py_compile exit code: 0 说明 Python 语法检查通过。 ## 3. Git diff 格式检查 执行: bash git diff --check 结果: text diff check exit code: 0 未发现空白符错误或 Git diff 格式错误。 ## 4. Copyright 和文件头检查 执行: bash sed -n '1,42p' test/distributed/test_device_mesh.py grep -cF \ "# Copyright (c) 2026 Huawei Technologies Co., Ltd" \ test/distributed/test_device_mesh.py 检查结果: text Huawei header count: 1 文件头确认包含: text Copyright (c) 2026 Huawei Technologies Co., Ltd BSD 3-Clause License Copyright (c) Meta Platforms, Inc. and affiliates Owner(s): ["oncall: distributed"] Huawei Copyright 仅出现一次,原有 Meta Platforms Copyright 和 Owner 信息保持不变。 ## 5. unittest 目标用例验证 在补充 Huawei Copyright 和 BSD 3-Clause License,并完成原提交 amend 后,重新执行目标测试。 执行命令: bash cd /tmp TORCH_DEVICE_BACKEND_AUTOLOAD=0 \ PYTHONDONTWRITEBYTECODE=1 \ python3 \ /workspace/pytorch/test/distributed/test_device_mesh.py \ TestMeshResources.test_root_to_flatten_mapping_clear \ -v 执行结果: text test_root_to_flatten_mapping_clear (__main__.TestMeshResources.test_root_to_flatten_mapping_clear) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.004s OK 结果说明: - 补充 Copyright 和许可证声明后 Python 文件能够正常加载; - 目标测试成功执行; - 全部断言通过; - 测试结束后共享映射状态能够正常恢复。 ## 6. pytest 目标用例验证 执行命令: bash cd /tmp PYTHONPATH= python3 -m pytest -q \ /workspace/pytorch/test/distributed/test_device_mesh.py::TestMeshResources::test_root_to_flatten_mapping_clear 执行结果: text . [100%] 1 passed in 8.53s ## 7. 测试结果说明 目标用例验证了: - 空映射可正常清空; - 非空映射中的所有条目可正常删除; - clear() 返回值为 None; - 映射对象在原位置被清空; - 重复调用 clear() 不会报错; - 非法位置参数会抛出 TypeError; - 非法关键字参数会抛出 TypeError; - 测试结束后能够恢复原始共享缓存状态。 ## 8. 提交和修改范围验证 补充 Copyright 后,通过 git commit --amend --no-edit 更新原提交, 未新增额外提交。 最新提交: text 4bceec1c2c3613bb2baf002b5185392d0386b1dd 提交信息: text test: add root_to_flatten_mapping clear coverage Signed-off-by: nannan-2026 <1794949109@qq.com> 提交仅修改: text test/distributed/test_device_mesh.py 原 PR 分支通过 --force-with-lease 安全更新,远端更新结果: text 58cb53f92ad3af595e6868de6ad0036e298b8499 -> 4bceec1c2c3613bb2baf002b5185392d0386b1dd 本地与远端提交已确认一致: text Local commit: 4bceec1c2c3613bb2baf002b5185392d0386b1dd Remote commit: 4bceec1c2c3613bb2baf002b5185392d0386b1dd PR 仍保持单个 Signed-off-by 提交。 ## 9. 自验证截图 已完成以下内容的自验证: - Ascend 910B4 npu-smi info 状态; - torch.npu.is_available() 和 NPU 数量; - unittest 目标测试执行结果; - pytest 目标测试执行结果; - Python 语法检查; - git diff --check 检查; - Huawei Copyright 数量检查; - 修改文件范围检查; - Signed-off-by 检查; - 本地和远端提交一致性检查。     See merge request: Ascend/pytorch!42833 | 7 天前 | |
skip test_hccl_timeout_dumps Co-authored-by: zhaoyu<nanzhaogang@qq.com> # message auto-generated for no-merge-commit merge: !26893 merge v2.7.1 into v2.7.1 skip test_hccl_timeout_dumps Created-by: zhaoyu65 Commit-by: zhaoyu 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!26893 | 8 个月前 | |
reduce scatter support tensorlist.size != world_size Co-authored-by: limuan<liyijie16@huawei.com> # message auto-generated for no-merge-commit merge: !44440 merge reduce_scatter_v2.7.1 into v2.7.1 reduce scatter support tensorlist.size != world_size Created-by: limuan Commit-by: limuan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 本提案修改 torch_npu 的 ProcessGroupHCCL::reduce_scatter,使其输入支持范围与 PyTorch 社区(NCCL)保持一致。 PyTorch 2.2 的 reduce_scatter 对输入张量列表有形状/计数约束(列表长度须等于 world_size、每张量 numel 须等于输出 numel 等),2.3 起去除了这些约束。pta(torch_npu)当前的 reduce_scatter 与 PyTorch 2.2 实现一致:输入是 tensor list,包含多个 tensor,数量与卡数一致。这与社区后续版本不一致,需要兼容输入只有一个 tensor 的场景等用例,和社区保持一致。 核心改动:在 reduce_scatter 的 same_size 分支新增展平函数 flatten_for_reduce_scatter,替代原先复用的 flatten_for_scatter_gather——移除"输入张量数须等于 world_size""每张量 numel 须等于输出 numel"两条校验,保留列表长度一致与 input/output 同设备校验,并新增非空检查。Python 层 torch.distributed.reduce_scatter 签名不变。) # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 1、基础功能验证:执行test_reduce_scatter.py用例  2、dtype*op*tensorshape(1D,2D)*input_tensor_list.size(==,>,< world_size)*all_input_numbel(==, >, < )all_output_numbel reduce_scatter 全耦合输入,reduce_scatter算子输出与gpu结果对比  3、性能验证,修改前后pta调用reduce_scatter,用时基本无变化  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!44440 | 4 天前 | |
skip test_hccl_timeout_dumps Co-authored-by: zhaoyu<nanzhaogang@qq.com> # message auto-generated for no-merge-commit merge: !26893 merge v2.7.1 into v2.7.1 skip test_hccl_timeout_dumps Created-by: zhaoyu65 Commit-by: zhaoyu 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!26893 | 8 个月前 | |
| 1 年前 | ||
Add ProcessGroupHCCL::getCollNpuStreamId() to get or create NPU stream by device Co-authored-by: limuan<liyijie16@huawei.com> # message auto-generated for no-merge-commit merge: !34708 merge collstreamid/v2.7.1 into v2.7.1 Add ProcessGroupHCCL::getCollNpuStreamId() to get or create NPU stream by device Created-by: limuan Commit-by: limuan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 https://gitcode.com/Ascend/pytorch/issues/1884 - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 | **序号** | **功能点名称** | **功能点描述** | | :------- | :------------------------------- | :----------------------------------------------------------- | | 1 | 新增 C++ 方法 getCollNpuStreamId | 在 ProcessGroupHCCL 类中新增 getCollNpuStreamId(at::Device device) 方法。根据 device 参数生成 key,从 hcclStreams_ map 中查询对应的 NPU stream ID,如果不存在则创建新的 stream。 | | 2 | Stream 存在时返回已有 ID | 当 hcclStreams_ 中存在对应 key 且 stream 列表不为空时,直接返回已有的 stream ID,确保幂等性。 | | 3 | Stream 不存在时创建新 Stream | 当 hcclStreams_ 中不存在对应 key 或 stream 列表为空时,从 stream pool 中创建新的 NPU stream,存入 hcclStreams_,并返回新创建的 stream ID。 | | 4 | 支持高优先级 Stream 创建 | 创建新 stream 时,根据 options_->is_high_priority_stream 或环境变量 TORCH_HCCL_HIGH_PRIORITY 决定是否创建高优先级 stream。 | | 5 | Python 绑定暴露接口 | 在 Init.cpp 中通过 pybind11 将 getCollNpuStreamId 暴露为 Python 接口 get_coll_npu_stream_id,参数包括 device(torch.device),返回值为 int(stream ID)。 |  # 【资料变更】 不涉及 # 【接口变更】 新增Python 用户侧接口:ProcessGroupHCCL.get_p2p_stream_id * *接口描述:通过 pybind11 将 getCollNpuStreamId 暴露至 Python 层,供用户在分布式训练脚本中直接调用,获取指定设备的集合通信 stream ID 用于 stream 级别的同步与管理。 * *接口原型: int64_t get_coll_npu_stream_id(at::Device device); * *输入参数:* | 参数名称 | 类型 | 描述 | | -------- | ------------ | ---------------------------------------------------- | | device | at::Device | at::DeviceNPU 设备对象,用于生成 key 和创建 stream | * *返回参数:* | 参数名称 | 类型 | 描述 | | ------------- | --------- | -------------------------------- | | hcclStream.id | int64_t | 对应集合通信 stream 的 stream ID | # 【功能验证】  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!34708 | 3 个月前 | |
feat: add get_p2p_stream_id interface for HCCL backend Co-authored-by: pengjingyou<pengjingyou@huawei.com> # message auto-generated for no-merge-commit merge: !32087 merge p2p_stream_v2.7.1 into v2.7.1 feat: add get_p2p_stream_id interface for HCCL backend 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/工单 - [ ] 重构优化 - [ ] 资料更新 为 HCCL 后端新增 get_p2p_stream_id 接口,用于获取 P2P 通信的 NPU stream ID,方便用户在分布式训练场景下进行 stream 级别的同步和管理。 # 【修改方案】 1. 新增 C++ 方法 getP2PStreamId 在 ProcessGroupHCCL 类中新增 getP2PStreamId 方法,支持两种模式: - 批量模式 (is_batched=1) :使用 getKeyFromDevices 生成 key,适用于 batch_isend_irecv 场景 - 非批量模式 (is_batched=0) :使用 getKeySendRecv 生成 key,适用于单独的 send/recv 场景 2. 新增 Python 绑定 在 Init.cpp 中添加 Python 绑定,暴露 get_p2p_stream_id 接口到 Python 层 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” # 【接口变更】 | 接口名称 | 参数 | 返回值 | 说明 | | ---------------------------------- | ------------------------------------------------------------ | -------------------------------- | ------------------------- | | ProcessGroupHCCL.get_p2p_stream_id | device: torch.device - NPU <br>设备 peer: int - 对端 rank <br>is_batched: int - 是否批量模式 (1=批量, 0=非批量) | int - stream ID,不存在时返回 -1 | 获取 P2P 通信的 stream ID | # 【功能验证】 1. ut验证 新增测试文件 test/distributed/test_get_p2p_stream_id.py ,包含以下测试场景: | 测试用例 | 说明 | | ------------------------------ | ---------------------------------------------- | | test_p2p_stream_id_batched | 测试批量模式 (is_batched=1) 下获取 stream ID | | test_p2p_stream_id_non_batched | 测试非批量模式 (is_batched=0) 下获取 stream ID | | test_p2p_stream_id_invalid | 测试未构造p2p stream场景下获取 stream ID 非法值-1 | python -m pytest test/distributed/test_get_p2p_stream_id.py  2. 业务场景验证 调用dist.send/recv方法进行p2p通信后,通过该新增接口get_p2p_stream_id()获取p2p stream id,拿到id对应的Stream实例,指定在该Stream上进行计算操作。 通过profiling文件可以看到计算在p2p stream上进行  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!32087 | 4 个月前 | |
feat: add _group_start and _group_end bindings for ProcessGroupHCCL from v2.7.1 Co-authored-by: Chansinging<1183520536@qq.com> # message auto-generated for no-merge-commit merge: !41510 merge feat/add-hccl-group-start-end-bindings into v2.7.1 feat: add _group_start and _group_end bindings for ProcessGroupHCCL from v2.7.1 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/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 该需求是将 ProcessGroupHCCL类中已有的groupStart和groupEnd方法通过 PyBind11 暴露给 Python,命名为_group_start和_group_end,对齐 PyTorch 社区 ProcessGroupNCCL 对应接口,允许用户在 Python 侧手动将多个 HCCL 通信操作合并为一个 kernel 下发执行,减少 launch overhead。 # 【资料变更】 不涉及 # 【接口变更】 新增 _group_start and _group_end python侧接口 # 【功能验证】 test_group_send_recv_performance   test_group_all_reduce_relibility  test_group_p2p_reliability用例通过  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!41510 | 6 天前 | |
fix(test): correct expected buffer size calculation in test_hccl_shared_buffer Co-authored-by: limuan<liyijie16@huawei.com> # message auto-generated for no-merge-commit merge: !39519 merge hccl_shared_ut_v2.7.1 into v2.7.1 fix(test): correct expected buffer size calculation in test_hccl_shared_buffer Created-by: limuan Commit-by: limuan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 - [ ] 需求 - [x] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 用例中,原来内存占用的预期值为:groupnum*buffer_size + tol (tol为100,在通信域较多,可能无法coverbuffersize外的通信域内存开销),现在改为 每个通信域多预留100MB,100MB远远小于用例本身buffersize的400MB,可以看护共享内存功能 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 修改后用例通过  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!39519 | 1 个月前 | |
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
[sync] PR-36922: test(npu): add primary context isolation tests Co-authored-by: wuyouqi1<wuyouqi1@h-partners.com> # message auto-generated for no-merge-commit merge: !37658 merge sync-pr36922-pr_test_primary_ctx-to-v2.7.1 into v2.7.1 [sync] PR-36922: test(npu): add primary context isolation tests Created-by: ascend-ds-bot Commit-by: wuyouqi1 Merged-by: ascend-robot Description: ### 1. Origin pull request: https://gitcode.com/Ascend/pytorch/merge_requests/36922 ### 2. Original pull request related issue(s): https://gitcode.com/Ascend/pytorch/issues/2262 ### 3. Original pull request related commit(s): | Sha | Datetime | Message | |---|---|---| |[96d3670f](https://gitcode.com/Ascend/pytorch/commit/96d3670fbbd48ed0f8382e6574034fd4cbc0a5af)|2026-06-04 20:33:43 +0800 CST|test: remove debug prints and set ACL_OP_INIT_MODE=1 for CI compatibility<br><br>Remove diagnostic debug output from test_npu_primary_ctx.py.<br>Set ACL_OP_INIT_MODE=1 in __main__ block to prevent eager ACL op<br>initialization from implicitly creating device 0 primary context,<br>which is the root cause of CI failure (CI sets ACL_OP_INIT_MODE=0).<br><br>Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com><br>| |[c1b3d598](https://gitcode.com/Ascend/pytorch/commit/c1b3d59814b4e399e2f1772bbddcebbd5176d51f)|2026-06-04 15:17:53 +0800 CST|Revert "test: add diagnostic test files for CI primary ctx failure"<br><br>This reverts commit eb1e36319452da71fdbedbeec22bb72d3e9fea1b.<br>| |[78a9c425](https://gitcode.com/Ascend/pytorch/commit/78a9c425df0631f052b0c0520de812cd6b34118d)|2026-06-04 15:17:33 +0800 CST|Revert "test: pure ctypes test — only AclrtGetPrimaryCtxState, no torch_npu wrapper"<br><br>This reverts commit f0a4f1e267c380ea9d74bc4a42a9354b385c1b80.<br>| |[f0a4f1e2](https://gitcode.com/Ascend/pytorch/commit/f0a4f1e267c380ea9d74bc4a42a9354b385c1b80)|2026-06-03 16:55:35 +0800 CST|test: pure ctypes test — only AclrtGetPrimaryCtxState, no torch_npu wrapper<br>| |[eb1e3631](https://gitcode.com/Ascend/pytorch/commit/eb1e36319452da71fdbedbeec22bb72d3e9fea1b)|2026-06-03 15:10:00 +0800 CST|test: add diagnostic test files for CI primary ctx failure<br><br>- test_npu_primary_ctx_swap_order.py: swap hasPrimaryContext(1)/(0) check order<br>- test_npu_primary_ctx_ctypes.py: ctypes direct call AclrtGetPrimaryCtxState<br>| |[ba9d8b6c](https://gitcode.com/Ascend/pytorch/commit/ba9d8b6c23c92df4f7c971d0059eb8a5fa709f93)|2026-06-02 14:55:15 +0800 CST|test(npu): add primary context isolation tests with debug diagnostics<br><br>Add test_npu_primary_ctx.py to verify NPU primary context isolation<br>across devices, with debug logging for CI environment diagnosis.<br><br>Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com><br>| See merge request: Ascend/pytorch!37658 | 2 个月前 | |
| 1 年前 | ||
request for hccl qos Co-authored-by: gcw_Dgfy2aKk<dujunjie2@huawei.com> # message auto-generated for no-merge-commit merge: !30439 merge Hccl_Qos_v2.7.1 into v2.7.1 request for hccl qos Created-by: gcw_Dgfy2aKk Commit-by: gcw_Dgfy2aKk Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > (如有)请关联需求文档/issue链接 开放流量的QoS配置接口,并向CANN传递 - [x] 需求 # 【修改方案】 透传hccl qos参数给HCCL # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 执行 python test/distributed/test_options.py -k test_options_hccl_sdma_qos_wrong_type 执行结果: 执行通过, 无报错 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!30439 | 6 个月前 | |
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
A5 dtype: make checkSupportedDataType accept uint64/fp64 on Ascend950+ Co-authored-by: limuan<liyijie16@huawei.com> # message auto-generated for no-merge-commit merge: !44706 merge reduce_support_more_dtype_v2.7.1 into v2.7.1 A5 dtype: make checkSupportedDataType accept uint64/fp64 on Ascend950+ Created-by: limuan Commit-by: limuan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 PTA reduce相关算子在processgrouphccl.cpp中有数据类型的校验,暂时未包含hccl A5新支持的数据类型uint64和fp64: 修改processgrouphccl.cpp中的数据校验函数,针对A5添加支持的数据类型uint64和fp64: # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】      # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!44706 | 13 小时前 | |
A5 dtype: make checkSupportedDataType accept uint64/fp64 on Ascend950+ Co-authored-by: limuan<liyijie16@huawei.com> # message auto-generated for no-merge-commit merge: !44706 merge reduce_support_more_dtype_v2.7.1 into v2.7.1 A5 dtype: make checkSupportedDataType accept uint64/fp64 on Ascend950+ Created-by: limuan Commit-by: limuan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 PTA reduce相关算子在processgrouphccl.cpp中有数据类型的校验,暂时未包含hccl A5新支持的数据类型uint64和fp64: 修改processgrouphccl.cpp中的数据校验函数,针对A5添加支持的数据类型uint64和fp64: # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】      # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!44706 | 13 小时前 | |
A5 dtype: make checkSupportedDataType accept uint64/fp64 on Ascend950+ Co-authored-by: limuan<liyijie16@huawei.com> # message auto-generated for no-merge-commit merge: !44706 merge reduce_support_more_dtype_v2.7.1 into v2.7.1 A5 dtype: make checkSupportedDataType accept uint64/fp64 on Ascend950+ Created-by: limuan Commit-by: limuan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 PTA reduce相关算子在processgrouphccl.cpp中有数据类型的校验,暂时未包含hccl A5新支持的数据类型uint64和fp64: 修改processgrouphccl.cpp中的数据校验函数,针对A5添加支持的数据类型uint64和fp64: # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】      # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!44706 | 13 小时前 | |
A5 dtype: make checkSupportedDataType accept uint64/fp64 on Ascend950+ Co-authored-by: limuan<liyijie16@huawei.com> # message auto-generated for no-merge-commit merge: !44706 merge reduce_support_more_dtype_v2.7.1 into v2.7.1 A5 dtype: make checkSupportedDataType accept uint64/fp64 on Ascend950+ Created-by: limuan Commit-by: limuan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 PTA reduce相关算子在processgrouphccl.cpp中有数据类型的校验,暂时未包含hccl A5新支持的数据类型uint64和fp64: 修改processgrouphccl.cpp中的数据校验函数,针对A5添加支持的数据类型uint64和fp64: # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】      # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!44706 | 13 小时前 | |
fix: 修改分布式历史遗留用例 Co-authored-by: chansinging<chenxingying2@huawei.com> # message auto-generated for no-merge-commit merge: !38793 merge cxy_v2.7.1_fix into v2.7.1 fix: 修改分布式历史遗留用例 Created-by: chansinging Commit-by: chansinging Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 - [ ] 需求 - [x] 问题单 [问题单](https://gitcode.com/Ascend/pytorch/issues/2425) - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 用例失败,修改用例文件 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】    # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!38793 | 1 个月前 | |
AI assist developer for python DT second batch for 2.7.1 Co-authored-by: deepSeekya<chenzhihan6@huawei.com> # message auto-generated for no-merge-commit merge: !26370 merge v2.7.1 into v2.7.1 AI assist developer for python DT second batch for 2.7.1 Created-by: deepSeekya Commit-by: deepSeekya Merged-by: ascend-robot Description: 【合入说明】 AI辅助研发python dt测试用例生成。 【合入来源】 AI辅助研发需求 dt测试文件覆盖率提升。 See merge request: Ascend/pytorch!26370 | 9 个月前 | |
AI assist developer for python DT second batch for 2.7.1 Co-authored-by: deepSeekya<chenzhihan6@huawei.com> # message auto-generated for no-merge-commit merge: !26370 merge v2.7.1 into v2.7.1 AI assist developer for python DT second batch for 2.7.1 Created-by: deepSeekya Commit-by: deepSeekya Merged-by: ascend-robot Description: 【合入说明】 AI辅助研发python dt测试用例生成。 【合入来源】 AI辅助研发需求 dt测试文件覆盖率提升。 See merge request: Ascend/pytorch!26370 | 9 个月前 | |
| 1 年前 | ||
reduce scatter support tensorlist.size != world_size Co-authored-by: limuan<liyijie16@huawei.com> # message auto-generated for no-merge-commit merge: !44440 merge reduce_scatter_v2.7.1 into v2.7.1 reduce scatter support tensorlist.size != world_size Created-by: limuan Commit-by: limuan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 本提案修改 torch_npu 的 ProcessGroupHCCL::reduce_scatter,使其输入支持范围与 PyTorch 社区(NCCL)保持一致。 PyTorch 2.2 的 reduce_scatter 对输入张量列表有形状/计数约束(列表长度须等于 world_size、每张量 numel 须等于输出 numel 等),2.3 起去除了这些约束。pta(torch_npu)当前的 reduce_scatter 与 PyTorch 2.2 实现一致:输入是 tensor list,包含多个 tensor,数量与卡数一致。这与社区后续版本不一致,需要兼容输入只有一个 tensor 的场景等用例,和社区保持一致。 核心改动:在 reduce_scatter 的 same_size 分支新增展平函数 flatten_for_reduce_scatter,替代原先复用的 flatten_for_scatter_gather——移除"输入张量数须等于 world_size""每张量 numel 须等于输出 numel"两条校验,保留列表长度一致与 input/output 同设备校验,并新增非空检查。Python 层 torch.distributed.reduce_scatter 签名不变。) # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 1、基础功能验证:执行test_reduce_scatter.py用例  2、dtype*op*tensorshape(1D,2D)*input_tensor_list.size(==,>,< world_size)*all_input_numbel(==, >, < )all_output_numbel reduce_scatter 全耦合输入,reduce_scatter算子输出与gpu结果对比  3、性能验证,修改前后pta调用reduce_scatter,用时基本无变化  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!44440 | 4 天前 | |
| 1 年前 | ||
[bugfix]hcclwatchdog_save_status Co-authored-by: xiaoqi-zhou<zhouxiaoqi9@h-partners.com> # message auto-generated for no-merge-commit merge: !42728 merge processgrouphccl_v2.7.1 into v2.7.1 [bugfix]hcclwatchdog_save_status Created-by: xiaoqi-zhou Commit-by: xiaoqi-zhou Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 issue:https://gitcode.com/Ascend/pytorch/issues/3334 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 1.状态保存是辅助功能不抛异常仅打印详细日志,支持嵌套创建目录。 2.加锁全局进行写入时,锁改成全局变量;写入时先写入tmp文件,写入成功后再改成正式文件;未防止Hash扩容导致读取脏数据,读取存数据变量的深拷贝变量。 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 本地自验证通过: python集成测试:  C++单例测试:  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!42728 | 15 小时前 | |
test(distributed): add test for FileStore,Store,TCPStore Co-authored-by: Nice_try<nicetryzzw@163.com> Co-authored-by: Nice_try<1849404617@qq.com> # message auto-generated for no-merge-commit merge: !31911 merge v2.7.1-apt into v2.7.1 test(distributed): add test for FileStore,Store,TCPStore Created-by: Nice_try Commit-by: Nice_try Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**[Usage: test目录下torch.distributed.FileStore,torch.distributed.Store, torch.distributed.TCPStore API的测试用例缺失](https://gitcode.com/Ascend/pytorch/issues/1580)**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) 基于 “最小化、核心化、针对性” 原则,设计独立 NPU 测试用例,核心思路: 1.剥离无关耦合:仅使用 PyTorch 原生基础层(Linear、BatchNorm、Conv2d)构建测试对象,避免算子适配干扰; 2.聚焦核心功能:仅验证 API 基础能力,不涉及边缘场景与复杂计算,确保结果反映 API 本身适配状态; 3.贴合 NPU 特性:重点校验设备一致性、跨设备状态迁移等 NPU 核心关注点; 4.轻量化设计:单个方法验证一个核心功能点,逻辑清晰、执行高效。 在 NPU(npu:0)环境下,覆盖原生测试用例中没有直接测试用例的API,包括: python torch.distributed.FileStore.path torch.distributed.Store.__init__ torch.distributed.Store.add torch.distributed.Store.timeout torch.distributed.TCPStore.host torch.distributed.TCPStore.port 根据设计原则将对应的自定义测试用例进行补充。 # 【资料变更】 修改了以下文件,补充了相关接口 docs/zh/native_apis/pytorch_2-6-0/torch-distributed.md docs/zh/native_apis/pytorch_2-7-1/torch-distributed.md docs/zh/native_apis/pytorch_2-8-0/torch-distributed.md docs/zh/native_apis/pytorch_2-9-0/torch-distributed.md # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 bash root@56991725ea5f:/workspace/test_store_api# python test_store_api_v2-7-1.py ..... ---------------------------------------------------------------------- Ran 5 tests in 0.716s OK  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!31911 | 4 个月前 | |
fix: gate createSubHcclComm behind ROOTINFO_SUBCOMM_ENABLE env var Co-authored-by: limuan<liyijie16@huawei.com> # message auto-generated for no-merge-commit merge: !40485 merge fix_resumcomm_v2.7.1 into v2.7.1 fix: gate createSubHcclComm behind ROOTINFO_SUBCOMM_ENABLE env var Created-by: limuan Commit-by: limuan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 - [ ] 需求 - [x] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 子通信域特性与故障快恢场景下的resume通信域特性冲突,暂时不支持resume子通信域,所以子通信域特性增加一个环境变量开关 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 正常拉起训练  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!40485 | 1 天前 | |
| 2 年前 | ||
fix ignore it when device_index < 0 on with device Co-authored-by: huangyunlong2022<huangyunlong4@h-partners.com> # message auto-generated for no-merge-commit merge: !31934 merge 2.7wt into v2.7.1 fix ignore it when device_index < 0 on with device Created-by: huangyunlong2022 Commit-by: huangyunlong2022 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能力等内容) 修复with torch.npu.deivice,传-1时,会set device 0的问题,当前对于传入异常参数(小于0)不做处理 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!31934 | 4 个月前 | |
register strategy for npu custom ops Co-authored-by: jizewei<jizewei@huawei.com> # message auto-generated for no-merge-commit merge: !27074 merge v2.7.1_register_strategy into v2.7.1 register strategy for npu custom ops 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 sharding strategies for npu custom ops to support DTensor: 1. npu_add_rms_norm 2. npu_moe_token_permute, npu_moe_token_permute_grad 3. npu_moe_token_unpermute, npu_moe_token_unpermute_grad 4. npu_rotary_mul, npu_rotary_mul_backward **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!27074 | 8 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 4 天前 | ||
| 2 年前 | ||
| 3 个月前 | ||
| 13 天前 | ||
| 3 天前 | ||
| 5 天前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 1 个月前 | ||
| 4 天前 | ||
| 9 个月前 | ||
| 15 小时前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 4 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 13 小时前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 个月前 | ||
| 8 天前 | ||
| 2 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 5 天前 | ||
| 1 年前 | ||
| 6 个月前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 6 个月前 | ||
| 7 天前 | ||
| 8 个月前 | ||
| 4 天前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 3 个月前 | ||
| 4 个月前 | ||
| 6 天前 | ||
| 1 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 2 个月前 | ||
| 1 年前 | ||
| 6 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 13 小时前 | ||
| 13 小时前 | ||
| 13 小时前 | ||
| 13 小时前 | ||
| 1 个月前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 1 年前 | ||
| 4 天前 | ||
| 1 年前 | ||
| 15 小时前 | ||
| 4 个月前 | ||
| 1 天前 | ||
| 2 年前 | ||
| 4 个月前 | ||
| 8 个月前 |