已关闭
[Bug-Report|缺陷反馈]: MhcPre算子在T=1159等不对齐shape批跑1000次偶现卡死 #3009
liweijian16创建于  6月9日关闭于  6月10日
liweijian16成员
6月9日 创建

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Describe the current behavior / 问题描述 (Mandatory / 必填)

MhcPre算子使用脚本对T=1159或T=934的shape进行1000次批跑时偶现卡死。

Environment / 环境信息 (Mandatory / 必填)

CANN 9.1.0
torch_npu 2.7.1

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

使用脚本批跑:

import torch
import torch_npu

hidden_states = torch.randn(934, 4, 2560, dtype=torch.bfloat16)
phi_weight    = torch.randn(24, 10240, dtype=torch.float32)
branch_alpha  = torch.randn(3, dtype=torch.float32)
branch_beta   = torch.randn(24, dtype=torch.float32)
gamma         = torch.randn(4, 2560, dtype=torch.float32)

for i in range(100):
    print(f"=== 第 {i+1} 次 ===", flush=True)
    out, h_post, h_res, _, _, _ = torch_npu.npu_mhc_pre(
        hidden_states.npu(device=6),
        phi_weight.npu(device=6),
        branch_alpha.npu(device=6),
        branch_beta.npu(device=6),
        gamma=gamma.npu(device=6),
        out_flag=0,
    )
    torch.npu.synchronize(device=6)
    print(f"=== 第 {i+1} 次完成 ===", flush=True)

print("全部完成")

Describe the expected behavior / 预期结果 (Mandatory / 必填)

预期应全部完成,中间没有报错

image.png

Special notes for this issue/备注 (Optional / 选填)

likedislike
Lliweijian16成员
6月9日 添加了label:bug-report
Lliweijian16成员
6月9日 将 liweijian16 设为负责人
CANN-robotCANN-robot成员
6月10日 关闭了 issue
CANN-robotCANN-robot成员
6月10日 添加了label:resolved