Rotated bounding box NMS implementation for GPU#9478
Draft
zy1git wants to merge 26 commits into
Draft
Conversation
added 26 commits
March 22, 2026 21:12
…gorithm is standard TorchVision code; attribution already in box_iou_rotated_utils.h
…different rotation angles per box
…ve boxes in test_nms_rotated_different_angles function
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9478
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 2 New FailuresAs of commit 2d22de0 with merge base d7400a3 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Enabled rotated box NMS on CUDA, building on the CPU implementation from #9450. The CUDA kernel is adapted from Detectron2's
nms_rotated_cuda_kernel, usingsingle_box_iou_rotatedinstead ofdevIoUfor IoU computation, and storing 5 values per box in shared memory instead of 4. The result gathering reuses TorchVision's existing gather_keep_from_mask GPU kernel, avoiding the GPU→CPU→GPU transfer that Detectron2's implementation requires.Test Plan:
Added device parametrization (
cpu_and_cuda()) to all rotated NMS tests.Run
pytest test/test_ops.py::TestNMS -v -k "rotated"All 110 tests pass locally (CPU and CUDA).