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

Potential Data Race Identified in MatrixTransposeKernel #262

Open
zhenrongliew opened this issue Mar 5, 2024 · 2 comments
Open

Potential Data Race Identified in MatrixTransposeKernel #262

zhenrongliew opened this issue Mar 5, 2024 · 2 comments

Comments

@zhenrongliew
Copy link

Potential Data Race Identified in MatrixTransposeKernel

Description:

My team and I have been working on a verification project for CUDA kernels called faial. faial has reported a potential data-race in mindspore/ccsrc/plugin/device/gpu/kernel/cuda_impl/cuda_ops/matrix_transpose_impl.cu on line 34.

output[b_stride + c * row + r] = input[pos];
       ^^^^^^^^^^^^^^^^^^^^^^

Our tool reports potential data-races unless we introduce some pre-conditions on kernel parameters col and row:

  • Parameter col must be positive: col > 0
  • Parameter row must be positive: row > 0
  • Parameters row and col must be equal: row == col

Do these conditions match your expectations?

We can submit a pull-request that adds the following pre-condition to your kernels. Would that be a welcome addition?

   if (col <= 0 || row <= 0 || row != col) {
     return;
   }
@Ash-Lee233
Copy link

do you have pr url? we will review your pr ASAP

@zhenrongliew
Copy link
Author

Here is the link to the pull request. #266

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

No branches or pull requests

2 participants