Move blasLt SetBiasPointer call inside mutex lock
- This was not thread-safe before.
This commit is contained in:
parent
0d71ed6157
commit
7b477b8752
@ -3493,13 +3493,6 @@ bool CUDABlas::DoBlasLtMatmulInternal(
|
||||
"epilogue for the given bias pointer.";
|
||||
return false;
|
||||
}
|
||||
if (bias != nullptr) {
|
||||
if (!cuda_plan.SetBiasPointer(bias.opaque())) {
|
||||
VLOG(2) << "DoBlasLtMatmul returning false because setting the bias "
|
||||
"pointer failed.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
const void *alpha_ptr = alpha.is_pointer() ? alpha.opaque_pointer().opaque()
|
||||
: alpha.opaque_value();
|
||||
const void *beta_ptr =
|
||||
@ -3524,6 +3517,14 @@ bool CUDABlas::DoBlasLtMatmulInternal(
|
||||
|
||||
absl::MutexLock lock(&mu_);
|
||||
|
||||
if (bias != nullptr) {
|
||||
if (!cuda_plan.SetBiasPointer(bias.opaque())) {
|
||||
VLOG(2) << "DoBlasLtMatmul returning false because setting the bias "
|
||||
"pointer failed.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
CHECK(blasLt_ != nullptr);
|
||||
|
||||
gpu::ScopedActivateExecutorContext sac{parent_};
|
||||
|
Loading…
x
Reference in New Issue
Block a user