Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash of test-tokenizer-0 under Debug build #2064

Merged
merged 2 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Change per comment
  • Loading branch information
howard0su committed Jul 3, 2023
commit a75ddde952c44f11cd2c03481ee4176729bd824d
2 changes: 1 addition & 1 deletion ggml-cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2809,7 +2809,7 @@ void ggml_cuda_transform_tensor(void * data, struct ggml_tensor * tensor) {
}

void ggml_cuda_free_data(struct ggml_tensor * tensor) {
if (tensor->backend != GGML_BACKEND_GPU && tensor->backend != GGML_BACKEND_GPU_SPLIT) {
if (!tensor || (tensor->backend != GGML_BACKEND_GPU && tensor->backend != GGML_BACKEND_GPU_SPLIT) ) {
return;
}

Expand Down
4 changes: 0 additions & 4 deletions llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,8 @@ struct llama_kv_cache {
}

#ifdef GGML_USE_CUBLAS
if (k) {
ggml_cuda_free_data(k);
}
if (v) {
ggml_cuda_free_data(v);
}
#endif // GGML_USE_CUBLAS
}
};
Expand Down