Skip to content

Conversation

@mansnils
Copy link
Collaborator

@mansnils mansnils commented Jun 13, 2025

aten.embedding.default is requiring int64 indices which is not supported by TOSA. A pass is introduced to insert a int64->int32 cast. This enables aten.embedding to be decomposed into index_select, which can handle int32 indices and maps easier to TOSA. So support for aten.index_select is added as well, and for now it only supports [1, x, y] and [x, y] dimension inputs since that covers aten.embedding.default use case.

In summary this patch adds:

  • One pass for inserting a cast, which is done very early since it needs to be rejected until TOSA supports int64
  • One pass for decomposing aten.embedding
  • Mapping of index select to TOSA
  • Unit tests for above

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218

GenAI used, Blackduck Scan OK,

aten.embedding.default is requiring int64 indices which is not
supported by TOSA. A pass is introduced to insert a int64->int32 cast.
This enables aten.embedding to be decomposed into index_select,
which can handle int32 indices and maps easier to TOSA.
So support for aten.index_select is added as well, and for now it only
supports [1, x, y] and [x, y] dimension inputs since that covers
aten.embedding.default use case.

In summary this patch adds:
- One pass for inserting a cast, which is done very early since it
needs to be rejected until TOSA supports int64
- One pass for decomposing aten.embedding
- Mapping of index select to TOSA
- Unit tests for above

Change-Id: I6da17d6e2cf749b24bc1463a017eb8629de1810b
@mansnils mansnils requested a review from digantdesai as a code owner June 13, 2025 08:53
@mansnils mansnils added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk labels Jun 13, 2025
@pytorch-bot
Copy link

pytorch-bot bot commented Jun 13, 2025

🔗 Helpful Links

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

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

❌ 2 New Failures, 3 Unrelated Failures

As of commit 0b388ab with merge base d9b3cf4 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following jobs failed but was 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.

@facebook-github-bot facebook-github-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 13, 2025
@zingo zingo added the release notes: arm Changes to the ARM backend delegate label Jun 13, 2025
@zingo zingo merged commit 86ac949 into pytorch:main Jun 13, 2025
188 of 193 checks passed
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. partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: arm Changes to the ARM backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants