已关闭
[Bug-Report|缺陷反馈]: 矩阵乘法运行报错 #1451
mandolin创建于  8月6日关闭于  8月7日
mandolin
8月6日 创建

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

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

参考矩阵乘法实例出错:

参考代码:https://gitcode.com/cann/asc-devkit/blob/master/examples/01_simd_cpp_api/00_introduction/02_matrix/matmul_advanced_api/README.md

原示例是半浮点相乘,我把输入矩阵换成int8时就报错,运行硬件是310P3

代码及日志见gitee:https://gitee.com/luyaoo/ascend_matmul

运行出错日志:

matmul_int8/matmul_advanced_api.asc FUNC: aclrtSynchronizeStream(stream) LINE: 157, acl error, errorCode = 507015, EZ9999: Inner Error!

VEC instruction error: the destination blocks have the same address.[FUNC:PrintCoreErrorInfo][FILE:device_error_core_proc.cc][LINE:227]

DEVICE[0] PID[3809974]:

EXCEPTION STREAM:

Exception info:TGID=3809974, model id=65535, stream id=20, stream phase=SCHEDULE

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

+--------------------------------------------------------------------------------------------------------+
| npu-smi 26.0.rc1 Version: 26.0.rc1 |
+-------------------------------+-----------------+------------------------------------------------------+
| NPU Name | Health | Power(W) Temp(C) Hugepages-Usage(page) |
| Chip Device | Bus-Id | AICore(%) Memory-Usage(MB) |
+===============================+=================+======================================================+
| 3 310P3 | OK | NA 45 0 / 0 |
| 0 12 | 0000:2F:00.0 | 0 1344 / 44278 |
+-------------------------------+-----------------+------------------------------------------------------+
| 3 310P3 | OK | NA 44 0 / 0 |
| 1 13 | 0000:2F:00.0 | 0 1616 / 43693 |
+===============================+=================+======================================================+

ii ascend-cann-310p-ops 9.1.0-beta.3 arm64 ascend-cann-310p-ops
ii ascend-cann-nnal 9.1.0-beta.3 arm64 ascend-cann-nnal
ii ascend-cann-toolkit 9.1.0-beta.3 arm64 ascend-cann-toolkit
ii ascend310p-driver 26.0.rc1 arm64 Huawei Ascend310P Driver

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

代码及日志见gitee:https://gitee.com/luyaoo/ascend_matmul
日志在log目录下

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

得到正确的Int8矩阵乘法结果

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

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

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

likedislike
pandengpandeng成员
8月7日 将 myx_32 设为负责人
myx_32成员
8月7日 评论:

参考代码:https://gitcode.com/cann/asc-devkit/blob/master/examples/01_simd_cpp_api/00_introduction/02_matrix/matmul_advanced_api/README.md
原示例标注支持的产品不包含 310P3 (Atlas 推理系列产品),无法直接搬运使用

likedislike
mandolin
8月7日 评论:

根据文档 Matmul 算子是支持推理卡int8 矩阵相乘的: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendcopapi/atlasascendc_api_07_0614.html

我的测试代码是根据文档写的,代码使用接口也符合规范,但是报错

2026-08-07 11-41-27屏幕截图.png

likedislike
mandolin
8月7日 评论:

参考代码:https://gitcode.com/cann/asc-devkit/blob/master/examples/01_simd_cpp_api/00_introduction/02_matrix/matmul_advanced_api/README.md
原示例标注支持的产品不包含 310P3 (Atlas 推理系列产品),无法直接搬运使用

@myx_32

likedislike
mandolin
8月7日 评论:

参考代码:https://gitcode.com/cann/asc-devkit/blob/master/examples/01_simd_cpp_api/00_introduction/02_matrix/matmul_advanced_api/README.md
原示例标注支持的产品不包含 310P3 (Atlas 推理系列产品),无法直接搬运使用

@myx_32

多谢,310P3需要用旧的示例能跑通:https://gitee.com/ascend/samples/tree/master/operator/ascendc/tutorials/MatmulCustomSample/KernelLaunch

likedislike
Mmandolin
8月7日 issue状态由 待办的 改变为 已完成
Mmandolin
8月7日 关闭了 issue
CANN-robotCANN-robot成员
8月7日 添加了label:Accepted