Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
9b7c7d39
Unverified
Commit
9b7c7d39
authored
May 12, 2023
by
Edward Z. Yang
Committed by
GitHub
May 12, 2023
Browse files
Alert non-deterministic on kernels that use gpuAtomicAdd (#7582)
Signed-off-by:
Edward Z. Yang
<
ezyang@meta.com
>
parent
c8cd3ff9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
0 deletions
+10
-0
torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu
torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu
+2
-0
torchvision/csrc/ops/cuda/ps_roi_align_kernel.cu
torchvision/csrc/ops/cuda/ps_roi_align_kernel.cu
+2
-0
torchvision/csrc/ops/cuda/ps_roi_pool_kernel.cu
torchvision/csrc/ops/cuda/ps_roi_pool_kernel.cu
+2
-0
torchvision/csrc/ops/cuda/roi_align_kernel.cu
torchvision/csrc/ops/cuda/roi_align_kernel.cu
+2
-0
torchvision/csrc/ops/cuda/roi_pool_kernel.cu
torchvision/csrc/ops/cuda/roi_pool_kernel.cu
+2
-0
No files found.
torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu
View file @
9b7c7d39
...
@@ -426,6 +426,8 @@ void compute_grad_input(
...
@@ -426,6 +426,8 @@ void compute_grad_input(
// Checks if num_kernels or columns numel larger than 2 ** 31
// Checks if num_kernels or columns numel larger than 2 ** 31
use_64bits_indexing
|=
num_kernels
>
(
1
<<
31
);
use_64bits_indexing
|=
num_kernels
>
(
1
<<
31
);
at
::
globalContext
().
alertNotDeterministic
(
"compute_grad_input"
);
if
(
use_64bits_indexing
)
{
if
(
use_64bits_indexing
)
{
AT_DISPATCH_FLOATING_TYPES_AND_HALF
(
AT_DISPATCH_FLOATING_TYPES_AND_HALF
(
columns
.
scalar_type
(),
"compute_grad_input"
,
([
&
]
{
columns
.
scalar_type
(),
"compute_grad_input"
,
([
&
]
{
...
...
torchvision/csrc/ops/cuda/ps_roi_align_kernel.cu
View file @
9b7c7d39
...
@@ -412,6 +412,8 @@ at::Tensor ps_roi_align_backward_kernel(
...
@@ -412,6 +412,8 @@ at::Tensor ps_roi_align_backward_kernel(
int
channels_out
=
channels
/
(
pooled_height
*
pooled_width
);
int
channels_out
=
channels
/
(
pooled_height
*
pooled_width
);
at
::
globalContext
().
alertNotDeterministic
(
"ps_roi_align_backward_kernel"
);
auto
grad_
=
grad
.
contiguous
(),
rois_
=
rois
.
contiguous
();
auto
grad_
=
grad
.
contiguous
(),
rois_
=
rois
.
contiguous
();
AT_DISPATCH_FLOATING_TYPES_AND_HALF
(
AT_DISPATCH_FLOATING_TYPES_AND_HALF
(
grad
.
scalar_type
(),
"ps_roi_align_backward_kernel"
,
[
&
]
{
grad
.
scalar_type
(),
"ps_roi_align_backward_kernel"
,
[
&
]
{
...
...
torchvision/csrc/ops/cuda/ps_roi_pool_kernel.cu
View file @
9b7c7d39
...
@@ -251,6 +251,8 @@ at::Tensor ps_roi_pool_backward_kernel(
...
@@ -251,6 +251,8 @@ at::Tensor ps_roi_pool_backward_kernel(
int
channels_out
=
channels
/
(
pooled_height
*
pooled_width
);
int
channels_out
=
channels
/
(
pooled_height
*
pooled_width
);
at
::
globalContext
().
alertNotDeterministic
(
"ps_roi_pool_backward_kernel"
);
auto
grad_
=
grad
.
contiguous
(),
rois_
=
rois
.
contiguous
();
auto
grad_
=
grad
.
contiguous
(),
rois_
=
rois
.
contiguous
();
AT_DISPATCH_FLOATING_TYPES_AND_HALF
(
AT_DISPATCH_FLOATING_TYPES_AND_HALF
(
grad
.
scalar_type
(),
"ps_roi_pool_backward_kernel"
,
[
&
]
{
grad
.
scalar_type
(),
"ps_roi_pool_backward_kernel"
,
[
&
]
{
...
...
torchvision/csrc/ops/cuda/roi_align_kernel.cu
View file @
9b7c7d39
...
@@ -421,6 +421,8 @@ at::Tensor roi_align_backward_kernel(
...
@@ -421,6 +421,8 @@ at::Tensor roi_align_backward_kernel(
int
h_stride
=
grad
.
stride
(
2
);
int
h_stride
=
grad
.
stride
(
2
);
int
w_stride
=
grad
.
stride
(
3
);
int
w_stride
=
grad
.
stride
(
3
);
at
::
globalContext
().
alertNotDeterministic
(
"roi_align_backward_kernel"
);
auto
rois_
=
rois
.
contiguous
();
auto
rois_
=
rois
.
contiguous
();
AT_DISPATCH_FLOATING_TYPES_AND_HALF
(
AT_DISPATCH_FLOATING_TYPES_AND_HALF
(
grad
.
scalar_type
(),
"roi_align_backward_kernel"
,
[
&
]
{
grad
.
scalar_type
(),
"roi_align_backward_kernel"
,
[
&
]
{
...
...
torchvision/csrc/ops/cuda/roi_pool_kernel.cu
View file @
9b7c7d39
...
@@ -232,6 +232,8 @@ at::Tensor roi_pool_backward_kernel(
...
@@ -232,6 +232,8 @@ at::Tensor roi_pool_backward_kernel(
int
h_stride
=
grad
.
stride
(
2
);
int
h_stride
=
grad
.
stride
(
2
);
int
w_stride
=
grad
.
stride
(
3
);
int
w_stride
=
grad
.
stride
(
3
);
at
::
globalContext
().
alertNotDeterministic
(
"roi_pool_backward_kernel"
);
auto
argmax_
=
argmax
.
contiguous
(),
rois_
=
rois
.
contiguous
();
auto
argmax_
=
argmax
.
contiguous
(),
rois_
=
rois
.
contiguous
();
AT_DISPATCH_FLOATING_TYPES_AND_HALF
(
AT_DISPATCH_FLOATING_TYPES_AND_HALF
(
grad
.
scalar_type
(),
"roi_pool_backward_kernel"
,
[
&
]
{
grad
.
scalar_type
(),
"roi_pool_backward_kernel"
,
[
&
]
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment