mirror of
https://github.com/immich-app/immich.git
synced 2025-01-16 00:36:47 +01:00
acquire lock before any changes can be made
This commit is contained in:
parent
96fe38bb01
commit
ace7dc99da
1 changed files with 9 additions and 9 deletions
|
@ -1,4 +1,4 @@
|
||||||
From e267bc9bab8b3873dba57323ddcd9a9d09a1211e Mon Sep 17 00:00:00 2001
|
From c4e6f81b4901b2b8178b964377e8fde7118f0e2e Mon Sep 17 00:00:00 2001
|
||||||
From: mertalev <101130780+mertalev@users.noreply.github.com>
|
From: mertalev <101130780+mertalev@users.noreply.github.com>
|
||||||
Date: Fri, 20 Dec 2024 00:59:21 -0500
|
Date: Fri, 20 Dec 2024 00:59:21 -0500
|
||||||
Subject: [PATCH] fix: avoid race condition for rocm conv algo caching
|
Subject: [PATCH] fix: avoid race condition for rocm conv algo caching
|
||||||
|
@ -8,18 +8,18 @@ Subject: [PATCH] fix: avoid race condition for rocm conv algo caching
|
||||||
1 file changed, 2 insertions(+)
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
diff --git a/onnxruntime/core/providers/rocm/nn/conv.cc b/onnxruntime/core/providers/rocm/nn/conv.cc
|
diff --git a/onnxruntime/core/providers/rocm/nn/conv.cc b/onnxruntime/core/providers/rocm/nn/conv.cc
|
||||||
index d7f47d07a8..ec438287ac 100644
|
index d7f47d07a8..134f8a3b43 100644
|
||||||
--- a/onnxruntime/core/providers/rocm/nn/conv.cc
|
--- a/onnxruntime/core/providers/rocm/nn/conv.cc
|
||||||
+++ b/onnxruntime/core/providers/rocm/nn/conv.cc
|
+++ b/onnxruntime/core/providers/rocm/nn/conv.cc
|
||||||
@@ -278,6 +278,8 @@ Status Conv<T, NHWC>::UpdateState(OpKernelContext* context, bool bias_expected)
|
@@ -122,6 +122,8 @@ Status Conv<T, NHWC>::UpdateState(OpKernelContext* context, bool bias_expected)
|
||||||
HIP_CALL_THROW(hipMemsetAsync(s_.b_zero, 0, malloc_size, Stream(context)));
|
bool input_dims_changed = (s_.last_x_dims != x_dims);
|
||||||
}
|
bool w_dims_changed = (s_.last_w_dims != w_dims);
|
||||||
|
if (input_dims_changed || w_dims_changed) {
|
||||||
+ // lock is needed to avoid race condition during algo search
|
+ // lock is needed to avoid race condition during algo search
|
||||||
+ std::lock_guard<OrtMutex> lock(s_.mutex);
|
+ std::lock_guard<OrtMutex> lock(s_.mutex);
|
||||||
if (!s_.cached_benchmark_fwd_results.contains(x_dims_miopen)) {
|
if (input_dims_changed)
|
||||||
miopenConvAlgoPerf_t perf;
|
s_.last_x_dims = gsl::make_span(x_dims);
|
||||||
int algo_count = 1;
|
|
||||||
--
|
--
|
||||||
2.43.0
|
2.43.0
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue