Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

int64类型的matmul操作报错。

Open Tlntin opened this issue 3 years ago • 2 comments

bug描述 Describe the Bug

代码

import paddle
x1 = paddle.Tensor(np.arange(9).reshape(3, 3))
y1 = paddle.Tensor(np.arange(12).reshape(3, 4))
z = paddle.matmul(x1, y1)

报错内容

NotFoundError: Operator matmul_v2 does not have kernel for {data_type[int64_t]; data_layout[Undefined(AnyLayout)]; place[Place(gpu:0)]; library_type[PLAIN]}.
  [Hint: Expected kernel_iter != kernels.end(), but received kernel_iter == kernels.end().] (at /home/ubuntu/Documents/Paddle/paddle/fluid/imperative/prepared_operator.cc:419)
  [operator < matmul_v2 > error]

临时解决方案

  • 将数据改成float32
z = paddle.matmul(paddle.cast(x1, paddle.float32), paddle.cast(y1, paddle.float32))

建议解决方案

  • 重写一下matmul_v2 算子,增加int64类型计算,顺便检查一下其它类型是否有类似错误。

其他补充信息 Additional Supplementary Information

我的环境

  • ubuntu 22.04
  • cuda11.6, cudnn8.4.1
  • paddle-gpu-2.3.1
  • python 3.9.12

Tlntin avatar Jul 28 '22 04:07 Tlntin

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档常见问题历史IssueAI社区来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

paddle-bot[bot] avatar Jul 28 '22 04:07 paddle-bot[bot]

您好,感谢反馈哈~

ceci3 avatar Jul 28 '22 05:07 ceci3

Since you haven't replied for more than a year, we have closed this issue/pr. If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up. 由于您超过一年未回复,我们将关闭这个issue/pr。 若问题未解决或有后续问题,请随时重新打开,我们会继续跟进。

paddle-bot[bot] avatar Aug 15 '23 06:08 paddle-bot[bot]