-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: add tests for GGUF #10830
base: master
Are you sure you want to change the base?
tests: add tests for GGUF #10830
Conversation
I forgot: the current master code also has some (minor) memory leaks related to KV arrays.
Actually, how is |
The sanitizer CI failures are expected since the test code is using some of the GGUF code that has memory leaks (so the tests should be disabled prior to merging and reenabled after they are fixed). I don't understand why the linker is failing on Windows. |
On Windows, you need to specify what symbols are to be exported in a DLL. To do that, you need to use
|
Should the symbols be exported? I noticed that while I was working on the GGUF tests some other tests were disabled on Windows because "they use internal functions not exported with LLAMA_API". Wouldn't the same logic apply to |
In these tests, I decided to not make the symbols that they need public, because they have extremely generic names like |
5145fe0
to
fecf662
Compare
9e6cb87
to
7bfd83c
Compare
Note to self: upon failure the current GGUF code can end up giving dangling pointers to user code, that should also be fixed. |
I'm currently working on a C++ refactor of the GGUF code, see discussion in #10655 . I am done with the majority of the implementation. Since GGUF is a critical component I think the correct way to go about a refactor is to write tests that assert that the behavior does not change (tests are of course useful anyways). This PR adds said tests ahead of time and defines the behavior we want the refactored code to have. To assert the correctness of the GGUF code there are three different test scenarios:
NULL
.gguf_set_kv
.The following issues currently exist on master:
only_meta
).The corresponding test cases are commented out (marked with
FIXME
).To make the tests work I'm exposing some internals of the GGUF code in
ggml-impl.h
. For the temporary files I'm usingtmpfile()
which returns a temporaryFILE
pointer that is valid until closed. Unfortunately this seems to require elevated privileges on Windows. For now I'm just skipping the tests on Windows iftmpfile()
fails, with the C++ code it would I think be possible to use a stringstream to simulate file I/O without having to touch the actual file system (the externally visible GGUF interface only passes file names).