Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

ggml: Check return status for computation.

Jesse Gross87b7af6ceef2
diff --git a/ml/backend/ggml/ggml.go b/ml/backend/ggml/ggml.go
index 5a9fe67e5..8aadad864 100644
--- a/ml/backend/ggml/ggml.go
+++ b/ml/backend/ggml/ggml.go
@@ -602,7 +602,9 @@ func (c *Context) Forward(tensors ...ml.Tensor) ml.Context {
}
func (c *Context) Compute(tensors ...ml.Tensor) {
- C.ggml_backend_sched_graph_compute_async(c.b.sched, c.graph)
+ if status := C.ggml_backend_sched_graph_compute_async(c.b.sched, c.graph); status != C.GGML_STATUS_SUCCESS {
+ panic(fmt.Errorf("error computing ggml graph: %v", status))
+ }
C.ggml_backend_sched_reset(c.b.sched)
needSync := true