Skip to content

gguf-py: enable reading non-native endian files #12081

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

Conversation

AlekseiNikiforovIBM
Copy link
Contributor

Currently self.byte_order is never used.
Actually use it to byteswap read data to
allow reading big endian files on little endian systems and vice versa.

Now it's possible to convert little-endian model
into a big-endian model and back
on a little-endian system.

Currently self.byte_order is never used.
Actually use it to byteswap read data to
allow reading big endian files on little endian systems
and vice versa.

Now it's possible to convert little-endian model
into a big-endian model and back
on a little-endian system.
@github-actions github-actions bot added the python python script changes label Feb 26, 2025
@AlekseiNikiforovIBM
Copy link
Contributor Author

@ericcurtin, could you please review this PR as well?

@ericcurtin ericcurtin merged commit 3567ee3 into ggml-org:master Feb 26, 2025
4 checks passed
@CISC
Copy link
Collaborator

CISC commented Feb 26, 2025

This was already dealt with in #11909

@AlekseiNikiforovIBM
Copy link
Contributor Author

This was already dealt with in #11909

Sorry, I wasn't aware of that PR, and it did not work in master yet.

@CISC
Copy link
Collaborator

CISC commented Feb 26, 2025

Sorry, I wasn't aware of that PR, and it did not work in master yet.

No worries, easy resolve. :)

mglambda pushed a commit to mglambda/llama.cpp that referenced this pull request Mar 8, 2025
Currently self.byte_order is never used.
Actually use it to byteswap read data to
allow reading big endian files on little endian systems
and vice versa.

Now it's possible to convert little-endian model
into a big-endian model and back
on a little-endian system.
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Mar 19, 2025
Currently self.byte_order is never used.
Actually use it to byteswap read data to
allow reading big endian files on little endian systems
and vice versa.

Now it's possible to convert little-endian model
into a big-endian model and back
on a little-endian system.
mostlyuseful pushed a commit to mostlyuseful/llama.cpp that referenced this pull request May 12, 2025
Currently self.byte_order is never used.
Actually use it to byteswap read data to
allow reading big endian files on little endian systems
and vice versa.

Now it's possible to convert little-endian model
into a big-endian model and back
on a little-endian system.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python python script changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants