Skip to content

Generate: assisted decoding now uses generate for the assistant#28030

Merged
amyeroberts merged 1 commit intohuggingface:mainfrom
gante:candidate_refactor
Dec 14, 2023
Merged

Generate: assisted decoding now uses generate for the assistant#28030
amyeroberts merged 1 commit intohuggingface:mainfrom
gante:candidate_refactor

Conversation

@gante
Copy link
Copy Markdown
Contributor

@gante gante commented Dec 14, 2023

What does this PR do?

Subset of the original changes in #27979

"Reworks assisted candidate generation to call .generate(), instead of having its own custom generation loop. For most models this is nothing more than a nice abstraction. However, for models with a custom generate() function, this means the assistant model will now make use of it! (🤔 does this mean that DistilWhisper gets better numbers with this refactor?)"

The following tests were run locally and are passing:

  1. RUN_SLOW=1 py.test tests/models/whisper/ -k speculative
  2. py.test tests/ -k test_assisted

@gante gante requested a review from amyeroberts December 14, 2023 09:57
@gante gante mentioned this pull request Dec 14, 2023
1 task
@gante gante force-pushed the candidate_refactor branch from 2033a7b to 132d428 Compare December 14, 2023 10:21
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@gante
Copy link
Copy Markdown
Contributor Author

gante commented Dec 14, 2023

@amyeroberts the failing test is also failing in the daily CI (i.e. unrelated to this PR, as it doesn't depend on assisted generation), and I can't reproduce it on my end 🤔

Copy link
Copy Markdown
Contributor

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the refactor and running the slow tests! Looks a lot cleaner ❤️

@gante
Copy link
Copy Markdown
Contributor Author

gante commented Dec 14, 2023

@amyeroberts I can't merge due to the failing test (which is also failing on main 👀 ). Would you be able to merge?

@gante
Copy link
Copy Markdown
Contributor Author

gante commented Dec 14, 2023

(the test is flaky 👉 #28035)

@amyeroberts
Copy link
Copy Markdown
Contributor

amyeroberts commented Dec 14, 2023

@gante In this case we can merge :)

edit: note this was discussed offline as the reason for failing tests was identified and confirmed as independent from this PR

@amyeroberts amyeroberts merged commit 9e5c28c into huggingface:main Dec 14, 2023
@gante gante deleted the candidate_refactor branch December 14, 2023 13:56
iantbutler01 pushed a commit to BismuthCloud/transformers that referenced this pull request Dec 16, 2023
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