#1869 Fix null reference errors when training from scratch with CUDA build
Calling ggml_compute_forward when node->src0 was null was causing train-text-from-scratch.exe to terminate unexpectedly.
This commit is contained in:
parent
d411968e99
commit
2a2f39ef45
1 changed files with 9 additions and 3 deletions
6
ggml.c
6
ggml.c
|
@ -16012,7 +16012,9 @@ void ggml_graph_compute(struct ggml_context * ctx, struct ggml_cgraph * cgraph)
|
|||
/*.wdata =*/ cgraph->work ? cgraph->work->data : NULL,
|
||||
};
|
||||
|
||||
if (node->src0) {
|
||||
ggml_compute_forward(¶ms, node);
|
||||
}
|
||||
|
||||
// COMPUTE
|
||||
if (node->n_tasks > 1) {
|
||||
|
@ -16048,7 +16050,9 @@ void ggml_graph_compute(struct ggml_context * ctx, struct ggml_cgraph * cgraph)
|
|||
}
|
||||
|
||||
params.type = GGML_TASK_COMPUTE;
|
||||
if (node->src0) {
|
||||
ggml_compute_forward(¶ms, node);
|
||||
}
|
||||
|
||||
// wait for thread pool
|
||||
if (node->n_tasks > 1) {
|
||||
|
@ -16103,7 +16107,9 @@ void ggml_graph_compute(struct ggml_context * ctx, struct ggml_cgraph * cgraph)
|
|||
}
|
||||
|
||||
params.type = GGML_TASK_FINALIZE;
|
||||
if (node->src0) {
|
||||
ggml_compute_forward(¶ms, node);
|
||||
}
|
||||
|
||||
// wait for thread pool
|
||||
if (node->n_tasks > 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue