Skip to content

[Feature]: Lazy import DeepseekV32IndexerCache #26794

@noooop

Description

@noooop

🚀 The feature, motivation and pitch

I need to manually downgrade transformers to test some models, such as Qwen/Qwen2.5-Math-PRM-7B, which requires transformers==4.53.2

It's great if lazy import DeepseekV32IndexerCache, so I don't have to comment out these codes every time.

from vllm.model_executor.models.deepseek_v2 import DeepseekV32IndexerCache

from vllm.model_executor.models.deepseek_v2 import DeepseekV32IndexerCache

ds_indexer_layers = get_layers_from_vllm_config(
self.vllm_config, DeepseekV32IndexerCache
)
for layer_name, ds_indexer_module in ds_indexer_layers.items():
kv_cache_spec[layer_name] = ds_indexer_module.get_kv_cache_spec()

Reproduce code

pip install transformers==4.53.2
pytest -s -vvv tests/models/language/pooling/test_reward.py

cc @heheda12345

Alternatives

No response

Additional context

No response

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions