Skip to content

Commit e0b0647

Browse files
jorgep31415facebook-github-bot
authored andcommitted
Free Vulkan delegate segments after compileModel (#3116)
Summary: Pull Request resolved: #3116 It's been a while since I had an impactful one-liner. :) Nothing innovative here, just reusing the same solution as [other backends](https://github.com/pytorch/executorch/blob/b19d5860568187f2567d93dd5e7cd5af32378d9f/backends/xnnpack/runtime/XNNPACKBackend.cpp#L47-L48). Reviewed By: yipjustin, copyrightly, SS-JIA Differential Revision: D56281665 fbshipit-source-id: 6b4c9d25ef085a394bcd2904903fff680b4f1794
1 parent e69a662 commit e0b0647

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

backends/vulkan/runtime/VulkanBackend.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,9 @@ class VulkanBackend final : public PyTorchBackendInterface {
449449

450450
Error err = compileModel(processed->data(), compute_graph);
451451

452+
// This backend does not need its processed data after compiling the model.
453+
processed->Free();
454+
452455
if (err != Error::Ok) {
453456
return err;
454457
}

0 commit comments

Comments
 (0)