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

Are derived shapes possible? #227

Closed
LoganDark opened this issue Jun 3, 2023 · 3 comments
Closed

Are derived shapes possible? #227

LoganDark opened this issue Jun 3, 2023 · 3 comments

Comments

@LoganDark
Copy link
Contributor

As a part of implementing RWKV sequence mode, I want to do what basically amounts to ggml_get_rows(ctx, model.emb, tokens), but where tokens could possibly be any length.

ggml stops there; this isn't allowed. If the length of the tensor at computation time is different than the length at creation time, ggml throws an assert. This means that I need a new computation graph for each length of sequence, because I need to call ggml_get_rows again.

Is this something that ggml plans to, or even can, support? I know with its style of allocation, this might not be possible without bailing each tensor out into its own allocation, but still.

@LoganDark
Copy link
Contributor Author

Actually, closing this because I can destroy and rebuild a graph when needed (they are cheap).

@LoganDark LoganDark closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2023
@ggerganov
Copy link
Owner

Yes, for now I think we should just rebuild the graph in such cases.
Maybe in the future we will come up with an alternative solution, but I think this is good since it is very cheap overall

@LoganDark
Copy link
Contributor Author

LoganDark commented Jun 18, 2023

Yes, for now I think we should just rebuild the graph in such cases. Maybe in the future we will come up with an alternative solution, but I think this is good since it is very cheap overall

I mean the recursive find-parents that takes upwards of 2 seconds would like to have a word, but yeah other than that fine

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

No branches or pull requests

2 participants