Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends LMDeploy’s model support by adding a dedicated config builder for Deepseek V3.2–style models (including a GLM-5-related model_type) and updating documentation to list GLM-5 as supported.
Changes:
- Add
DeepseekV32ModelConfigBuilderand routemodel_typedeepseek_v32/glm_moe_dsato the V3.2-specific cache/env configuration. - Simplify/guard Deepseek V3.2 model internals (remove unused
scale_fmt, avoid unconditional rope scaling factor lookup). - Update supported-model docs and READMEs to include GLM-5.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lmdeploy/pytorch/models/deepseek_v32.py | Removes an unused quant field and tightens rope scaling logic to avoid unnecessary key access. |
| lmdeploy/pytorch/configurations/deepseek_v32.py | Introduces a V3.2-specific config builder with env checks and FP8 cache shape setup; includes glm_moe_dsa routing. |
| lmdeploy/pytorch/configurations/deepseek_v2.py | Removes V3.2 special-casing now handled by the new dedicated builder. |
| docs/zh_cn/supported_models/supported_models.md | Adds GLM-5 to the supported model table. |
| docs/en/supported_models/supported_models.md | Adds GLM-5 to the supported model table. |
| README.md | Lists GLM-5 among supported models. |
| README_zh-CN.md | Lists GLM-5 among supported models. |
| README_ja.md | Lists GLM-5 among supported models. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| """build.""" | ||
| config = DeepseekV2ModelConfigBuilder.build(hf_config, model_path=model_path, **kwargs) | ||
|
|
||
| assert hf_config.use_flash_mla, 'DeepSeek-V3.2 requires flash_mla to be available.' |
There was a problem hiding this comment.
Avoid using assert for runtime/environment requirements (asserts are skipped with python -O). Raise a RuntimeError/ValueError with the same message instead so the check is always enforced.
Suggested change
| assert hf_config.use_flash_mla, 'DeepSeek-V3.2 requires flash_mla to be available.' | |
| if not hf_config.use_flash_mla: | |
| raise RuntimeError('DeepSeek-V3.2 requires flash_mla to be available.') |
lvhan028
approved these changes
Feb 24, 2026
windreamer
pushed a commit
to windreamer/lmdeploy
that referenced
this pull request
Feb 24, 2026
* support glm5 * add map
windreamer
pushed a commit
to windreamer/lmdeploy
that referenced
this pull request
Feb 24, 2026
* support glm5 * add map
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily receiving feedbacks. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
Please describe the motivation of this PR and the goal you want to achieve through this PR.
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