Skip to content

Conversation

@remi-or
Copy link
Collaborator

@remi-or remi-or commented Oct 15, 2025

In #41569 we restored thr __iter__ method to DynamicCache but I missed the fact that it was also removed from EncoderDecoderCache. This PR fixes that and modifies the __init__ of EncoderDecoderCache in the case of DDP, so it is compatible with the new system.

@remi-or remi-or requested a review from Cyrilvallez October 15, 2025 10:39
@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.

Copy link
Member

@Cyrilvallez Cyrilvallez left a comment

Choose a reason for hiding this comment

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

Whisper and a few others used to rely on the same __init__ as dp/ddp, so they are not happy with the change unfortunately 🥲 Should not be too much trouble to fix it by adding a None though as the other tests on the other PR!

@BenjaminBossan
Copy link
Member

@remi-or I tested this branch on PEFT (pytest tests/test_decoder_models.py tests/test_encoder_decoder_models.py -k "prefix or prompt") and the tests are passing, thanks!

@remi-or remi-or requested a review from Cyrilvallez October 15, 2025 14:29
@remi-or
Copy link
Collaborator Author

remi-or commented Oct 15, 2025

Nice! I think the failing tests have nothing to do with the PR, so this is ready to be merged imo :)

@ydshieh
Copy link
Collaborator

ydshieh commented Oct 15, 2025

run-slow: vit

@github-actions
Copy link
Contributor

This comment contains run-slow, running the specified jobs:

models: ['models/vit']
quantizations: [] ...

@remi-or
Copy link
Collaborator Author

remi-or commented Oct 15, 2025

run-slow: vit

@github-actions
Copy link
Contributor

This comment contains run-slow, running the specified jobs:

models: ['models/vit']
quantizations: [] ...

Copy link
Member

@Cyrilvallez Cyrilvallez left a comment

Choose a reason for hiding this comment

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

Yes, LGTM! Thanks for the fix!

@github-actions
Copy link
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: rag, whisper

@remi-or remi-or merged commit eef9fb2 into main Oct 16, 2025
23 checks passed
@remi-or remi-or deleted the encoder-decoder-cache-fix branch October 16, 2025 12:55
ngazagna-qc pushed a commit to ngazagna-qc/transformers that referenced this pull request Oct 23, 2025
* Fix EncoderDecoder cache

* Add the option for the ddp data tuples to have 2 elems

* Modifiy the order of the KV and sliding

* Adapted RAG and Whisper to new EncoderDecoderCache

* A single comma

* Remove kwargs in map

* Fixed order in manual injection cache test

* Slight changes to support legacy format

* Removed Nonnes
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.

6 participants