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

Optimize 1st token for beam_search #31564

Closed
wants to merge 1 commit into from

Conversation

jiqing-feng
Copy link
Contributor

@jiqing-feng jiqing-feng commented Jun 24, 2024

We can repeat the outputs after the first token instead of repeating the first token inputs. The outputs are identical because the 1st token inputs are the same in each beam.

It could avoid extra computation.

I will update the rest of the generation methods once we agree on this change.

@amyeroberts
Copy link
Collaborator

cc @gante @zucchini-nlp

@jiqing-feng jiqing-feng marked this pull request as ready for review June 24, 2024 08:52
@jiqing-feng
Copy link
Contributor Author

Hi @gante @zucchini-nlp . Could you please take a review? Thx!

@gante
Copy link
Member

gante commented Jun 26, 2024

Hi @jiqing-feng 👋

The PR moves in the right direction, but we will want a different interface for it -- see "prefill" in this tracker. The prefill change is quite sensible with respect to interface, so we'll want to work on it ourselves. However, we'll be open to contributions after we add the prefill stage 🤗

@jiqing-feng
Copy link
Contributor Author

Hi @jiqing-feng 👋

The PR moves in the right direction, but we will want a different interface for it -- see "prefill" in this tracker. The prefill change is quite sensible with respect to interface, so we'll want to work on it ourselves. However, we'll be open to contributions after we add the prefill stage 🤗

Thx! Please let me know when the PR is ready :)

Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot closed this Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants