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

Fix EncoderDecoder cache candidate edge case #33926

Closed

Conversation

ylacombe
Copy link
Contributor

@ylacombe ylacombe commented Oct 3, 2024

What does this PR do?

Whisper introduced EncoderDecoder cache, which in some cases - e.g distil whisper, can have empty cache layers. This aims to fix this.

Note that this allows speculative decoding for Whisper again, but that the two linked issues still fails because the decoding with assistant decoder is not as fast, at least on my machine: test_speculative_decoding_whisper_distil , test_speculative_decoding_distil

cc @ArthurZucker @eustlb

@ylacombe ylacombe requested a review from ArthurZucker October 3, 2024 16:40
@HuggingFaceDocBuilderDev

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.

past_key_values[idx][1][:, :, :max_length, :],
)
)
if past_key_values[idx] != ([],) * len(past_key_values[idx]):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mmm speedwise some stuff might break compile but not sure candidate generator was supported. Also sorry again for this break, introduced in Mllama 😢 will be in patch.

@eustlb
Copy link
Contributor

eustlb commented Dec 18, 2024

Closing as it was fixed in #34135 ! 🤗

@eustlb eustlb closed this Dec 18, 2024
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.

4 participants