已关闭
[Bug-Report|缺陷反馈]: [max_pool3d_with_argmax_v2] arch35 big kernel含SyncAll但tiling未设置SetScheduleMode(1),存在死锁风险 #5805
tangweiwei2创建于  8 天前关闭于  7 天前
tangweiwei2成员
8 天前 创建

问题描述 / Describe the current behavior

max_pool3d_with_argmax_v2 的 arch35(Ascend950)big kernel(regbase 多核形态)在 Process() 中执行 SyncAll(),但对应 tiling 从未调用 SetScheduleMode(1)(batch mode)。未设 batch mode 时 block 分波启动,SyncAll 等待全量 block,在 blockDim 超过可用核数或多流共享核资源场景下会死锁。

  • kernel SyncAll 位置:pooling/max_pool3d_with_argmax_v2/op_kernel/arch35/max_pool3d_with_argmax_v2_big_kernel_regbase.h:870 —— 两阶段:各子核 MulCoreComputeLocal()(窗口 W 切分本地 max/index 写 workspace)→ SyncAll() → 每窗口 0 号子核 MulCoreReduceAndStore() 归约写出
  • 分支可达性:tiling op_host/max_pool3d_with_argmax_v2_tiling_big_kernel_regbase.cpp:351 返回 TILING_KEY_BIG_KERNEL_REGBASE_NCDHW 选中该 kernel,multiCoreNum_ 可大于 1(274-282 行按 kW/wSplitSize 切分)
  • tiling 缺失处:max_pool3d_with_argmax_v2_tiling_big_kernel_regbase.cpp 全文无 SetScheduleMode(该算子 op_host 其余 tiling 亦均无)

环境信息 / Environment

  • 代码扫描范围:ops-nn 仓 master 分支,commit cc067338f,非 experimental 目录
  • 目标形态:arch35(Ascend950 / __CCE_AICORE__ == 310)路径
  • 来源:由总体扫描 issue #5791 按算子粒度拆分

重现步骤 / Steps to reproduce

  1. 确认 kernel 侧:max_pool3d_with_argmax_v2_big_kernel_regbase.h:870SyncAll() 位于 Process 主路径;
  2. 确认 tiling 侧:max_pool3d_with_argmax_v2_tiling_big_kernel_regbase.cpp 选中该 kernel 但全文无 SetScheduleMode
  3. 运行态验证(可选):在 Ascend950 上构造大 kernel window(命中 BIG_KERNEL_REGBASE 分支、multiCoreNum>1)并多流并发调用,观察挂死。

预期结果 / Describe the expected behavior

kernel 含 SyncAll 的分支,其对应 tiling 应设置 context->SetScheduleMode(1)(batch mode),保证所有 block 同时启动。修复方式参考仓内惯例(如 unsorted_segment_sumembedding_hash_table_export):

context->SetScheduleMode(1); // kernel 使用 SyncAll,需设置为 batch mode,所有核同时启动

静态扫描结论(无运行日志)。

备注 / Special notes

likedislike
Ttangweiwei2成员
8 天前 添加了label:bug-report
Ttangweiwei2成员
8 天前 将 tangweiwei2 设为负责人
Xxieshengwei1024成员
8 天前 将 liuguoyue 设为负责人
CANN-robotCANN-robot成员
7 天前 关闭了 issue
Wwarming成员
7 天前 关联了pull request:MaxPool3dWithArgmaxV2算子含SyncAll模板tiling设置SetScheduleMode(1)
CANN-robotCANN-robot成员
6 天前 添加了label:resolved