Closed
[Question|问题咨询]: 【Green Light】kernel返回reshape后的Tensor时报错 #321
zhanghedongAdd on  Feb 3Closed at  Mar 17
zhanghedong
zhanghedongCollaborators
Feb 3 Create

Welcome to ask questions and discuss with other members.

问题描述

代码样例:
@pypto.frontend.jit(runtime_options={"run_mode": mode})
def kernel(
x: pypto.Tensor(x_shape, pypto.DT_FP32),
) -> (
pypto.Tensor([4, 2, 4], pypto.DT_FP32),
):
pypto.set_vec_tile_shapes(4, 8)
y = pypto.reshape(x, [x.shape[0], 2, -1])
print("y shape", y.shape)
return y
return kernel

报错信息:

y shape [4, 2, 4]
ErrorTracking callback in, task_id = 0, stream_id = 46.
[ERROR] Exception Type: exception aicore error
taskid: 0, streamid: 46, tid: 134537, deviceid: 0, retcode: 507015
kernelName = tilefwk_0_mix_aic
[E203 20:00:25.690028049 compiler_depend.ts:444] operator():build/CMakeFiles/torch_npu.dir/compiler_depend.ts:52 NPU function error: call aclnnMaskedSelect failed, error code is 507015
[ERROR] 2026-02-03-20:00:25 (PID:134537, Device:0, RankID:-1) ERR00100 PTA call acl api failed
[Error]: The aicore execution is abnormal.
Rectify the fault based on the error information in the ascend log.
EZ9999: Inner Error!
EZ9999[PID: 134537] 2026-02-03-20:00:25.365.102 (EZ9999): The error from device(chipId:6, dieId:0), serial number is 40, there is an exception of fftsplus aivector error, core id is 13, error code = 0x200000000, dump info: pc start: 0x124000000a10, current: 0x124000000f3c, vec error info: 0x2111908418, mte error info: 0x200000048, ifu error info: 0x682f2f56b8e00, ccu error info: 0xc58f94c93278cee0, cube error info: 0, biu error info: 0, aic error mask: 0x6500020bd00028c, para base: 0x12c100002080.[FUNC:PrintCoreInfo][FILE:device_error_core_proc.cc][LINE:645]
TraceBack (most recent call last):
The extend info: errcode:(0x200000000, 0, 0) errorStr: The write address of the MTE instruction is out of range. fixp_error0 info: 0x48, fixp_error1 info: 0x2, fsmId:1, tslot:0, thread:0, ctxid:0, blk:7, sublk:0, subErrType:4.[FUNC:PrintCoreInfo][FILE:device_error_core_proc.cc][LINE:658]
Kernel task happen error, retCode=0x26, [aicore exception].[FUNC:PreCheckTaskErr][FILE:davinci_kernel_task.cc][LINE:1498]
rtStreamSynchronize execution failed, reason=aicore exception[FUNC:FuncErrorReason][FILE:error_message_manage.cc][LINE:65]
synchronize stream failed, runtime result = 507015[FUNC:ReportCallError][FILE:log_inner.cpp][LINE:148]
aclrtSynchronizeStream failed. stream: 0xaaab199d2950
Kernel Run failed. opType: 7, MaskedSelectV3
launch failed for MaskedSelectV3, errno:507015.

likedislike
杨旭
杨旭Collaborators
Feb 3 Comments:

Hi,该问题应该是 torch_npu 的报错,请确认使用环境是否在支持范围内的同时,请看一下 torch_npu 版本是否正确。

likedislike
liulufang_gitcode
liulufang_gitcodeCollaborators
Feb 5 Comments:

y = pypto.reshape(x, [x.shape[0], 2, -1])
reshape的入参传入了值为-1 的shape,新前端未适配这种推导,导致后续处理出错

likedislike
杨旭杨旭Collaborators
Feb 6 associated Kanban: PyPTO
liulufang_gitcodeliulufang_gitcodeCollaborators
Feb 9 Associated pull request
liulufang_gitcode
liulufang_gitcodeCollaborators
Feb 10 Comments:

hello,修复代码已上库,请再确认下是否解决该问题

likedislike
杨旭
杨旭Collaborators
Mar 17 Comments:

本问题暂时关闭,如有任何疑问,欢迎再次交流~

likedislike
杨旭杨旭Collaborators
Mar 17 Assign DCGDDD as responsible person
杨旭杨旭Collaborators
Mar 17 changed custom state from 进行中 to 已完成
杨旭杨旭Collaborators
Mar 17 Close issue