已关闭
[Bug-Report|缺陷反馈]: [clipped_swiglu_grad] kernel含SyncAll但tiling未设置SetScheduleMode(1),存在死锁风险 #5800
tangweiwei2创建于 22 天前关闭于 9 天前
22 天前 添加了label:bug-report
22 天前 将 tangweiwei2 设为负责人
20 天前 关联了pull request:fix(tiling): 为含 SyncAll 的 kernel 补齐 SetScheduleMode(1)
问题描述 / Describe the current behavior
clipped_swiglu_grad的 kernel 在 arch35(Ascend950)路径上执行SyncAll(),但 tiling 从未调用SetScheduleMode(1)(batch mode)。未设 batch mode 时 block 分波启动,SyncAll等待全量 block,在 blockDim 超过可用核数或多流共享核资源场景下会死锁。activation/clipped_swiglu_grad/op_kernel/clipped_swiglu_grad_base.h:133——ClippedSwigluGradSchedBase::Process()主循环后无条件调用SyncAll()op_kernel/arch35/clipped_swiglu_grad_kernel.h中ClippedSwigluGradArch35Kernel继承SchedBase且未覆写Process(),launch 处直接调op.Process()→ 执行基类 Process 中的 SyncAllactivation/clipped_swiglu_grad/op_host/clipped_swiglu_grad_tiling.cpp全文无SetScheduleMode;且SetBlockDim(coreNumAll_)使用全部核,batch mode 对 SyncAll 正确性尤为关键环境信息 / Environment
cc067338f,非 experimental 目录__CCE_AICORE__ == 310)路径重现步骤 / Steps to reproduce
clipped_swiglu_grad_base.h:133的SyncAll()位于SchedBase::Process(),arch35 kernel 继承执行,无任何条件保护;clipped_swiglu_grad_tiling.cpp无SetScheduleMode调用;预期结果 / Describe the expected behavior
kernel 含 SyncAll 的分支,其对应 tiling 应设置
context->SetScheduleMode(1)(batch mode),保证所有 block 同时启动。修复方式参考仓内惯例(如unsorted_segment_sum、embedding_hash_table_export):context->SetScheduleMode(1); // kernel 使用 SyncAll,需设置为 batch mode,所有核同时启动日志 / 截图 / Related log
静态扫描结论(无运行日志)。注:910B 路径(
clipped_swiglu_grad.h的ClippedSwigluGradBase)同样继承该 Process,本问题实际影响 arch35 与 910B 两个路径。备注 / Special notes
norm/bn_training_update_grad.h:353注释引用本算子为"SyncAll 裸调用先例",但正确做法应如 foreach_norm(由foreach_utils/op_host/foreach_reduce_regbase_tiling.cpp:315设置 mode 1)。