Skip to content

[ET-VK] Add missing VMA flush/invalidate calls in StagingBuffer copy methods#17352

Merged
metascroy merged 1 commit intomainfrom
gh/SS-JIA/416/orig
Feb 12, 2026
Merged

[ET-VK] Add missing VMA flush/invalidate calls in StagingBuffer copy methods#17352
metascroy merged 1 commit intomainfrom
gh/SS-JIA/416/orig

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: #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

…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
@pytorchbot pytorchbot requested a review from SS-JIA as a code owner February 10, 2026 21:44
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 10, 2026

🔗 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 Failures

As of commit 24d2367 with merge base ba89c69 (image):

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.

@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 Feb 10, 2026
@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@metascroy metascroy merged commit d300e4d into main Feb 12, 2026
177 of 190 checks passed
@metascroy metascroy deleted the gh/SS-JIA/416/orig branch February 12, 2026 17:52
chizkiyahu pushed a commit to chizkiyahu/executorch that referenced this pull request Feb 23, 2026
…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>
chizkiyahu pushed a commit to chizkiyahu/executorch that referenced this pull request Feb 23, 2026
…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>
chizkiyahu pushed a commit to chizkiyahu/executorch that referenced this pull request Feb 23, 2026
…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>
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