Closed
[Documentation|文档反馈]: SoftMarginLoss BFLOAT16 产品范围说明缺失 #8575
KaranocaVeAdd on  11 days agoClosed at  9 days ago
KaranocaVe
KaranocaVe
11 days ago Create

[Documentation|文档反馈]: SoftMarginLoss BFLOAT16 产品范围说明缺失

现象

loss/soft_margin_loss/docs/aclnnSoftMarginLoss.md 在 self、target 和 out 的数据类型栏统一列出 FLOAT、FLOAT16、BFLOAT16,但没有说明 BFLOAT16 的产品范围。调用方据此可能在不支持 BFLOAT16 的产品上构造输入。

证据

固定源码 ae873b119fb5499c41a6893f920171551fb0a197 的 aclnn_soft_margin_loss.cpp 通过 GetDtypeSupportListV2(ASCEND910B_DTYPE_SUPPORT_LIST, ASCEND910_DTYPE_SUPPORT_LIST) 校验 dtype:DAV_2201 或 Regbase 使用含 BFLOAT16 的列表,其他架构使用仅含 FLOAT/FLOAT16 的列表。OpDef 的三种 dtype 注册是通用声明,未表达这一架构条件。
当前目标仓库 master head c9392e717995d42cca318e91aeb88a00ea584b8a 的 aclnnSoftMarginLoss.md 仍将 BFLOAT16 列在通用参数表中,且产品支持段没有相应的 dtype 限定;该文档缺口仍存在。仓内 aclnnBinaryCrossEntropy 文档已用 npu="910,310p" 标签说明 Atlas 推理/训练产品不支持 BFLOAT16;l2_loss/README.md 同时将 Atlas A2、A3 和 Ascend 950 列为支持 BFLOAT16,与固定验收源码中的实现条件相符。
相关工作:Issue #7358 与已合入 PR !12626 修正 reduction 输出 shape;Issue #7364 与同一 PR 涉及 INF 传播。Issue #7565 讨论 out 的 shape/rank 说明。开放 PR !13945 加固同一算子并补充 API 头文件中的 BFLOAT16 声明,尚未在本 ACLNN 文档中写明 BFLOAT16 的产品范围。

影响与修复

文档缺少产品级 dtype 条件,可能导致在 Atlas 推理系列或 Atlas 训练系列产品上按文档构造 BFLOAT16 输入。补丁仅在参数表后补充 npu="910,310p" 说明,保留产品支持总表和算子实现不变。

验证

  • 结论:固定基线和当前目标 master 的 SoftMarginLoss 参数表均把 BFLOAT16 写成通用类型,未标明 Atlas 推理系列和 Atlas 训练系列不支持 BFLOAT16;当前 master 只完成只读文档核对,未扩展 NPU 运行验证范围。

关联 PR: https://gitcode.com/cann/ops-nn/merge_requests/14164

likedislike
KaranocaVeKaranocaVe
11 days ago Associated pull request
KaranocaVeKaranocaVe
11 days ago Modify description of issue
yuning_chenyuning_chenCollaborators
11 days ago Assign KaranocaVe as responsible person
yuning_chenyuning_chenCollaborators
10 days ago Assign ji-songyuan as responsible person, remove original responsible person: KaranocaVe
CANN-robotCANN-robotCollaborators
9 days ago Close issue
CANN-robotCANN-robotCollaborators
9 days ago changed custom state from 待办的 to 已完成
CANN-robotCANN-robotCollaborators
9 days ago Added label: resolved