-
Notifications
You must be signed in to change notification settings - Fork 502
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
[ET-VK][ez] Fix using a temporary variable when creating ComputePipeline
#9405
Conversation
…line` ## Context Fix changes introduced in #8634 (D70021032). This change decoupled local work group size from additional specialization constants. As part of this change, when creating a `VkComputePipeline` a temporary `SpecVarList` is created to merge the `WorkgroupSize` with additional specialization constants. However, this can be an issue with some Vulkan drivers because the `SpecVarList` is a temporary, and thus will be destroyed at the end of the function call. The pointer stored in the `VkSpecializationInfo` will be invalidated, leading to undefined behaviour. This diff fixes this by restoring the behaviour of `ComputePipeline::Descriptor` storing the `specialization_constants` directly. Also fix the fact that the `VkSpecializationMapEntry` vector was also a temporary when creating a `VkComputePipeline` by storing it in `ComputePipeline`. Differential Revision: [D71488015](https://our.internmc.facebook.com/intern/diff/D71488015/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/9405
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit ed7e765 with merge base 6daff83 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
…line` ## Context Fix changes introduced in #8634 (D70021032). This change decoupled local work group size from additional specialization constants. As part of this change, when creating a `VkComputePipeline` a temporary `SpecVarList` is created to merge the `WorkgroupSize` with additional specialization constants. However, this can be an issue with some Vulkan drivers because the `SpecVarList` is a temporary, and thus will be destroyed at the end of the function call. The pointer stored in the `VkSpecializationInfo` will be invalidated, leading to undefined behaviour. This diff fixes this by restoring the behaviour of `ComputePipeline::Descriptor` storing the `specialization_constants` directly. Also fix the fact that the `VkSpecializationMapEntry` vector was also a temporary when creating a `VkComputePipeline` by storing it in `ComputePipeline`. Differential Revision: [D71488015](https://our.internmc.facebook.com/intern/diff/D71488015/) ghstack-source-id: 272783852 Pull Request resolved: #9405
This pull request was exported from Phabricator. Differential Revision: D71488015 |
This PR needs a
|
e9899fd
into
gh/SS-JIA/197/base
…line` (#9464) This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: #9405 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/197/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/197/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/197/orig @diff-train-skip-merge Co-authored-by: Stephen Jia <[email protected]>
…line` (pytorch#9464) This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: pytorch#9405 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/197/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/197/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/197/orig @diff-train-skip-merge Co-authored-by: Stephen Jia <[email protected]>
## Context As title; similar to #9016 since the interface for `ComputePipeline` descriptor was reverted in #9405. Differential Revision: [D71706868](https://our.internmc.facebook.com/intern/diff/D71706868/) [ghstack-poisoned]
## Context As title; similar to #9016 since the interface for `ComputePipeline` descriptor was reverted in #9405. Differential Revision: [D71706868](https://our.internmc.facebook.com/intern/diff/D71706868/) ghstack-source-id: 274200673 Pull Request resolved: #9648
## Context As title; similar to #9016 since the interface for `ComputePipeline` descriptor was reverted in #9405. Differential Revision: [D71706868](https://our.internmc.facebook.com/intern/diff/D71706868/) [ghstack-poisoned]
Pull Request resolved: #9648 ## Context As title; similar to #9016 since the interface for `ComputePipeline` descriptor was reverted in #9405. ghstack-source-id: 274260087 @exported-using-ghexport Differential Revision: [D71706868](https://our.internmc.facebook.com/intern/diff/D71706868/)
## Context As title; similar to #9016 since the interface for `ComputePipeline` descriptor was reverted in #9405. Differential Revision: [D71706868](https://our.internmc.facebook.com/intern/diff/D71706868/) [ghstack-poisoned]
Stack from ghstack (oldest at bottom):
ComputePipeline
#9405Context
Fix changes introduced in #8634 (D70021032).
This change decoupled local work group size from additional specialization constants. As part of this change, when creating a
VkComputePipeline
a temporarySpecVarList
is created to merge theWorkgroupSize
with additional specialization constants.However, this can be an issue with some Vulkan drivers because the
SpecVarList
is a temporary, and thus will be destroyed at the end of the function call. The pointer stored in theVkSpecializationInfo
will be invalidated, leading to undefined behaviour.This diff fixes this by restoring the behaviour of
ComputePipeline::Descriptor
storing thespecialization_constants
directly.Also fix the fact that the
VkSpecializationMapEntry
vector was also a temporary when creating aVkComputePipeline
by storing it inComputePipeline
.Differential Revision: D71488015