Merge remote-tracking branch 'JohannesGaessler/skip-unused-2' into skip-unused-2

This commit is contained in:
Olivier Chafik 2023-08-30 16:01:49 +01:00
commit 4974f37054
2 changed files with 4 additions and 1 deletions

View file

@ -6475,6 +6475,10 @@ void ggml_cuda_assign_buffers_impl(struct ggml_tensor * tensor, bool scratch, bo
return;
}
if (tensor->backend != GGML_BACKEND_CPU) {
return;
}
// recursively assign CUDA buffers until a compute tensor is found
if (tensor->src[0] != nullptr && tensor->src[0]->backend == GGML_BACKEND_CPU) {
const ggml_op src0_op = tensor->src[0]->op;

View file

@ -2337,7 +2337,6 @@ static struct ggml_cgraph * llm_build_llama(
// Note that we do this even when N==1 so that we don't change the # nodes in the graph,
// otherwise for Metal we'd have to rebuild the concurrency list.
offload_func(cur);
cur = ggml_view_2d(ctx0, cur, n_embd, 1, cur->nb[1], (N - 1)*ggml_element_size(cur)*n_embd);
offload_func(cur);
ggml_set_name(cur, "cur-lastpos");