Skip to content

Port box_iou_rotated to stable ABI. - #9558

Merged
NicolasHug merged 2 commits into
mainfrom
adabeyta/box-iou-rotated-stable
Jul 20, 2026
Merged

NicolasHug merged 2 commits into
mainfrom
adabeyta/box-iou-rotated-stable

Conversation

@adabeyta

@adabeyta adabeyta commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Ports box_iou_rotated (CPU + CUDA/ROCm) to the stable ABI.

Notes

  • CUDA launch goes through a launch_* wrapper, THO_DISPATCH_V2 splits its body on commas outside parens. Same pattern as nms_kernel.cu.

Stable-ABI audit (torch-abi-audit)

Ran torch-abi-audit against the built torchvision package. The legacy _C.so drops 110 → 107 unstable as box_iou_rotated moves over.

      Package: torchvision
        Torch ABI:   UNSTABLE
        CPython ABI: n/a
        Bundled libs: 3
        -- bundled libs --
          [UNSTABLE] [not-abi3        ] _C.so            (stable_shim=0,  unstable=107)
          [STABLE  ] [not-abi3        ] _C_stable.so     (stable_shim=69, unstable=0)
          [STABLE  ] [not-abi3        ] image_stable.so  (stable_shim=76, unstable=0)

---

@meta-cla meta-cla Bot added the cla signed label Jul 16, 2026
@adabeyta
adabeyta force-pushed the adabeyta/box-iou-rotated-stable branch from fbf1f06 to b36f042 Compare July 16, 2026 23:59
@pytorch-bot

pytorch-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9558

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 4 New Failures, 2 Unrelated Failures

As of commit 77d9846 with merge base f23f832 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@adabeyta adabeyta changed the title [Test] Port box_iou_rotated to stable ABI. Port box_iou_rotated to stable ABI. Jul 17, 2026
@adabeyta
adabeyta requested a review from NicolasHug July 17, 2026 13:31
@adabeyta
adabeyta marked this pull request as ready for review July 17, 2026 13:31

@NicolasHug NicolasHug left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @adabeyta , just one minor Q and comment. I'll approve now to unblock, feel free to self-merge

// Stable-ABI sizes() has no operator << to stream into STD_TORCH_CHECK.
// Modeled after torchcodec:
// https://github.com/meta-pytorch/torchcodec/blob/1dc85b7a7900d91fee207ccdc02f211a051688fe/src/torchcodec/_core/Encoder.cpp#L140-L147
// TODO(stable-abi): adopt << once it lands in the stable ABI upstream.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think the TODO should be more something like "adopt sizes() instead of.dim() in the error message once..." ? Maybe I misunderstand

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, you are correct. Updated to make it clearer.

Comment on lines +141 to +142
const int blocks_x = ceil_div(static_cast<int>(num_boxes1), BLOCK_DIM_X);
const int blocks_y = ceil_div(static_cast<int>(num_boxes2), BLOCK_DIM_Y);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QQ - Which include does this come from?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one comes from the cuda_helpers.h. NMS kernel uses the same include as well.

template <typename integer>
constexpr __host__ __device__ inline integer ceil_div(integer n, integer m) {
return (n + m - 1) / m;
}

@adabeyta

adabeyta commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

CI Failures are unrelated to this PR. Merging @NicolasHug.

@NicolasHug
NicolasHug merged commit 94015dd into main Jul 20, 2026
58 of 68 checks passed
@NicolasHug
NicolasHug deleted the adabeyta/box-iou-rotated-stable branch July 20, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants