Enable Dynamic shape support via tensor virtual and physical resizing (#2340)
Summary: X-link: https://github.com/pytorch/pytorch/pull/121598 Pull Request resolved: https://github.com/pytorch/executorch/pull/2340 ## Context This changeset lays the foundations for supporting dynamic shapes in the ExecuTorch Vulkan delegate via allowing Tensors to be resized in one of two ways: 1. Discarding underlying `vkImage` or `vkBuffer` and reallocating a new `vkImage` or `vkBuffer` with updated sizes. This method is intended to be used when the current `vkImage` or `vkBuffer` is not large enough to contain the new sizes. 2. Update the tensor's size metadata without reallocating any new resources. This allows shaders to interpret the underlying `vkImage` or `vkBuffer` as if it were smaller than it actually is, and allows command buffers to be preserved when sizes are changed. bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks bypass-github-export-checks Reviewed By: jorgep31415 Differential Revision: D54728401 fbshipit-source-id: 06b941489a16848370c65c97321b10f42022b0cf
S
Stephen Jia committed
4dfb6376f488c8e20efa534a523af72644eb8994
Parent: 91134d6
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 3/12/2024, 2:22:35 PM