Skip to content
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

GGUF files not portable depending on sizeof(enum ggml_type) #1038

Open
JohannesGaessler opened this issue Dec 2, 2024 · 1 comment
Open

Comments

@JohannesGaessler
Copy link
Collaborator

GGUF files store an enum ggml_type for each ggml_tensor. The file reads and writes of this type are of size sizeof(enum ggml_type) bytes. To my knowledge the underlying datatype for enums is int so this is not portable if the size of int varies (though it should be 4 bytes on most platforms).

@slaren
Copy link
Collaborator

slaren commented Dec 2, 2024

The same applies to sizeof(bool). Additionally sizeof(float) and sizeof(double) may vary if __STDC_IEC_559__ is not defined. In practice it is not likely to cause issues in the supported platforms, but it would be good to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants