Skip to content

Milestone2.1: Partition to_dim_order_copy op in XNN delegate #11286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 27, 2025

Conversation

leafs1
Copy link
Contributor

@leafs1 leafs1 commented Jun 2, 2025

Summary

Add to_dim_order_copy op to the partitioner in XNN delegate and delegate dim order conversions (to_dim_order_copy op) manually initiated by user using .to(memory_format=)

Test plan

Confirmed expected output when having user specified dim order conversions as well as appropriate partitioning

@leafs1 leafs1 requested review from digantdesai and mcr229 as code owners June 2, 2025 16:58
Copy link

pytorch-bot bot commented Jun 2, 2025

🔗 Helpful Links

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

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

As of commit c860199 with merge base b11075f (image):

NEW FAILURES - The following jobs have failed:

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 2, 2025
@leafs1
Copy link
Contributor Author

leafs1 commented Jun 2, 2025

@pytorchbot label "release notes: none"

@pytorch-bot pytorch-bot bot added the release notes: none Do not include this in the release notes label Jun 2, 2025
@leafs1 leafs1 force-pushed the milestone2.1 branch 4 times, most recently from 7dc20ef to a8e4be4 Compare June 3, 2025 21:21
@mergennachin
Copy link
Contributor

Add a more descriptive name to the Title of this PR

@leafs1 leafs1 changed the title Milestone2.1 Milestone2.1: Partition to_dim_order_copy op in XNN delegate Jun 5, 2025
Copy link
Member

@GregoryComer GregoryComer left a comment

Choose a reason for hiding this comment

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

Implementation looks good to me. In addition to the test you added in in the pass tests, can you create a test file for to_copy under backends/xnnpack/test/ops? It might be good to add cover the following cases:

  • to(channels_last) before linear.
  • to(contiguous) before conv.
  • Convert both dtype and dim order (for example, .to(torch.float, memory_format=torch.channels_last) with non-float inputs).

@leafs1 leafs1 force-pushed the milestone2.1 branch 4 times, most recently from 74a7331 to d195f85 Compare June 23, 2025 17:23
@facebook-github-bot
Copy link
Contributor

@leafs1 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@leafs1 leafs1 force-pushed the milestone2.1 branch 4 times, most recently from 549b361 to e38df19 Compare June 26, 2025 23:04
@facebook-github-bot
Copy link
Contributor

@leafs1 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Member

@GregoryComer GregoryComer left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for adding this!

@leafs1 leafs1 merged commit 85b91a4 into pytorch:main Jun 27, 2025
94 of 97 checks passed
@mergennachin
Copy link
Contributor

@leafs1 Don't land PRs if it has failures

As you can see, it has these failures

[pull / unittest / linux / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/11286#44890646449) ([gh](https://github.com/pytorch/executorch/actions/runs/15914929064/job/44890646449))
backends/xnnpack/test/ops/test_exp.py::TestExp::test_fp16_exp
[pull / unittest-editable / linux / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/11286#44890646384) ([gh](https://github.com/pytorch/executorch/actions/runs/15914929064/job/44890646384))
examples/models/llama/tests/test_ring_attention.py::TestRingAttention::test_single_token_processing_quantized

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: none Do not include this in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants