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

Forcing byte order in numpy at load time (Fixes loading a safetensor from a big endian machine). #193

Closed
wants to merge 2 commits into from

Conversation

Narsil
Copy link
Collaborator

@Narsil Narsil commented Mar 10, 2023

Fixes #190 I guess.

Would be nice to know what happens with Pytorch and endianess too to find a similar fix.

Seems the buffer is not modified so speed shouldn't suffer.
https://numpy.org/doc/stable/reference/generated/numpy.ndarray.newbyteorder.html

Also:
https://lkml.org/lkml/2015/4/24/606

Not sure how many machines are really running big endian, or how to get access or emulate to test all this.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Copy link
Contributor

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know nothing about all of this, so I approve of the styling of the code 😅

@McPatate
Copy link
Member

I know nothing about all of this, so I approve of the styling of the code 😅

Ah, I didn't review because I was counting on you to know what was happening here 😄

I'll take a look in a bit @Narsil

@akx
Copy link
Contributor

akx commented Aug 3, 2023

@Narsil see #307 for pytorch discussion! cc @kiszk :)

(EDIT: oops, sorry, missed the (new) comments in that issue 😅)

@Narsil
Copy link
Collaborator Author

Narsil commented Aug 8, 2023

Closing in favor of #310

@Narsil Narsil closed this Aug 8, 2023
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

Successfully merging this pull request may close these issues.

Rust save ndarray using safetensors
5 participants