Skip to content

Prevent folding of mutable input to copy_ and put_ operators#4181

Open
tom-arm wants to merge 1 commit intopytorch:mainfrom
tom-arm:improve_buffer_folding
Open

Prevent folding of mutable input to copy_ and put_ operators#4181
tom-arm wants to merge 1 commit intopytorch:mainfrom
tom-arm:improve_buffer_folding

Conversation

@tom-arm
Copy link

@tom-arm tom-arm commented Mar 26, 2026

  • Find mutable buffers for put_ operations as well as copy_.
  • Trace the graph to the buffer and mark nodes found as mutable to prevent folding.

* Find mutable buffers for put_ operations as well as copy_.
* Trace the graph to the buffer and mark nodes found as mutable
  to prevent folding.
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 26, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4181

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

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 Mar 26, 2026
@tom-arm
Copy link
Author

tom-arm commented Mar 26, 2026

Partly solves the issue raised here: #4138. It should stop the mutable buffer being folded into a constant

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.

1 participant