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

No need to copy tokens #1028

Closed
wants to merge 1 commit into from
Closed

No need to copy tokens #1028

wants to merge 1 commit into from

Conversation

howard0su
Copy link
Collaborator

No description provided.

@howard0su howard0su marked this pull request as ready for review April 17, 2023 15:10
@slaren
Copy link
Member

slaren commented Apr 17, 2023

Ironically with N=1, doing this will move more data than the memcpy (a 64-bit pointer instead of just a 32-bit value).

@howard0su
Copy link
Collaborator Author

If we can expose api to create tensor with data, then this will save additional cycles to allocate data of tensor.

@howard0su
Copy link
Collaborator Author

If we can expose api to create tensor with data, then this will save additional cycles to allocate data of tensor.

Ironically with N=1, doing this will move more data than the memcpy (a 64-bit pointer instead of just a 32-bit value).

Overhead is more than the data but also memcpy? I think the intention is not perf, but we should not do the copy here.

@ggerganov
Copy link
Member

Redirecting ggml_tensor.data is not a good thing to do. mmap changes set a precedent, but we should avoid it in general

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.

3 participants