Skip to content

Conversation

metascroy
Copy link
Contributor

This PR enables per-row grouping in CoreML LUT ops.

Copy link

pytorch-bot bot commented Aug 26, 2025

🔗 Helpful Links

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

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:

❌ 2 New Failures, 1 Unrelated Failure

As of commit 3a826fd with merge base 0d0769a (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@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 Aug 26, 2025
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@facebook-github-bot
Copy link
Contributor

@metascroy has imported this pull request. If you are a Meta employee, you can view this in D80995383.

@metascroy metascroy requested a review from YifanShenSZ August 26, 2025 00:35
@metascroy metascroy force-pushed the support-codebook-transposed branch from 068c6ea to 89910fe Compare August 28, 2025 18:45
@facebook-github-bot
Copy link
Contributor

@metascroy has imported this pull request. If you are a Meta employee, you can view this in D80995383.

@metascroy metascroy requested a review from digantdesai August 29, 2025 04:18
Copy link
Collaborator

@YifanShenSZ YifanShenSZ left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for adding more LUT support!

One quick question though: In CoreML LUT we allow arbitrary vector axis, is there a reason in torch we support only row or col?

@metascroy
Copy link
Contributor Author

LGTM! Thanks for adding more LUT support!

One quick question though: In CoreML LUT we allow arbitrary vector axis, is there a reason in torch we support only row or col?

This is still scalar-valued LUT (vector axis is for vector-valued LUT, which is still not supported).

The row/col here refer to the granularity of the LUTs as discussed here: https://apple.github.io/coremltools/docs-guides/source/opt-palettization-overview.html

The diagram for "per-grouped channel lookup table" corresponds to per-row grouping.

If the original tensor has size (n, k), we can support 1 LUT per col_group_size columns (can be specified with block_size = [-1, col_group_size], where -1 is interpreted as n), or we can support 1 LUT per row_group_size rows (can be specified as block_size = [row_group_size, -1], where -1 is interpreted as k).

@metascroy
Copy link
Contributor Author

@cccclai @digantdesai can I get a stamp for ET to merge?

@facebook-github-bot
Copy link
Contributor

@metascroy has imported this pull request. If you are a Meta employee, you can view this in D80995383.

@metascroy metascroy merged commit 4fc602b into main Sep 3, 2025
252 of 255 checks passed
@metascroy metascroy deleted the support-codebook-transposed branch September 3, 2025 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants