From 0f8b4e1bca79deb03e4c4dcb9ce4de698fc7f916 Mon Sep 17 00:00:00 2001 From: Jorge Pineda Date: Thu, 18 Apr 2024 07:46:44 -0700 Subject: [PATCH] Free Vulkan delegate segments after compileModel (#3116) Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/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 --- backends/vulkan/runtime/VulkanBackend.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backends/vulkan/runtime/VulkanBackend.cpp b/backends/vulkan/runtime/VulkanBackend.cpp index 37ca1fd6e14..c1f3f06b440 100644 --- a/backends/vulkan/runtime/VulkanBackend.cpp +++ b/backends/vulkan/runtime/VulkanBackend.cpp @@ -449,6 +449,9 @@ class VulkanBackend final : public PyTorchBackendInterface { Error err = compileModel(processed->data(), compute_graph); + // This backend does not need its processed data after compiling the model. + processed->Free(); + if (err != Error::Ok) { return err; }