Ascend950 上 Softsign 的 AscendC 实现存在以下两个问题:
abs(x) + 1
tf.nn.softsign
(0,)
blockDim=1
ElementwiseSch
OnDynProfiling
cann/ops-nn
activation/softsign
tf.bfloat16
close
y = x / (1 + abs(x))
--compare close
Describe the current behavior / 问题描述 (Mandatory / 必填)
Ascend950 上 Softsign 的 AscendC 实现存在以下两个问题:
abs(x) + 1,直到最终输出才回落到原 dtype。TensorFlowtf.nn.softsign会在低精度路径中保留原 dtype 的中间舍入,因此部分边界数据与 TensorFlow 结果不一致。(0,))时,Host 侧设置blockDim=1后返回,Kernel 仍进入ElementwiseSch调度,kernel 直调会停留在OnDynProfiling,无法正常结束。Environment / 环境信息 (Mandatory / 必填)
cann/ops-nnmaster,activation/softsigntf.nn.softsignSteps to reproduce the issue / 重现步骤 (Mandatory / 必填)
tf.nn.softsign作为 Golden;BF16 输入直接构造为tf.bfloat16,不升精度计算。close比较,可观察到低精度边界数据不一致。(0,)输入并进行 kernel 直调,可观察到任务停留在OnDynProfiling。y = x / (1 + abs(x))。低精度路径需要在abs(x) + 1后先舍入回输入 dtype,再继续后续计算。Describe the expected behavior / 预期结果 (Mandatory / 必填)
tf.nn.softsign一致。Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
OnDynProfiling,AIC 占用持续为 100%,plog 中没有额外硬件异常或错误码。--compare close为 500/500 PASS;FP32/FP16/BF16 空 Tensor 专项为 3/3 PASS;标量专项为 3/3 PASS。Special notes for this issue/备注 (Optional / 选填)