Fix mutated-buffer tagging after indirect mutation detection change - #22296
Fix mutated-buffer tagging after indirect mutation detection change#22296metascroy wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22296
Note: Links to docs will display an error until the docs builds have been completed. ❌ You can merge normally! (1 Unrelated Failure), 1 Unclassified FailureAs of commit 4fe4109 with merge base 0447246 ( UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:
BROKEN TRUNK - The following job 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. |
This PR needs a
|
PR #22172 updated tag_constant_data() to identify mutated buffers through the exported program’s graph signature. However, tag_mutated_buffer() retained the previous direct-user heuristic.
This left indirectly mutated buffers outside delegate partitions. For MLX KV-cache models, the cache became a delegate input while its updated value was also assigned an output slot, causing:
Slot for getitem already set to Output, trying to set to Input
Update tag_mutated_buffer() to use the same graph-signature-based detection as tag_constant_data() and add regression coverage for indirect buffer mutation.