Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Explicit automatic alignment of header #178

Closed
mrsteyk opened this issue Feb 8, 2023 · 5 comments
Closed

Explicit automatic alignment of header #178

mrsteyk opened this issue Feb 8, 2023 · 5 comments

Comments

@mrsteyk
Copy link

mrsteyk commented Feb 8, 2023

My use case might be overly specific, but when writing/using vectorised code on mmap'd safetensors file header sometimes causes everything to have an odd-numbered pointer which breaks even 16 bit vectorisation. Is there a possibility that python bindings will get an option to save with an explicit alignment? Just padding the header should be enough for most use cases.

@Narsil
Copy link
Collaborator

Narsil commented Feb 9, 2023

No it's not overly specific, actually there's already a PR for that.

#148

I was waiting for more need for it before merging, but it seems this is picking up in low level frameworks where alignment could really help speed up load times.

@Narsil
Copy link
Collaborator

Narsil commented Feb 9, 2023

Also I love the project !

If you want pure rust ML framework I recommend https://github.com/coreylowman/dfdx (Still very early on, but there's at least a lot to inspire from IMO).

For instance I implemented https://github.com/Narsil/fast_gpt2 (without dfdx, more like your approach, but still stealing the mkl bindings from dfdx to get the performance ! )

@mrsteyk
Copy link
Author

mrsteyk commented Feb 9, 2023

Thank you, @Narsil! Yeah, doing math low level isn't that popular apart from people who know how to code and are on "sub-par" HW by today's standards. Also thanks for the mention of dfdx and your repo. I didn't even consider trying to use any BLAS lib.

@Narsil
Copy link
Collaborator

Narsil commented Feb 10, 2023

isn't that popular apart from people who know how to code and are on "sub-par" HW by today's standards.

It's still the future in my eyes. The ML fields is somewhat settling and not experimenting as much as it used to, performance is becoming a real concern for anything at scale. And all the python solution for performance are way too clunky to beat compiled code.
This is a very personal view.

@mrsteyk
Copy link
Author

mrsteyk commented Feb 22, 2023

Closing because #148 is merged

@mrsteyk mrsteyk closed this as completed Feb 22, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants