这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@BenjaminBossan
Copy link
Member

In #2737, we fixed some code that relied on the deprecated attribute but some was being missed, as it only runs on the nightly CI with multiple GPUs. This PR fixes this.

Note that the original transformers code that this solution was based on no longer exists, as transformers now initializes the cache lazily, so pre-allocating the keys and values to the correct device is not necessary. But since prefix tuning inserts "virtual" keys/values, we still have to ensure the correct device in PEFT.

I have tested the failing tests locally and they pass.

In huggingface#2737, we fixed some code that relied on the deprecated attribute but
some was being missed, as it only runs on the nightly CI with multiple
GPUs. This PR fixes this.

Note that the original transformers code that this solution was based on
no longer exists, as transformers now initializes the cache lazily, so
pre-allocating the keys and values to the correct device is not
necessary. But since prefix tuning inserts "virtual" keys/values, we
still have to ensure the correct device in PEFT.

I have tested the failing tests locally and they pass.
@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
Collaborator

@githubnemo githubnemo 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 fixing this :)

@BenjaminBossan BenjaminBossan merged commit 5d97453 into huggingface:main Sep 4, 2025
25 of 27 checks passed
@BenjaminBossan BenjaminBossan deleted the fix-cache-deprecated-key_cache-attr-part2 branch September 4, 2025 12:47
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