Skip to content

Conversation

@lucylq
Copy link
Contributor

@lucylq lucylq commented Nov 4, 2025

Summary

This caching breaks multi-method; for the second method, we are using the graph of the first method, and do not delegate properly. I think this is because the source partitions are based on the first graph, so the addmm nodes do not match up/do not give a partition, so the graph doesn't get tagged by the partitioner.

See issue: #12804

In the example from the issue, the first method fwd is delegated well, and the second method fwd_2 does not have the linear functions delegated (it is using portable kernels, and the weights are duplicated in the constant segment).

Also add test_partitioner to buck targets.

Test plan

python -m unittest backends.xnnpack.test.test_xnnpack_partitioner

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 4, 2025

🔗 Helpful Links

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

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

❌ 8 New Failures, 4 Unrelated Failures

As of commit 32b4794 with merge base cadb0db (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following jobs 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 Nov 4, 2025
@github-actions
Copy link

github-actions bot commented Nov 4, 2025

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.

@lucylq lucylq force-pushed the lfq.dont-cache-source-partitions branch from 6a25957 to 0f11218 Compare November 4, 2025 00:09
@lucylq lucylq marked this pull request as ready for review November 4, 2025 00:12
@lucylq lucylq requested a review from digantdesai as a code owner November 4, 2025 00:12
@meta-codesync
Copy link

meta-codesync bot commented Nov 4, 2025

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

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.

Thanks for adding this. FYI We've deprecated the to_edge + to_backend flow for XNNPACK and will throw up a big warning when used. Fixing the caching issue is probably good regardless, even if it mostly only affects to_edge + to_backend (we preserve linear w/ to_edge_transform_and_lower).

@lucylq lucylq force-pushed the lfq.dont-cache-source-partitions branch 2 times, most recently from 0d8159b to 3bc932c Compare November 10, 2025 22:40
@lucylq lucylq force-pushed the lfq.dont-cache-source-partitions branch from 3bc932c to 32b4794 Compare November 10, 2025 22:42
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants