Skip to content

Implement Portable bucketize#20287

Draft
Gallinator wants to merge 20 commits into
pytorch:mainfrom
Gallinator:bucketize
Draft

Implement Portable bucketize#20287
Gallinator wants to merge 20 commits into
pytorch:mainfrom
Gallinator:bucketize

Conversation

@Gallinator

@Gallinator Gallinator commented Jun 15, 2026

Copy link
Copy Markdown

Fixes #20270

Summary

Add portable scalar and tensor bucketize operator, based on the PyTorch implementation.
Key differences from the PyTorch implementation:

  • Implemented only bucketize, no searchsorted
  • Boundaries tensor size is not checked as SizesType is an int32_t and must be 1D
  • In the original implementation the input scalar is wrapped into a tensor, here two sets of functions are used instead

Release notes: ops & kernels

Test plan

C++ tests are extensive and include failure and edge cases tests.
Python tests compare the output of an exported module to the PyTorch implementation only for normal and edge cases, similar to #15893.

@pytorch-bot

pytorch-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20287

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

⚠️ 12 Awaiting Approval

As of commit afb0d90 with merge base 0378fc4 (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

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

@meta-cla

meta-cla Bot commented Jun 15, 2026

Copy link
Copy Markdown

Hi @Gallinator!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 15, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 16, 2026
@meta-cla

meta-cla Bot commented Jun 16, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@Gallinator

Copy link
Copy Markdown
Author

@pytorchbot label "release notes: ops & kernels"

@pytorch-bot pytorch-bot Bot added the release notes: ops & kernels Changes to the opset and any new / changed kernel implementations label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: ops & kernels Changes to the opset and any new / changed kernel implementations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kernel 'aten::bucketize.Tensor_out' not found.

1 participant