diff --git a/src/llama-quant.cpp b/src/llama-quant.cpp index df36a705c2..90931f25e7 100644 --- a/src/llama-quant.cpp +++ b/src/llama-quant.cpp @@ -1136,7 +1136,7 @@ static std::unordered_map target_bpw_type( std::vector tl_quantized_buffer(quantized_buffer.size()); std::vector tl_dequantized_buffer(dequantized_buffer.size()); for (;;) { - const size_t i = cidx.fetch_add(1, std::memory_order_relaxed); + const size_t i = cidx.fetch_add(1, std::memory_order_acq_rel); if (i >= compatible_candidates.size()) { break; } const ggml_type tensor_types = compatible_candidates[i];