Skip to content

Commit 11b1b63

Browse files
Green-Skyslaren
authored andcommitted
fix : cuda order of synchronization when setting a buffer (ggml/679)
* fix : cuda order of synchronization when setting a buffer * also sync before memcpy --------- Co-authored-by: slaren <slarengh@gmail.com>
1 parent 0e26a6c commit 11b1b63

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

extra/sync-ggml.last

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f96711108d55bdbbd277e6be07204dce6a94fb93
1+
3eace58911ea8d2cf35defdc59848d99b91a57f5

ggml-cuda.cu

+1-1
Original file line numberDiff line numberDiff line change
@@ -9689,8 +9689,8 @@ static void ggml_backend_cuda_buffer_set_tensor(ggml_backend_buffer_t buffer, gg
96899689

96909690
ggml_cuda_set_device(ctx->device);
96919691
CUDA_CHECK(cudaDeviceSynchronize());
9692-
96939692
CUDA_CHECK(cudaMemcpy((char *)tensor->data + offset, data, size, cudaMemcpyHostToDevice));
9693+
CUDA_CHECK(cudaDeviceSynchronize());
96949694
}
96959695

96969696
static void ggml_backend_cuda_buffer_get_tensor(ggml_backend_buffer_t buffer, const ggml_tensor * tensor, void * data, size_t offset, size_t size) {

0 commit comments

Comments
 (0)