在 A5 平台测试 pto.vmi.vneg 的非 mask 整数场景时,PTOAS 原生框架文档和 verifier 均表明 vneg 支持 i8、i16 和 i32 类型。
@jit_kernel(name, params)
def kernel(
src_ptr: pto.ptr(dtype, "gm"),
dst_ptr: pto.ptr(dtype, "gm"),
):
src_ub = pto.castptr(
pto.i64(0),
pto.ptr(dtype, "ub"),
)
dst_ub = pto.castptr(
pto.i64(nbytes),
pto.ptr(dtype, "ub"),
)
pto.mte_gm_ub(
src_ptr,
src_ub,
0,
nbytes,
nburst=(1, 0, 0),
)
pto.set_flag("MTE2", "V", event_id=0)
pto.wait_flag("MTE2", "V", event_id=0)
source = pto.vmi.vload(
src_ub,
pto.const(0, dtype=pto.index),
size=vl,
)
result = pto.vmi.vneg(source)
pto.vmi.vstore(
result,
dst_ub,
pto.const(0, dtype=pto.index),
)
pto.set_flag("V", "MTE3", event_id=0)
pto.wait_flag("V", "MTE3", event_id=0)
pto.mte_ub_gm(
dst_ub,
dst_ptr,
nbytes,
nburst=(1, 0, 0),
)
报错日志:
'pto.vmi.negi' op requires all layout-assigned VMI data values to have the same layout
报错场景:
对于以下合法的 i8/i16/i32 非 mask 用例出现报错
i8 VL=1
i8 VL=64
i8 VL=128
i16 VL=1
i16 VL=64
i32 VL=1
且相同代码的vnot能通过,不出现报错
失败用例(可在测试框架复现):
vmi_vneg_i8_vl1_g1_a1_n_nomask
vmi_vneg_i8_vl64_g1_a64_n_nomask
vmi_vneg_i8_vl128_g1_a128_n_nomask
vmi_vneg_i16_vl1_g1_a1_n_nomask
vmi_vneg_i16_vl64_g1_a64_n_nomask
vmi_vneg_i32_vl1_g1_a1_n_nomask
Component
PTO Dialect / ODS (include/PTO/IR)
Description
在 A5 平台测试 pto.vmi.vneg 的非 mask 整数场景时,PTOAS 原生框架文档和 verifier 均表明 vneg 支持 i8、i16 和 i32 类型。
Reproduction (minimal)
@jit_kernel(name, params) def kernel( src_ptr: pto.ptr(dtype, "gm"), dst_ptr: pto.ptr(dtype, "gm"), ): src_ub = pto.castptr( pto.i64(0), pto.ptr(dtype, "ub"), ) dst_ub = pto.castptr( pto.i64(nbytes), pto.ptr(dtype, "ub"), ) pto.mte_gm_ub( src_ptr, src_ub, 0, nbytes, nburst=(1, 0, 0), ) pto.set_flag("MTE2", "V", event_id=0) pto.wait_flag("MTE2", "V", event_id=0) source = pto.vmi.vload( src_ub, pto.const(0, dtype=pto.index), size=vl, ) result = pto.vmi.vneg(source) pto.vmi.vstore( result, dst_ub, pto.const(0, dtype=pto.index), ) pto.set_flag("V", "MTE3", event_id=0) pto.wait_flag("V", "MTE3", event_id=0) pto.mte_ub_gm( dst_ub, dst_ptr, nbytes, nburst=(1, 0, 0), )Expected behavior
编译通过+运行通过
Actual behavior / error logs
Git commit
10883a8
Host platform
Linux (aarch64)
Target Ascend arch (if relevant)
a5
PTOAS build level (if relevant)
None