This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 5bbad79e7e [Fix][cuDNN] Avoid thread-local workspace pool for
ConvEntry (#20362)
5bbad79e7e is described below
commit 5bbad79e7ee570b79a07c7b2169364643ba90cf1
Author: Youn9 <[email protected]>
AuthorDate: Thu Sep 17 22:15:05 2026 +0800
[Fix][cuDNN] Avoid thread-local workspace pool for ConvEntry (#20362)
Fix a core dump during process shutdown when using CUDA contrib
operators.
The issue is caused by the CUDA thread-local workspace pool being
destroyed
before contrib thread-local objects that still retain workspace.
Initialize the workspace pool when the CUDA device API is requested so
that
it remains valid when retained workspace is released during thread
teardown.
Fixes #20361
---
src/runtime/extra/contrib/cudnn/cudnn_utils.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/runtime/extra/contrib/cudnn/cudnn_utils.cc
b/src/runtime/extra/contrib/cudnn/cudnn_utils.cc
index 3edb20dbac..f7f02b2f01 100644
--- a/src/runtime/extra/contrib/cudnn/cudnn_utils.cc
+++ b/src/runtime/extra/contrib/cudnn/cudnn_utils.cc
@@ -160,12 +160,14 @@ void ConvEntry::UpdateWorkspace(const size_t wsize) {
CleanWorkspace();
}
workspace_size = wsize;
- workspace = cuda_api->AllocWorkspace(device, workspace_size);
+
+ DLDataType type_hint{kDLUInt, 8, 1};
+ workspace = cuda_api->AllocDataSpace(device, wsize,
runtime::kTempAllocaAlignment, type_hint);
}
}
void ConvEntry::CleanWorkspace() {
- if (workspace) cuda_api->FreeWorkspace(device, workspace);
+ if (workspace) cuda_api->FreeDataSpace(device, workspace);
workspace_size = 0;
}