Paddle [BUG Report] gather index bug

gev0vcfq  于 5个月前  发布在  其他
关注(0)|答案(2)|浏览(48)

bug描述 Describe the Bug

环境 AISTUIDIO paddle2.4.0

当 gather 中的 axis=-1 且 输入张量是一维时,会报 cuda error

import paddle

a = paddle.rand([1000])
idx = paddle.to_tensor([2])
print(paddle.gather(a, idx, -1))
Error: /paddle/paddle/phi/kernels/funcs/gather.cu.h:193 Assertion `index_val >= 0 && index_val < input_index_dim_size` failed. The index is out of bounds, please check whether the dimensions of index and input meet the requirements. It should be less than [0] and greater than or equal to 0, but received [0]
......
Error: /paddle/paddle/phi/kernels/funcs/gather.cu.h:193 Assertion `index_val >= 0 && index_val < input_index_dim_size` failed. The index is out of bounds, please check whether the dimensions of index and input meet the requirements. It should be less than [0] and greater than or equal to 0, but received [0]
Error: /paddle/paddle/phi/kernels/funcs/gather.cu.h:193 Assertion `index_val >= 0 && index_val < input_index_dim_size` failed. The index is out of bounds, please check whether the dimensions of index and input meet the requirements. It should be less than [0] and greater than or equal to 0, but received [0]
Error: /paddle/paddle/phi/kernels/funcs/gather.cu.h:193 Assertion `index_val >= 0 && index_val < input_index_dim_size` failed. The index is out of bounds, please check whether the dimensions of index and input meet the requirements. It should be less than [0] and greater than or equal to 0, but received [0]
Traceback (most recent call last):
  File "x.py", line 5, in <module>
    print(paddle.gather(a, idx, -1))
  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/varbase_patch_methods.py", line 625, in __str__
    return tensor_to_string(self)
  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/tensor/to_string.py", line 350, in tensor_to_string
    data = _format_dense_tensor(tensor, indent)
  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/tensor/to_string.py", line 271, in _format_dense_tensor
    np_tensor = tensor.numpy()
OSError: (External) CUDA error(719), unspecified launch failure. 
  [Hint: Please search for the error code(719) on website (https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1g3f51e3575c2178246db0a94a430e0038) to get Nvidia's official solution and advice about CUDA Error.] (at /paddle/paddle/phi/backends/gpu/cuda/cuda_info.cc:259)

其他补充信息 Additional Supplementary Information

No response

mw3dktmi

mw3dktmi1#

好的 谢谢 我这边先复现一下

euoag5mw

euoag5mw2#

请问这个问题要怎么解决?

相关问题