Closed
[Question|问题咨询]: [add_layer_norm] tiling UB 预算计算中常驻参数计算不合理 #7213
nio006Add on Oct 22Closed at 17 days ago
Oct 22 Added label: question
yuning_chen
Oct 22 Comments:
Oct 22 Comments:
Oct 22 Assign wangpengbo26 as responsible person
yuning_chen
Oct 22 Comments:
Oct 22 Comments:
您好,该问题已收到,当前问题 @liujie12345678 处理中


Oct 22 Removed responsible person wangpengbo26
Oct 22 Assign liujie12345678 as responsible person
Oct 23 Assign liuyun_nj as responsible person
17 days ago changed custom state from 进行中 to 已完成
17 days ago Close issue
问题描述
AddLayerNormTilingImpl(norm/add_layer_norm/op_host/add_layer_norm_tiling.cpp)计算 UB 预算时,gamma/beta/bias 常驻项统一乘了bufferNum;当前
bufferNum硬编码为 1(tiling.cpp:608,kernel 模板BUFFER_NUM = 1默认值),无功能影响;若未来启用双缓冲(bufferNum=2),BetterUB/SPECIAL_REDUCE 分支将高估权重固定开销——方向保守(不会 UB 溢出),但导致rowPerTime偏小、单趟少算行,且公式误导读者以为权重参与流水轮转。gamma/beta/bias 是循环不变量:
Process()开头加载一次(add_layer_norm_normal_special_reduce.h:146-154),全核所有迭代复用,不参与 CopyIn→Compute→CopyOut 轮转,双缓冲对其无意义。建议删除计算beta、gamma、bias的buffersize时,删除乘以bufferNum。