ggerganov / ggml

Tensor library for machine learning
MIT License
11.22k stars 1.04k forks source link

`NULL` assert error in MNIST example for current version on Mac #927

Closed Ucag closed 2 months ago

Ucag commented 2 months ago

I met this error on Mac when running mnist example on Mac M2. The program failed on ggml.c check of line 19771 and 19772. Those two checks are:

    assert(*ctx_data == NULL);
    assert(*ctx_eval == NULL);

These two pointers passed through the caller function in examples/mnist/mnist-common.cpp, which are initialized as below:

    struct ggml_context * ctx_data;
    struct ggml_context * ctx_eval;

The error is obvious. It seems that not all compiler will make uninitialized pointer to NULL.