Skip to content

Commit bad7096

Browse files
authored
Merge branch 'main' into adabeyta/ps-roi-pool-cuda-stable
2 parents 27f01e1 + ae0ca92 commit bad7096

4 files changed

Lines changed: 189 additions & 81 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ set(TORCHVISION_STABLE_SOURCES
116116
${TVCPP}/ops/cuda/ps_roi_pool_kernel.cu
117117
${TVCPP}/ops/ps_roi_align.cpp
118118
${TVCPP}/ops/cpu/ps_roi_align_kernel.cpp
119+
${TVCPP}/ops/cuda/ps_roi_align_kernel.cu
119120
${TVCPP}/ops/deform_conv2d.cpp
120121
${TVCPP}/ops/cpu/deform_conv2d_kernel.cpp
121122
${TVCPP}/io/image/cuda/decode_jpegs_cuda.cpp

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ def get_macros_and_flags():
188188
STABLE_SOURCES.add(CSRS_DIR / ("ops/hip/roi_pool_kernel.hip" if IS_ROCM else "ops/cuda/roi_pool_kernel.cu"))
189189
STABLE_SOURCES.add(CSRS_DIR / ("ops/hip/roi_align_kernel.hip" if IS_ROCM else "ops/cuda/roi_align_kernel.cu"))
190190
STABLE_SOURCES.add(CSRS_DIR / ("ops/hip/ps_roi_pool_kernel.hip" if IS_ROCM else "ops/cuda/ps_roi_pool_kernel.cu"))
191+
STABLE_SOURCES.add(CSRS_DIR / ("ops/hip/ps_roi_align_kernel.hip" if IS_ROCM else "ops/cuda/ps_roi_align_kernel.cu"))
191192

192193

193194
def _not_stable(paths):

torchvision/_autograd_registrations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def _ps_roi_align_setup_context(ctx, inputs, output):
8787

8888

8989
def _ps_roi_align_backward(ctx, grad_output, _grad_channel_mapping):
90-
if grad_output.device.type == "mps":
90+
if grad_output.device.type in ("cuda", "mps"):
9191
torch._prims_common.alert_not_deterministic("ps_roi_align_backward_kernel")
9292
rois, channel_mapping = ctx.saved_tensors
9393
batch_size, channels, height, width = ctx.input_shape

0 commit comments

Comments
 (0)