Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault on trivial transpose #34220

Closed
arogozhnikov opened this issue Jul 17, 2021 · 6 comments
Closed

Segfault on trivial transpose #34220

arogozhnikov opened this issue Jul 17, 2021 · 6 comments
Assignees
Labels
status/close 已关闭

Comments

@arogozhnikov
Copy link

arogozhnikov commented Jul 17, 2021

System information
-PaddlePaddle version 2.1.1
-CPU: including CPUMKL/OpenBlas/MKLDNN version
-GPU: not used
-OS Platform and Distribution: Mac OS 10.15
-Python version: 3.9.0
Note: You can get most of the information by running summary_env.py.

To Reproduce
See code below. Paddlepaddle doesn't handle zero-dimensional tensors (same issue as in mxnet v1, now fixed)

Describe your current behavior

Code segfaults.

[1]    71657 segmentation fault  ipython

Code to reproduce the issue

import paddle

paddle.zeros([]).transpose([]) # should return 0-dimensional tensor with 1 element, basically transpose should do nothing

paddle.zeros([]).reshape([]) # should return 0-dimensional tensor with 1 element, basically reshape should do nothing

Other info / logs

Support for zero-dimensional tensor is a hard requirement for inclusion for einops support.

Currently paddlepaddle can't pass the tests due to this issue

@paddle-bot-old
Copy link

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网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!

@joey12300
Copy link
Contributor

@arogozhnikov thanks for providing details about processing zero-dimensional tensor in transpose (reshape). We will upgrade the ability of processing zero-dimensional tensor in future. :)

@IcarusWizard
Copy link
Contributor

Hi, @joey12300. I am also very interested in intergrade paddle to einops. paddle.zeros([]).transpose([]) seems fixed in paddlepaddle==2.2.0, but paddle.zeros([]).reshape([]) still get error:

ValueError: (InvalidArgument) The parameter 'shape' in ReshapeOp must be set. But received 'shape' is empty.
  [Hint: Expected !shape.empty() == true, but received !shape.empty():0 != true:1.] (at /paddle/paddle/fluid/operators/reshape_op.cc:135)
  [operator < reshape2 > error]

@luotao1
Copy link
Contributor

luotao1 commented Sep 1, 2022

@IcarusWizard

I am also very interested in intergrade paddle to einops.

Thanks very much for your interest. We try to intergrade paddle to einops in arogozhnikov/einops#122 by @jm12138 before, but since paddle doesn't support zero-dimensional tensor, this PR could not pass the einops CI.

@zhouwei25 is doing zero-dimensional tensor related work now. Since it may cause incompatibility, related work is still under discussion and pending review. #45627 (comment)

@zhwesky2010
Copy link
Contributor

zhwesky2010 commented Sep 15, 2022

@arogozhnikov Thanks for asking questions. Plan 0D tensor has passed the Internal review and is under development. We will support transpose and reshape 0D before 2022/10/20

@zhwesky2010
Copy link
Contributor

zhwesky2010 commented Oct 11, 2022

@arogozhnikov Thanks, Are you interested in supporting paddle as the backend for einops, we have fixed the prolem mentioned above in #46555 . And are there any other problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/close 已关闭
Projects
None yet
Development

No branches or pull requests

5 participants