-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Enable llama.cpp on s390x big endian platform #3552
Changes from 8 commits
0613562
fa62c8c
1ce890a
8640f3b
e4efbdb
51e9d39
7fc0250
e513abe
eb5b832
4389bda
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -231,8 +231,19 @@ | |
#define GGML_EXIT_SUCCESS 0 | ||
#define GGML_EXIT_ABORTED 1 | ||
|
||
#define GGUF_MAGIC 0x46554747 // "GGUF" | ||
#define GGUF_VERSION 2 | ||
#if defined(__linux__) | ||
#include <endian.h> | ||
#if BYTE_ORDER == LITTLE_ENDIAN | ||
#define GGUF_MAGIC 0x46554747 | ||
#elif BYTE_ORDER == BIG_ENDIAN | ||
#define GGUF_MAGIC 0x47475546 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should either have a comment here to explain it's the same byte sequence in the file or (maybe even better) read raw bytes as Georgi suggested. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now I changed it to char string. |
||
#endif | ||
#else | ||
// Use little endian magic uint_32 value | ||
#define GGUF_MAGIC 0x46554747 | ||
#endif | ||
|
||
#define GGUF_VERSION 3 | ||
|
||
#define GGUF_DEFAULT_ALIGNMENT 32 | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be handle in
GGUFWriter.write_tensor_data
just like you do inadd_tensor
. Conversion script should not have no responsibility for handling endianness other than setting it in the constructor.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monatis updated as your comments