Closed
stop advertising HCCL tensor-alloc support #5255
li_jing_hwAdd on  Sep 29Closed at  Oct 8
li_jing_hw
li_jing_hwCollaborators
Sep 29 Create

问题:ProcessGroupHCCL::supportsTensorAlloc() 返回的是 IsGteCANNVersion("9.2.0-beta", "CANN"),等于拿 CANN 版本冒充 c10d 的能力声明;但 allocateTensor() 在 torch_npu 里从未实现。于是任何
信任该标志的调用方都会拿到 RuntimeError: Backend hccl does not support allocateTensor,例如 test/distributed/test_pg_wrapper.py::test_wrapper_forwards_hccl_methods。

触发条件:运行时 CANN ≥ 9.2.0-beta(_is_gte_cann_version("9.2.0-beta") 为真)。CANN 9.1 等环境上该标志为 false,测试分支被跳过,所以之前不暴露。

修改:

  1. 删除 supportsTensorAlloc 的 override(.hpp 声明 + .cpp 定义),回落 Backend 基类默认的 false —— 与"未实现 allocateTensor()"的事实一致;
  2. 把 CANN 版本闸门移进它唯一真正的使用者 getMemAllocator(),行为不变。

影响:getMemAllocator() 的 CANN ≥ 9.2 门槛保持不变;supports_tensor_alloc() 对 HCCL 变为 False,测试中 wrapper.supports_tensor_alloc(device) == unwrapped.supports_tensor_alloc(device) 仍
成立、allocate_tensor 分支被跳过。
将来若要真正对外支持该 API,应先实现 ProcessGroupHCCL::allocateTensor(),再重新打开 supportsTensorAlloc。

likedislike
TorchNPU-BotTorchNPU-BotCollaborators
Sep 29 Added label: triage-reviewmodule: distributed
TorchNPU-Bot
TorchNPU-BotCollaborators
Sep 29 Comments:

无报错,属代码改进建议/需求;主题为 HCCL 集合通信能力声明与实现一致性
添加分类标签:module: distributed。
当前分类由社区bot提供,如分类有误请在评论中回复。

likedislike
TorchNPU-BotTorchNPU-BotCollaborators
Sep 29 Added label: bot-triaged; Removed label: triage-review
TorchNPU-Bot
TorchNPU-BotCollaborators
Sep 29 Comments:

检测到当前 issue 已关联 PR,自动添加标签:bot-triaged

likedislike
chenrayray
chenrayrayCollaborators
Oct 8 Comments:

因为本单相关实施 PR 已全部结束(1 个已合入、0 个已关闭),按照本轮 issue 整理规则,先关闭此单。

核对的 PR:

如仍有问题或需要继续推进,请重新打开,并补充当前 PyTorch / TorchNPU / CANN 版本、硬件环境、复现步骤及相关日志;需求类请补充尚未完成的具体内容。

likedislike
chenrayraychenrayrayCollaborators
Oct 8 Close issue
chenrayraychenrayrayCollaborators
Oct 8 changed custom state from TODO to DONE
ascend-robotascend-robotCollaborators
Oct 8 Added label: resolved
zzzzzzkzzzzzzkCollaborators
Oct 12 Associated pull request
zzzzzzkzzzzzzkCollaborators
Oct 12 Associated pull request
zzzzzzkzzzzzzkCollaborators
Oct 12 Associated pull request
zzzzzzkzzzzzzkCollaborators
Oct 12 Associated pull request
zzzzzzkzzzzzzkCollaborators
Oct 12 Associated pull request
zzzzzzkzzzzzzkCollaborators
Oct 12 Associated pull request
zzzzzzkzzzzzzkCollaborators
Oct 12 Associated pull request
zzzzzzkzzzzzzkCollaborators
Oct 12 Associated pull request
zzzzzzkzzzzzzkCollaborators
Oct 12 Associated pull request