Skip to content

Wrong definition in CUDA operator file src/sptr/attention/attention_cuda_kernel.cu #5

@COMoER

Description

@COMoER

First, thanks for your sharing! However, when reading your code, I think that there may be some mistakes in src/sptr/attention/attention_cuda_kernel.cu, as following:

   // start from h83
    int n_h = blockDim.x;
    int h_idx = blockIdx.y * n_h + threadIdx.y;

According to definition of thread size dim3 threads(hdim, n_h);, blockDim.x is hdim while n_h is blockDim.y. And this mistake will not cause the program error when n_h=h because in that case, blockIdx.y will always be 0 since the y size of blocks is 1.
Maybe there are some mistakes in my analysis. If you agree with my opinion, please fix this.
Looking forward to your reply!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions