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

[Bug] 随机出现 expand_v2shape 不匹配问题 #69884

Open
megemini opened this issue Dec 2, 2024 · 3 comments
Open

[Bug] 随机出现 expand_v2shape 不匹配问题 #69884

megemini opened this issue Dec 2, 2024 · 3 comments
Assignees
Labels
PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc status/new-issue 新建 type/bug-report 报bug

Comments

@megemini
Copy link
Contributor

megemini commented Dec 2, 2024

bug描述 Describe the Bug

# paddlepaddle 3.0beta 或者 dev 版本
import paddle

paddle.set_device('cpu') # gpu 也会出现同样问题

index_a = 2
index_b = 3

a = paddle.zeros([index_a, index_b])
b = paddle.rand([index_a, index_b]) > 0.5
fake = paddle.rand(a[b].shape)
# breakpoint()
a[b] = fake
print('-'*20)

随机出现 expand_v2shape 不匹配问题:

aistudio@jupyter-942478-8569537:~$ pip list | grep paddle
paddle2onnx         1.1.0
paddlepaddle-gpu    0.0.0.post118
aistudio@jupyter-942478-8569537:~$ python test_indices.py 
Traceback (most recent call last):
  File "test_indices.py", line 12, in <module>
    a[b] = fake
  File "/home/aistudio/.local/lib/python3.8/site-packages/paddle/base/dygraph/tensor_patch_methods.py", line 1002, in __setitem__
    return self._setitem_dygraph(item, value)
ValueError: (InvalidArgument) The value (2) of the non-singleton dimension does not match the corresponding value (3) in shape for expand_v2 op.
  [Hint: Expected vec_in_dims[i] == expand_shape[i], but received vec_in_dims[i]:2 != expand_shape[i]:3.] (at /paddle/paddle/phi/kernels/impl/expand_kernel_impl.h:65)

aistudio@jupyter-942478-8569537:~$ python test_indices.py 
--------------------
aistudio@jupyter-942478-8569537:~$ python test_indices.py 
--------------------
aistudio@jupyter-942478-8569537:~$ python test_indices.py 
Traceback (most recent call last):
  File "test_indices.py", line 12, in <module>
    a[b] = fake
  File "/home/aistudio/.local/lib/python3.8/site-packages/paddle/base/dygraph/tensor_patch_methods.py", line 1002, in __setitem__
    return self._setitem_dygraph(item, value)
ValueError: (InvalidArgument) The value (4) of the non-singleton dimension does not match the corresponding value (3) in shape for expand_v2 op.
  [Hint: Expected vec_in_dims[i] == expand_shape[i], but received vec_in_dims[i]:4 != expand_shape[i]:3.] (at /paddle/paddle/phi/kernels/impl/expand_kernel_impl.h:65)

paddle 2.5 版本未出现同样问题。

aistudio 环境可稳定复现此偶发问题 ~ 多位同学已复现 ~

@zxcd @SigureMo @Liyulingyue @GreatV

其他补充信息 Additional Supplementary Information

No response

@paddle-bot paddle-bot bot added the PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc label Dec 2, 2024
@lijialin03
Copy link
Contributor

我们正在联系相关人员解决,感谢您的反馈~

@lijialin03
Copy link
Contributor

您好,相关人员反馈该问题几天前已修复,详见此PR #69480 ,经验证已解决,可以尝试重拉最新版本的develop版本的paddle,感谢您的反馈

@megemini
Copy link
Contributor Author

megemini commented Dec 3, 2024

感谢!经验证,新的 dev 版本暂未遇到问题 ~

官网的 dev 版本链接换掉了,之前不知道 ... ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc status/new-issue 新建 type/bug-report 报bug
Projects
None yet
Development

No branches or pull requests

2 participants