[Feature] support deepseek-vl2 for pytorch engine - #3149
Conversation
|
may update supported models in RADME and supported_models.md |
| except ImportError: | ||
| raise ImportError('Please install timm') from ImportError | ||
|
|
||
| model = timm.create_model( |
There was a problem hiding this comment.
instead of using timm, we may need to add vision transformers using kernels of lmdeploy just like
lmdeploy/lmdeploy/pytorch/models/chatglm2.py
Line 330 in a1b86d9
There was a problem hiding this comment.
I have tried to implement the VisionTransformer part using the upstream repository code, replacing the operators inside with LMDeploy kernels. While upstream code depends on the xformers memory_efficient_attention here, which I replaced with torch scaled_dot_product_attention but yields different tensor outputs.
Therefore, I refer to vllm deepseek-vl2 vision part for simplicity.
I may spare more time and try to accomplish previous attempts to reuse LMDeploy kernels instead of timm.
There was a problem hiding this comment.
using pure timm without xformers is show and if it can be repalced with sdpa, it can be replaced by kernels in lmdeploy as well.
There was a problem hiding this comment.
Let's make another PR to replace timm.
…oad_state_dict * commit 'f6f7a5d707e3ccbc69af10babf1c9afcaf72a402': fix deepseekv2 has no attribute use_mla error (InternLM#3188) fix blocked fp8 moe (InternLM#3181) [Feature] support deepseek-vl2 for pytorch engine (InternLM#3149) make turbomind support gpu embedding inputs (InternLM#3177) fix temperature=0 (InternLM#3176) Update qwen2.py (InternLM#3174) Fix tool call prompt for InternLM and Qwen (InternLM#3156) Use pad_token_id as image_token_id for vl models (InternLM#3158) fix default temperature value (InternLM#3166) fix min length penalty (InternLM#3150) update cuda runtime package dependencies (InternLM#3142) fix typing (InternLM#3153) support deepseekv2 for maca backend. (InternLM#2918) fix the issue that stop_token may be less than defined in model.py (InternLM#3148) [fix] fix vl gradio, use pipeline api and remove interactive chat (InternLM#3136) [feature] add dlinfer w8a8 support. (InternLM#2988) Use aiohttp inside proxy server && add --disable-cache-status argument (InternLM#3020) support eos_token list in turbomind (InternLM#3044)
* support deepseek-vl2 for pytorch engine * cleanup the codes * fix, update doc and UT * fix config check rule * resolve review suggestions, fix bugs * fix typo * fix bug, update doc * update doc, add trans version check * update doc * update doc * cleanup * supress tokenizer parallelism warnings * update * update doc
Motivation
Issue 3042 support DeepSeek-VL2 for the PyTorch engine.
Modification
BC-breaking (Optional)
Does the modification introduce changes that break the backward-compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.
Use cases (Optional)
Single image inference
Expected outputs:

Multi-round conversations
Checklist