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

ValueError: Invalid cache_implementation (offloaded). #34718

Open
1 of 4 tasks
leigao97 opened this issue Nov 13, 2024 · 0 comments
Open
1 of 4 tasks

ValueError: Invalid cache_implementation (offloaded). #34718

leigao97 opened this issue Nov 13, 2024 · 0 comments
Labels

Comments

@leigao97
Copy link

leigao97 commented Nov 13, 2024

System Info

  • transformers version: 4.46.2
  • Platform: Linux-5.15.0-1049-oracle-x86_64-with-glibc2.35
  • Python version: 3.10.14
  • Huggingface_hub version: 0.25.1
  • Safetensors version: 0.4.5
  • Accelerate version: 1.0.1
  • Accelerate config: not found
  • PyTorch version (GPU?): 2.4.1+cu121 (True)
  • Tensorflow version (GPU?): not installed (NA)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Using distributed or parallel set-up in script?:
  • Using GPU in script?:
  • GPU type: NVIDIA A100-SXM4-40GB

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

I am following the official example to enable KV cache offloading. https://huggingface.co/docs/transformers/en/kv_cache#offloaded-cache

And I got the error message:

  File "/transformers/generation/configuration_utils.py", line 726, in validate
    raise ValueError(
ValueError: Invalid `cache_implementation` (offloaded). Choose one of: ['static', 'offloaded_static', 'sliding_window', 'hybrid', 'mamba', 'quantized', 'static']

Expected behavior

I expected that cache_implementation="offloaded" is a valid option taken by model.generate(). After enabling KV cache offloading, the peak memory usage should go down and inference time should go up.

@leigao97 leigao97 added the bug label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant