Skip to content

Use numpy for internal buffers #277

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

Merged
merged 10 commits into from
May 30, 2023
Merged

Use numpy for internal buffers #277

merged 10 commits into from
May 30, 2023

Conversation

abetlen
Copy link
Owner

@abetlen abetlen commented May 26, 2023

Replace internal buffers with numpy arrays, should reduce memory usage and inference time as numpy buffers can be passed directly to c.

@abetlen abetlen changed the title Add support for numpy Use numpy for internal buffers May 27, 2023
@abetlen
Copy link
Owner Author

abetlen commented May 27, 2023

One potential gotch we should watch for is that numpy structured arrays are not necessarily aligned like the corresponding c-structures https://numpy.org/doc/stable/user/basics.rec.html#automatic-byte-offsets-and-alignment

Not sure what the general solution to this would be however.

@abetlen abetlen merged commit 49fe939 into main May 30, 2023
@abetlen abetlen deleted the add-numpy-support branch June 9, 2023 00:33
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.

1 participant