[ET-VK] Add missing VMA flush/invalidate calls in StagingBuffer copy methods#17352
[ET-VK] Add missing VMA flush/invalidate calls in StagingBuffer copy methods#17352
Conversation
…methods `copy_from` correctly calls `vmaFlushAllocation` after writing to the staging buffer, and `copy_to` correctly calls `vmaInvalidateAllocation` before reading, but the cast-and-copy variants were missing these calls. On devices with non-coherent memory, this could cause the GPU to read stale data (missing flush) or the CPU to read stale data (missing invalidate). This change adds the missing `vmaFlushAllocation` to `cast_and_copy_from` and `cast_half_to_float_and_copy_from`, and the missing `vmaInvalidateAllocation` to `cast_and_copy_to`. `cast_float_to_half_and_copy_to` already had the invalidate call and was not changed. Authored with Claude. Differential Revision: [D92843801](https://our.internmc.facebook.com/intern/diff/D92843801/) ghstack-source-id: 339903807 Pull Request resolved: #17341
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17352
Note: Links to docs will display an error until the docs builds have been completed. ❌ 8 New Failures, 1 Cancelled Job, 2 Unrelated FailuresAs of commit 24d2367 with merge base ba89c69 ( NEW FAILURES - The following jobs have failed:
CANCELLED JOB - The following job was cancelled. Please retry:
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. |
This PR needs a
|
…methods (pytorch#17352) This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: pytorch#17341 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/416/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/416/head Merge bot PR base: https://github.com/pytorch/executorch/tree/main Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/416/orig Differential Revision: [D92843801](https://our.internmc.facebook.com/intern/diff/D92843801/) @diff-train-skip-merge Co-authored-by: ssjia <ssjia@devvm26340.ftw0.facebook.com>
…methods (pytorch#17352) This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: pytorch#17341 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/416/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/416/head Merge bot PR base: https://github.com/pytorch/executorch/tree/main Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/416/orig Differential Revision: [D92843801](https://our.internmc.facebook.com/intern/diff/D92843801/) @diff-train-skip-merge Co-authored-by: ssjia <ssjia@devvm26340.ftw0.facebook.com>
…methods (pytorch#17352) This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: pytorch#17341 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/416/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/416/head Merge bot PR base: https://github.com/pytorch/executorch/tree/main Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/416/orig Differential Revision: [D92843801](https://our.internmc.facebook.com/intern/diff/D92843801/) @diff-train-skip-merge Co-authored-by: ssjia <ssjia@devvm26340.ftw0.facebook.com>
This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #17341 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/416/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/416/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/main
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/416/orig
Differential Revision: D92843801
@diff-train-skip-merge