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

Support torch deepseek moe #1163

Merged
merged 27 commits into from
Feb 28, 2024
Merged

Conversation

grimoire
Copy link
Collaborator

@grimoire grimoire commented Feb 20, 2024

Add deepseek moe support

require

document would be updated after #1075 merged.

@grimoire grimoire added enhancement New feature or request and removed improvement labels Feb 21, 2024
@lvhan028
Copy link
Collaborator

CUDA_VISIBLE_DEVICES=6,7 lmdeploy chat torch /nvme/shared_data/deepseek/deepseek-moe-16b-chat/ --tp 2

raises

2024-02-26 14:36:44,211 - lmdeploy - ERROR - Init tp model failed with error: [ImportError('This modeling file requires the following packages that were not found in your environment: flash_attn. Run `pip install flash_attn`'), ImportError('This modeling file requires the following packages that were not found in your environment: flash_attn. Run `pip install flash_attn`')]

Do we need to install flash-attn?

@grimoire
Copy link
Collaborator Author

@lvhan028 yes I guess.

@lvhan028
Copy link
Collaborator

新模型的支持,PR需要测试以下功能:

  1. lmdeploy chat torch(交互式对话)
  2. pipeline接口(非交互式)
  3. api_server是否正常(非交互式)

@grimoire
Copy link
Collaborator Author

新模型的支持,PR需要测试以下功能:

  1. lmdeploy chat torch(交互式对话)
  2. pipeline接口(非交互式)
  3. api_server是否正常(非交互式)

All test passed.

ret = f'{self._bos}'
for _, msg in enumerate(messages):
role, content = msg['role'], msg['content']
if role == self.user:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no attribute user. It is _user

for _, msg in enumerate(messages):
role, content = msg['role'], msg['content']
if role == self.user:
ret += f'{self._user} {content}\n\n{self._assistant}'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Tested OK with this change.

Copy link
Collaborator

@RunningLeon RunningLeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

lmdeploy/model.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@AllentDan AllentDan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lvhan028 lvhan028 merged commit 6e01560 into InternLM:main Feb 28, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants