Skip to content

Fix write back to buffers for buffer mutation #7810

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

Conversation

cptspacemanspiff
Copy link
Contributor

Summary

This solves my own issue, #7515, where the write back pass does not add in a copy operation if the buffer mutation src is in the input.

This change allows one to copy directly from one input to another.

…ers_pass for the case of copying data directly from one input to another.

Also converted the list comprehension to a for loop for readablity.
Copy link

pytorch-bot bot commented Jan 21, 2025

🔗 Helpful Links

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

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

❌ 2 New Failures

As of commit 7557bdb with merge base b04912f (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 Jan 21, 2025
Copy link
Contributor

@JacobSzwejbka JacobSzwejbka 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 the fix! When does this come up btw? Why for instance would you not just use x everywhere you would use buffer?

@kirklandsign
Copy link
Contributor

@cptspacemanspiff Could you please fix the linter error?

@cptspacemanspiff
Copy link
Contributor Author

cptspacemanspiff commented Jan 28, 2025

@JacobSzwejbka

So as I was working through how to get shared state between multiple methods working, my debug module to export was a 'set_cache' 'get_cache' operation, which are dummy methods that set and load values from the cache.

A real use case might be to save and load precalculated k-v caches from previously ran prompts and such...

@JacobSzwejbka
Copy link
Contributor

Ok the linux test failure is xnnpack being flakey. Im not sure whats up with the phi3 failure but I dont think this is related either so Im just gonna merge and if it gets reverted (unlikely) ill fix it.

@JacobSzwejbka JacobSzwejbka merged commit c857cc3 into pytorch:main Jan 29, 2025
43 of 45 checks passed
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. topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants