Closed
[Documentation|文档反馈]: MatmulAllReduce README 将 K=0 空内维标为不支持 #6460
KaranocaVeAdd on  25 days agoClosed at  23 days ago
KaranocaVe
KaranocaVe
25 days ago Create

[Documentation|文档反馈]: MatmulAllReduce README 将 K=0 空内维标为不支持

问题

MatmulAllReduce 的形状推导和 Host tiling 支持空 K 场景,例如 x1=[32,0]、x2=[0,128],但 README 将 K 的范围写为 [1,65535],把该合法输入排除在文档范围之外。

影响与修复

读者会误以为 MatmulAllReduce 不支持空 K 输入。修复将 README 中 K 的下界改为 0,并注明 K=0 仅适用于空 K 场景;计算行为不变。

验证

  • 验证确认 Host infershape 和 910B、Ascend 950、310P 的基础 FP16 tiling 用例均支持 K=0 空内维;K 维不匹配的非零输入被拒绝。
  • 限定到修改的 README 文件后,空白、文件末尾、文件大小、冲突标记、私钥和 OAT 检查均通过。

关联 PR: https://gitcode.com/cann/ops-transformer/merge_requests/14336

likedislike
KaranocaVeKaranocaVe
24 days ago Associated pull request
KaranocaVeKaranocaVe
24 days ago Associated pull request
游震Collaborators
24 days ago Comments:

/assign @KaranocaVe

likedislike
CANN-robotCANN-robotCollaborators
24 days ago Assign KaranocaVe as responsible person
周云飞
周云飞Collaborators
24 days ago Comments:

/assign @KaranocaVe

likedislike
周云飞
周云飞Collaborators
24 days ago Comments:

感谢指出这一文档边界问题。按您提供的验证结果,x1=[32,0]、x2=[0,128] 这类空 K 输入可通过形状推导及指定平台的基础 FP16 tiling 检查,而 README 中的 [1,65535] 会让读者理解为所有 K=0 输入均不受支持。

一个可行的调整是将 README 中 K 的范围改为 [0,65535],并明确:K=0 仅指两个输入的矩阵乘法内维均为 0 的空 K 场景,例如上述输入;这不放宽两个输入内维必须匹配的要求,也不改变计算行为。

您报告的验证范围是 Host 形状推导,以及 910B、Ascend 950、310P 的基础 FP16 tiling,不宜据此扩展为所有数据类型、执行路径或设备端计算均已验证。当前尚缺少对应 README 和 MatmulAllReduce 实现的直接证据,文档调整的适用范围仍需进一步确认。

likedislike
KaranocaVeKaranocaVe
24 days ago Modify description of issue
KaranocaVe
KaranocaVe
24 days ago Comments:

补充直接依据:PR 修改前的 mc2/matmul_all_reduce/README.md:274 将 k、n 的范围合并写为 [1,65535]。当前 master 的 mc2/matmul_all_reduce/op_host/op_tiling/matmul_all_reduce_tiling_base.cpp:973 将 orgKValue == 0 标记为 isKZero_;op_host/op_tiling/arch22/matmul_all_reduce_tiling_910.cpp:52-59 对该标记选择 empty-tensor tiling key。Host shape-inference fixture tests/ut/op_host/test_matmul_all_reduce_shape_infershape.csv:4 对 x1=[32,0]、x2=[0,128] 期望 SUCCESS;同文件中的非零且不匹配 K 用例期望 FAILED。910B、arch35 和 310P tiling fixtures 也包含 K=0 的 SUCCESS 项。

因此,本次文档调整只覆盖两个矩阵内维相等且为 0 的空 K 场景,以及已有的 Host shape-inference/tiling 证据;这些证据不表示所有数据类型、执行路径或设备端计算都已验证。

likedislike
CANN-robotCANN-robotCollaborators
23 days ago Close issue
CANN-robotCANN-robotCollaborators
23 days ago Added label: resolved
周云飞
周云飞Collaborators
4 days ago Comments:

已更新 MatmulAllReduce README,将 K 的取值范围调整为 [0, 65535],并注明 K=0 仅支持空 K 场景;N 的范围保持不变。此次为文档修正,计算行为不变。

关联 PR:PR #14336、PR #14337

likedislike