Closed
[Bug-Report|缺陷反馈]: docs/zh/api/appendix/ 下的矢量计算接口边界值说明文档存在多处错误与不完整 #1785
CruiterAdd on  Sep 23Closed at  Sep 24
Cruiter
CruiterCollaborators
Sep 23 Create

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Describe the current behavior / 问题描述 (Mandatory / 必填)

docs/zh/api/appendix/ 下的矢量计算接口边界值说明文档存在多处错误与不完整,具体如下。

  1. 修正错误的边界输出值
    文档 接口对 项目
    memory half/int16_t MAX / +inf
    memory half/int16_t MIN / -inf
    memory int16_t/float MAX
    reg half/int16_t MIN
    reg half/int16_t MAX
    reg bfloat16_t/fp8_e8m0_t MIN / MAX
    reg fp8_e8m0_t/bfloat16_t MAX
    half 的 MAX 为 65504,但转换为 int16_t 时应受目标类型范围约束,原表直接照搬源类型最大值,数值超出目标类型表示范围;bfloat16_t/fp8_e8m0_t 的量级存在 100 倍量级错误。
  2. 缺失舍入模式差异说明
    int16_t/half、int32_t/float、int64_t/float、float/bfloat16_t 等 CAST 类转换,其边界输出会随舍入模式变化(如 CAST_RINT/CAST_CEIL/CAST_ROUND/CAST_NONE 与 CAST_FLOOR/CAST_TRUNC 结果不同),原文档仅给出单一数值,未体现该差异,易导致用户对该接口边界行为产生误判。
  3. 表格冗余与合并描述不当
  • memory 文档中 -inf/+0 条件被重复书写。
  • memory 文档末尾 int16_t/int8_t、int16_t/uint8_t 行重复。
  • reg 文档将 int16_t/half 与 int16_t/int32_t、int16_t/float 合并为一行,但二者舍入行为不同,应拆分描述。
    影响
    开发者依据该文档进行边界值比对或精度验证时,会得到与算子实际行为不一致的预期值,可能导致误判为算子精度问题。

Environment / 环境信息 (Mandatory / 必填)

  • 硬件形态(受影响型号,文档声明生效范围):
    • memory_vector_compute_interface_boundary_value_summary.md:Atlas A3 系列产品、Atlas A2 系列产品
    • reg_vector_compute_interface_boundary_value_summary.md:Ascend 950PR & 950DT 系列产品
  • HDK 版本:不涉及(纯文档问题,无需硬件复现)
  • CANN 版本:asc-devkit 仓版本 9.2.0(version.cmake)

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

(1)目标类型范围越界 —— memory 表32「Cast特殊值/边界值输入」

行号 条目 文档值(错误) 正确值
1415 half/int16_t MAX 65504 32767
1416 half/int16_t MIN -65504 -32768
1419 half/int16_t +inf 65504 32767
1420 half/int16_t -inf -65504 -32768
1436 int16_t/float MAX 32768.00 32767.00

复现判断:int16_t 表示范围为 [-32768, 32767],half→int16_t 的边界输出不可能为 65504/-65504,源类型 half 的 MAX/MIN 被错误沿用到目标类型。

(2)缺失舍入模式差异

文档 行号 条目 文档值(错误/不完整)
memory 1433 int16_t/half MAX 32768.00(未区分舍入模式)
memory 1456 int32_t/float MAX 2147483520.00(未区分舍入模式)
memory 1465 float/bfloat16_t MAX/MIN +inf / -inf(未区分舍入模式)
memory 1499 int64_t/float MAX 9223372036854775808.00(未区分舍入模式)
reg 1642-1643 int16_t/int32_t,int16_t/float<br>int16_t/half half 与 int32_t/int16_t/float 舍入行为不同,被合并为一行
reg 1656-1657 int64_t/float MIN/MAX 输出为空(&nbsp;),应补充舍入模式相关值
reg 1737-1738 half/int16_t MIN/MAX -32768 / 32767(未体现舍入模式差异)

复现判断:CAST_RINT/CAST_CEIL/CAST_ROUND/CAST_NONE 与 CAST_FLOOR/CAST_TRUNC 下边界输出不同,应为两套值。

(3)表格冗余与量级错误

文档 行号 问题
memory 1421-1422 -inf/+0 条件重复书写
memory 1501-1504 int16_t/int8_t、int16_t/uint8_t 行与表内其他条目重复
reg 1797-1798 bfloat16_t/fp8_e8m0_t MIN/MAX 为 1.70141e+40,应为 1.70141e+38(10^2 量级错误)
reg 1807 fp8_e8m0_t/bfloat16_t MAX 同上

Describe the expected behavior / 预期结果 (Mandatory / 必填)

实际结果应与表格一致

暂无

Special notes for this issue/备注 (Optional / 选填)

likedislike
CruiterCruiterCollaborators
Sep 23 Added label: bug-report
CruiterCruiterCollaborators
Sep 23 Assign printfscanfmain as responsible person
CruiterCruiterCollaborators
Sep 23 Change title to "[Bug-Report|缺陷反馈]: docs/zh/api/appendix/ 下的矢量计算接口边界值说明文档存在多处错误与不完整", originally titled "[Bug-Report|缺陷反馈]: ".
CruiterCruiterCollaborators
Sep 23 Associated pull request
Cruiter
CruiterCollaborators
Sep 24 Comments:

最新主线中该问题已解决,本issue将关闭

likedislike
CruiterCruiterCollaborators
Sep 24 changed custom state from 待办的 to 已完成
CruiterCruiterCollaborators
Sep 24 Close issue