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

Alert non-deterministic on kernels that use gpuAtomicAdd #7582

Merged
merged 1 commit into from
May 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ void compute_grad_input(
// Checks if num_kernels or columns numel larger than 2 ** 31
use_64bits_indexing |= num_kernels > (1 << 31);

at::globalContext().alertNotDeterministic("compute_grad_input");

if (use_64bits_indexing) {
AT_DISPATCH_FLOATING_TYPES_AND_HALF(
columns.scalar_type(), "compute_grad_input", ([&] {
Expand Down
2 changes: 2 additions & 0 deletions torchvision/csrc/ops/cuda/ps_roi_align_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ at::Tensor ps_roi_align_backward_kernel(

int channels_out = channels / (pooled_height * pooled_width);

at::globalContext().alertNotDeterministic("ps_roi_align_backward_kernel");

auto grad_ = grad.contiguous(), rois_ = rois.contiguous();
AT_DISPATCH_FLOATING_TYPES_AND_HALF(
grad.scalar_type(), "ps_roi_align_backward_kernel", [&] {
Expand Down
2 changes: 2 additions & 0 deletions torchvision/csrc/ops/cuda/ps_roi_pool_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ at::Tensor ps_roi_pool_backward_kernel(

int channels_out = channels / (pooled_height * pooled_width);

at::globalContext().alertNotDeterministic("ps_roi_pool_backward_kernel");

auto grad_ = grad.contiguous(), rois_ = rois.contiguous();
AT_DISPATCH_FLOATING_TYPES_AND_HALF(
grad.scalar_type(), "ps_roi_pool_backward_kernel", [&] {
Expand Down
2 changes: 2 additions & 0 deletions torchvision/csrc/ops/cuda/roi_align_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ at::Tensor roi_align_backward_kernel(
int h_stride = grad.stride(2);
int w_stride = grad.stride(3);

at::globalContext().alertNotDeterministic("roi_align_backward_kernel");

auto rois_ = rois.contiguous();
AT_DISPATCH_FLOATING_TYPES_AND_HALF(
grad.scalar_type(), "roi_align_backward_kernel", [&] {
Expand Down
2 changes: 2 additions & 0 deletions torchvision/csrc/ops/cuda/roi_pool_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ at::Tensor roi_pool_backward_kernel(
int h_stride = grad.stride(2);
int w_stride = grad.stride(3);

at::globalContext().alertNotDeterministic("roi_pool_backward_kernel");

auto argmax_ = argmax.contiguous(), rois_ = rois.contiguous();
AT_DISPATCH_FLOATING_TYPES_AND_HALF(
grad.scalar_type(), "roi_pool_backward_kernel", [&] {
Expand Down