ggml : skip nops in compute_forward

This commit is contained in:
Georgi Gerganov 2023-10-23 20:36:32 +03:00
parent 6a30bf3e51
commit 8d8d54f834
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

4
ggml.c
View File

@ -16602,6 +16602,10 @@ static void ggml_compute_forward_cross_entropy_loss_back(
static void ggml_compute_forward(struct ggml_compute_params * params, struct ggml_tensor * tensor) { static void ggml_compute_forward(struct ggml_compute_params * params, struct ggml_tensor * tensor) {
GGML_ASSERT(params); GGML_ASSERT(params);
if (tensor->op == GGML_OP_NONE) {
return;
}
#ifdef GGML_USE_CUBLAS #ifdef GGML_USE_CUBLAS
bool skip_cpu = ggml_cuda_compute_forward(params, tensor); bool skip_cpu = ggml_cuda_compute_forward(params, tensor);
if (skip_cpu) { if (skip_cpu) {