Skip to content

Commit 4dfed0f

Browse files
ceci3keennddyljiamingwang-mtCopilotkeennddyl
authored
upgrade vllm to 0.18.1 (#112)
### PR Category <!-- One of [Core | Vendor | OP | Tools | Others] --> Core ### PR Type <!-- One of [User Experience | New Features | Bug Fixes | Improvements | Performance | Breaking Change | Deprecations | Test Case | Docs | Others] --> Improvements ### Description <!-- Describe what this PR does and why. --> upgrade vllm to 0.18.1 ### Related Issues <!-- Link any related issues: Fixes #issue, Closes #issue, or Related to #issue --> ### Changes <!-- List the key changes made in this PR. --> - ### Testing <!-- How has this change been tested? Include test commands, hardware used, etc. --> - ### Checklist - [ ] I have run the existing tests and they pass - [ ] I have added tests for my changes (if applicable) - [ ] I have updated the documentation (if applicable) --------- Co-authored-by: cyberpioneer <cyberpioneer> Co-authored-by: keennddyl <keennddy@foxmail.com> Co-authored-by: jiamingwang-mt <jiaming.wang@mthreads.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: keennddyl <keenndd@foxmail.com> Co-authored-by: hozier <hozier@mthreads.com> Co-authored-by: cyber-pioneer <116002591+cyber-pioneer@users.noreply.github.com> Co-authored-by: xiangbin <74005582+li199959@users.noreply.github.com> Co-authored-by: XMing <xmhubj@gmail.com>
1 parent fe8f469 commit 4dfed0f

41 files changed

Lines changed: 2438 additions & 4805 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ In theory, vllm-plugin-FL can support all models available in vLLM, as long as n
3535

3636
### Setup
3737

38-
1. Install vllm from the official [v0.13.0](https://github.com/vllm-project/vllm/tree/v0.13.0) (optional if the correct version is installed) or from the fork [vllm-FL](https://github.com/flagos-ai/vllm-FL).
38+
1. Install vllm from the official [v0.18.1](https://github.com/vllm-project/vllm/tree/v0.18.1) (optional if the correct version is installed) or from the fork [vllm-FL](https://github.com/flagos-ai/vllm-FL).
3939

4040

4141
2. Install vllm-plugin-FL
@@ -66,6 +66,7 @@ In theory, vllm-plugin-FL can support all models available in vLLM, as long as n
6666

6767
```sh
6868
git clone https://github.com/flagos-ai/FlagGems
69+
git checkout v5.0.0
6970
cd FlagGems
7071
pip install --no-build-isolation .
7172
# or editble install

tests/unit_tests/ops/test_layernorm.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
class TestRMSNormFL:
1414
"""Test RMSNormFL class behavior."""
1515

16+
def __init__(self):
17+
from vllm.config import VllmConfig, set_current_vllm_config
18+
19+
set_current_vllm_config(VllmConfig())
20+
1621
@pytest.fixture
1722
def mock_call_op(self):
1823
with patch("vllm_fl.ops.layernorm.call_op") as mock:

tests/unit_tests/worker/test_model_runner.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def test_fields_match_expected_contract(self):
6060
"aux_hidden_states",
6161
"ec_connector_output",
6262
"cudagraph_stats",
63+
"slot_mappings",
6364
)
6465
assert ExecuteModelState._fields == expected_fields, (
6566
"ExecuteModelState fields changed - this may break execute_model consumers"
@@ -79,6 +80,7 @@ def test_immutability_prevents_accidental_mutation(self):
7980
aux_hidden_states=None,
8081
ec_connector_output=None,
8182
cudagraph_stats=None,
83+
slot_mappings=None,
8284
)
8385

8486
with pytest.raises(AttributeError):
@@ -101,6 +103,7 @@ def test_unpacking_for_downstream_processing(self):
101103
aux_hidden_states=None,
102104
ec_connector_output=None,
103105
cudagraph_stats=None,
106+
slot_mappings=None,
104107
)
105108

106109
# Simulate downstream unpacking

vllm_fl/__init__.py

Lines changed: 7 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -45,75 +45,19 @@ def register():
4545

4646

4747
def register_model():
48-
"""Register the FL model."""
49-
from vllm import ModelRegistry
50-
import vllm.model_executor.models.qwen3_next as qwen3_next_module
48+
"""Register FL-specific models not yet upstream."""
49+
# Models now upstream in vLLM v0.18.1 (no longer need plugin registration):
50+
# Qwen3NextForCausalLM, Qwen3_5MoeForConditionalGeneration,
51+
# MiniCPMO, KimiK25ForConditionalGeneration, Qwen3_5MoeConfig
5152

52-
# Register Qwen3.5 MoE config
53-
try:
54-
from vllm.transformers_utils.config import _CONFIG_REGISTRY
55-
from vllm_fl.configs.qwen3_5_moe import Qwen3_5MoeConfig
56-
_CONFIG_REGISTRY["qwen3_5_moe"] = Qwen3_5MoeConfig
57-
except Exception as e:
58-
logger.error(f"Register Qwen3.5 MoE config error: {str(e)}")
59-
60-
# Register Qwen3Next model
61-
try:
62-
from vllm_fl.models.qwen3_next import Qwen3NextForCausalLM # noqa: F401
63-
64-
qwen3_next_module.Qwen3NextForCausalLM = Qwen3NextForCausalLM
65-
logger.warning(
66-
"Qwen3NextForCausalLM has been patched to use vllm_fl.models.qwen3_next, "
67-
"original vLLM implementation is overridden"
68-
)
69-
70-
ModelRegistry.register_model(
71-
"Qwen3NextForCausalLM",
72-
"vllm_fl.models.qwen3_next:Qwen3NextForCausalLM"
73-
)
74-
except Exception as e:
75-
logger.error(f"Register Qwen3Next model error: {str(e)}")
76-
77-
# Register Qwen3.5 MoE model
78-
try:
79-
ModelRegistry.register_model(
80-
"Qwen3_5MoeForConditionalGeneration",
81-
"vllm_fl.models.qwen3_5:Qwen3_5MoeForConditionalGeneration"
82-
)
83-
except Exception as e:
84-
logger.error(f"Register Qwen3.5 MoE model error: {str(e)}")
85-
86-
# Register MiniCPMO model
87-
try:
88-
ModelRegistry.register_model(
89-
"MiniCPMO",
90-
"vllm_fl.models.minicpmo:MiniCPMO"
91-
)
92-
except Exception as e:
93-
logger.error(f"Register MiniCPMO model error: {str(e)}")
94-
95-
# Register Kimi-K2.5 model
96-
try:
97-
ModelRegistry.register_model(
98-
"KimiK25ForConditionalGeneration",
99-
"vllm_fl.models.kimi_k25:KimiK25ForConditionalGeneration",
100-
)
101-
except Exception as e:
102-
logger.error(f"Register KimiK25 model error: {str(e)}")
103-
104-
# Register GLM-5 (GlmMoeDsa) model
53+
# Register GLM-5 (GlmMoeDsa) — config not yet upstream
10554
try:
10655
from vllm.transformers_utils.config import _CONFIG_REGISTRY
10756
from vllm_fl.configs.glm_moe_dsa import GlmMoeDsaConfig
10857
_CONFIG_REGISTRY["glm_moe_dsa"] = GlmMoeDsaConfig
10958

110-
from vllm_fl.patches.glm_moe_dsa import apply_model_patches as glm5_model
111-
glm5_model()
112-
113-
ModelRegistry.register_model(
114-
"GlmMoeDsaForCausalLM",
115-
"vllm_fl.models.glm_moe_dsa:GlmMoeDsaForCausalLM"
116-
)
59+
#from vllm_fl.patches.glm_moe_dsa import apply_model_patches as glm5_model
60+
#glm5_model()
11761
except Exception as e:
11862
logger.error(f"Register GlmMoeDsa model error: {str(e)}")
11963

vllm_fl/attention/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ def patch_mm_encoder_attention():
1313
FLASH_ATTN branch to import directly from vllm.vllm_flash_attn with a
1414
fallback to flash_attn.
1515
"""
16-
import vllm.attention.layers.mm_encoder_attention as mm_mod
17-
from vllm.attention.backends.registry import AttentionBackendEnum
16+
import vllm.model_executor.layers.attention.mm_encoder_attention as mm_mod
17+
from vllm.v1.attention.backends.registry import AttentionBackendEnum
1818

1919
def _patched_maybe_get_vit_flash_attn_backend(attn_backend):
2020
if attn_backend == AttentionBackendEnum.FLASH_ATTN:

0 commit comments

Comments
 (0)