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 qwen for pytorch engine #1265

Merged
merged 18 commits into from
Mar 21, 2024
Merged

Conversation

RunningLeon
Copy link
Collaborator

@RunningLeon RunningLeon commented Mar 8, 2024

Motivation

Support Qwen for pytorch engine

opencompass results:
1710216709011

Modification

Please briefly describe what modification is made in this PR.

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)

If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
  3. If the modification has a dependency on downstream projects of a newer version, this PR should be tested with all supported versions of downstream projects.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@RunningLeon RunningLeon marked this pull request as ready for review March 12, 2024 03:14
@RunningLeon RunningLeon changed the title [WIP]: Support qwen for pytorch engine Support qwen for pytorch engine Mar 12, 2024
@jjjjohnson
Copy link
Contributor

Looks like not support logn_attn yet
image

@RunningLeon
Copy link
Collaborator Author

@jjjjohnson hi, thanks for the reminder. Will update later.

@lvhan028 lvhan028 added the enhancement New feature or request label Mar 14, 2024
@lvhan028 lvhan028 merged commit 2dfceef into InternLM:main Mar 21, 2024
5 checks passed
@jjjjohnson
Copy link
Contributor

@RunningLeon Look like there is en error in Qwen pytorch backend...

from lmdeploy.messages import PytorchEngineConfig, EngineGenerationConfig
from lmdeploy.pytorch.engine import Engine
from lmdeploy.serve.async_engine import AsyncEngine
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)



model_name='qwen-14b'
engine_config = PytorchEngineConfig(model_name=model_name,
                                    tp=1,max_batch_size=8,
                                    adapters=None,num_gpu_blocks=200, num_cpu_blocks=100)


engin= AsyncEngine(model_path=model_path, backend='pytorch', model_name=model_name, backend_config=engine_config)

prompts = 'Hello'
engin(prompts)
image

@RunningLeon
Copy link
Collaborator Author

@jjjjohnson Hi, thanks for your feedback. I'll try to reproduce the issue. Coming back to you soon.

@RunningLeon
Copy link
Collaborator Author

RunningLeon commented Mar 27, 2024

@jjjjohnson hi, lmdeploy had supported qwen with old version. It seems you are running new version of Qwen and some rewriting fails in this case. Could try PR #1351? thanks for your understanding.

@jjjjohnson
Copy link
Contributor

Cool! THX!

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

5 participants