Skip to content

Conversation

@pytorchbot
Copy link
Collaborator

This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #15620 by @SS-JIA
^ Please use this as the source of truth for the PR details, comments, and reviews
ghstack PR base: https://github.com/pytorch/executorch/tree/gh/SS-JIA/356/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/356/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/SS-JIA/357/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/356/orig
Differential Revision: D86340338
@diff-train-skip-merge

ssjia added 3 commits November 6, 2025 16:25
Pull Request resolved: #15619

Title says it all!

Previously, to_dim_order_copy was handled by removing the op. However, this is not possible if the op is modifying the dtype of the original tensor, so these instances of the op would be skipped by the partitioner.

This diff adds an implementation dtype conversion, which allows to_dim_order_copy to be lowered.
ghstack-source-id: 321555048
@exported-using-ghexport

Differential Revision: [D86340341](https://our.internmc.facebook.com/intern/diff/D86340341/)
…numel limit

Pull Request resolved: #15651

Title says it all!

To give a concrete example, Llama3.2-1B-Instruct will have attn weights with size `{1, 32, max_seq_len, max_context_len}`. Usually `max_seq_len == max_context_len`, and if `max_context_len = 2048` Then the attention weight tensors will have sizes `{1, 32, 2048, 2048}` which will contain 134217728 elements. The `maxStorageBufferRange` for Adreno 750 is also 134217728 (2^27), so using context length of 2048 will produce incorrect results on Adreno 750.

In practice, it is unlikely that the prompt sequence length will be equal to the context length, so the solution is to adjust down the `max_seq_len` dim of the attention weight tensors to ensure that the GPU buffer numel limit is not hit.
ghstack-source-id: 321555042
@exported-using-ghexport

Differential Revision: [D86443407](https://our.internmc.facebook.com/intern/diff/D86443407/)
Pull Request resolved: #15620

Title says it all!
ghstack-source-id: 321555043
@exported-using-ghexport

Differential Revision: [D86340338](https://our.internmc.facebook.com/intern/diff/D86340338/)
@pytorchbot pytorchbot requested a review from SS-JIA as a code owner November 7, 2025 17:17
@pytorch-bot
Copy link

pytorch-bot bot commented Nov 7, 2025

🔗 Helpful Links

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

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

⏳ No Failures, 133 Pending

As of commit 962c01e with merge base d361573 (image):
💚 Looks good so far! There are no failures yet. 💚

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 7, 2025
Base automatically changed from gh/SS-JIA/357/orig to main November 7, 2025 17:31
@SS-JIA SS-JIA merged commit e4aba1e into main Nov 7, 2025
138 of 149 checks passed
@SS-JIA SS-JIA deleted the gh/SS-JIA/356/orig branch November 7, 2025 17:31
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