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

bool + id的混合索引赋值在FLAGS_use_stride_kernel=0开关情况下行为不一致 #70585

Open
dynamicheart opened this issue Jan 2, 2025 · 1 comment
Assignees

Comments

@dynamicheart
Copy link
Contributor

dynamicheart commented Jan 2, 2025

bug描述 Describe the Bug

复现代码:

import paddle
import numpy as np

position_ids = paddle.to_tensor(np.load('position_ids.npy')).reshape((3, 1, -1))
attention_mask = paddle.to_tensor(np.load('attention_mask.npy')).reshape((1, -1))
llm_positions = paddle.to_tensor(np.load('llm_positions.npy')).reshape((3, -1))

position_ids[..., 0, attention_mask[0] == 1] = llm_positions

print(position_ids)

输入数据:inputs.zip

FLAGS_use_stride_kernel=0输出:

Tensor(shape=[3, 1, 3985], dtype=int64, place=Place(gpu:0), stop_gradient=True,
       [[[1, 1, 1, ..., 1, 1, 1]],

        [[1, 1, 1, ..., 1, 1, 1]],

        [[1, 1, 1, ..., 1, 1, 1]]])

FLAGS_use_stride_kernel=1输出:

Tensor(shape=[3, 1, 3985], dtype=int64, place=Place(gpu:0), stop_gradient=True,
       [[[0 , 1 , 2 , ..., 44, 45, 46]],

        [[0 , 1 , 2 , ..., 44, 45, 46]],

        [[0 , 1 , 2 , ..., 44, 45, 46]]])

其他补充信息 Additional Supplementary Information

No response

@sunzhongkai588
Copy link
Contributor

@LokeZhou 跟进一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants