Closed
SIMT expf/sqrtf/除法函数不支持 subnormal 模式导致特殊场景精度异常 #1487
xuyiyangAdd on Aug 12Closed at Aug 25
Aug 12 Modify description of issue
Aug 12 Assign xuyiyang0324 as responsible person
Aug 12 Associated pull request
Aug 12 Associated pull request
xuyiyang
Aug 18 Comments:
Aug 18 Comments:
@xuyiyang 我们会在impl/simt_api/math_functions_impl.h中,将expf和sqrtf接口实现修改,根据编译宏状态来控制代码逻辑走不同的分支,实现支持subnormal场景和sqrt高精度场景。


Aug 25 changed custom state from 进行中 to 已完成
Aug 25 Close issue
xuyiyang
Aug 25 Comments:
Aug 25 Comments:
@xuyiyang 代码已经合入,相关pr:https://gitcode.com/cann/asc-devkit/pull/4722


Aug 25 Added label: resolved
从 A5 架构开始,SIMT API 中部分基础数学运算/函数对 subnormal number支持不完整,包括但不限于:
expfsqrtf/、__fdividef、fdividef在输入或中间结果落入 subnormal 范围时,结果可能被 flush-to-zero,导致与 IEEE-754 预期结果或 host/libm 参考结果存在明显偏差。在部分特殊数值场景下,会进一步放大为精度问题。
影响范围
floatexpf(float)sqrtf(float)a / b__fdividef(float, float)fdividef(float, float)期望结果
希望社区确认并补充以下内容:
A5 及之后架构中,SIMT expf、sqrtf、浮点除法是否确实不支持 subnormal 模式。
如果是架构限制,是否可以在文档中明确说明:
如果可以通过软件补偿修复,希望 SIMT API 层提供统一实现,例如: