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

Transformers past_key_values deprecated #986

Open
hudson-ai opened this issue Aug 15, 2024 · 4 comments · May be fixed by #1047
Open

Transformers past_key_values deprecated #986

hudson-ai opened this issue Aug 15, 2024 · 4 comments · May be fixed by #1047

Comments

@hudson-ai
Copy link
Collaborator

With transformers version 4.44.0 (latest at time of writing), I get a warning regarding the use of past_key_values in the TransformersEngine.

We detected that you are passing past_key_values as a tuple and this is deprecated and will be removed in v4.43. Please use an appropriate Cache class (https://huggingface.co/docs/transformers/v4.41.3/en/internal/generation_utils#transformers.Cache)
You are not running the flash-attention implementation, expect numerical differences.

The warning is clearly wrong (as 4.44.0 > 4.43), but if this usage is truly going to be removed, we need to fix our caching logic.

@usholanb
Copy link

agree, also T5 from

https://github.com/huggingface/transformers/blob/746104ba6f0514159d58dc2fb09c887d0e9d4863/src/transformers/models/t5/modeling_t5.py#L1650

expects past_key_values as Tuple

@Harsha-Nori
Copy link
Collaborator

Harsha-Nori commented Aug 31, 2024

@usholanb, interesting, thanks for sharing! If I'm reading this right, does that mean that we can't continue to support T5 if we move onto the new transformers.Cache API?

@usholanb
Copy link

@Harsha-Nori I don't know. I haven't switched to transformers.Cache myself. Just sharing my concern since this message is making me worried for no clear reason

@hudson-ai
Copy link
Collaborator Author

Getting a new error in CI: "HybridCache not subscriptable" -- may very well be due to them finally making some breaking changes with the Cache API.

https://github.com/guidance-ai/guidance/actions/runs/11050523063

@hudson-ai hudson-ai linked a pull request Oct 11, 2024 that will close this issue
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 a pull request may close this issue.

3 participants