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

Parallel forward #74

Open
neverix opened this issue Jul 14, 2022 · 4 comments
Open

Parallel forward #74

neverix opened this issue Jul 14, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@neverix
Copy link
Contributor

neverix commented Jul 14, 2022

The model's decoder right now only supports sequential decoding. This is because of the way attn_state is implemented. Parallel generation forward pass can be implemented by setting attn_state to None and handling all cases inside generation code

This would help solve #58

@kuprel
Copy link
Owner

kuprel commented Jul 14, 2022

I'm not sure what you mean. Are you saying parallel forward over the 256 image tokens? That wouldn't work because each token depends on the previous token. And if you meant parallel over the layers that wouldn't work either since each layer depends on the previous layer's output. Maybe you meant parallel backward?

@neverix
Copy link
Contributor Author

neverix commented Jul 14, 2022

Right now the code can't just do forward over all tokens because of the caching implementation. It needs to run through every token instead of just masking the attention

@kuprel
Copy link
Owner

kuprel commented Jul 14, 2022

Oh I see, it would be for if you wanted to do a forward pass over all tokens at once, instead of sampling one after the other.

@kuprel kuprel added the enhancement New feature or request label Jul 17, 2022
@neverix
Copy link
Contributor Author

neverix commented Jul 19, 2022

#80 solves this

kuprel added a commit that referenced this issue Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants