Skip to content

Commit f2b0da3

Browse files
committed
Update base for Update on "update cuda delegate resource free pipeline for safety and segfault-free"
This diff survives `clear_all_tensors()` function and enable it during backend destroy stage. Furthermore, we defer the container handle deletion to OS to avoid potential segfault if there's more than one .so files. Differential Revision: [D84135792](https://our.internmc.facebook.com/intern/diff/D84135792/) [ghstack-poisoned]
1 parent 23ab521 commit f2b0da3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backends/cuda/runtime/cuda_backend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ class ET_EXPERIMENTAL CudaBackend final
322322
if (handle->container_handle != nullptr) {
323323
AOTIRuntimeError delete_result =
324324
AOTInductorModelContainerDelete(handle->container_handle);
325-
ET_CHECK_OR_LOG(
325+
ET_CHECK_OR_LOG_ERROR(
326326
delete_result == Error::Ok,
327327
"Failed to delete AOTInductorModelContainer with error code %d",
328328
delete_result);
@@ -338,7 +338,7 @@ class ET_EXPERIMENTAL CudaBackend final
338338
if (!handle->so_path.empty()) {
339339
std::error_code remove_error;
340340
std::filesystem::remove(handle->so_path, remove_error);
341-
ET_CHECK_OR_LOG(
341+
ET_CHECK_OR_LOG_ERROR(
342342
!remove_error,
343343
"Failed to remove temporary shared library %s: %s",
344344
handle->so_path.c_str(),

0 commit comments

Comments
 (0)