Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
MhcPre算子使用脚本对T=1159或T=934的shape进行1000次批跑时偶现卡死。
CANN 9.1.0 torch_npu 2.7.1
使用脚本批跑:
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("全部完成")
预期应全部完成,中间没有报错
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 / 必填)
预期应全部完成,中间没有报错
Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
Special notes for this issue/备注 (Optional / 选填)