Skip to content

Commit 0729edb

Browse files
authored
Merge pull request #1688 from dphnAI/sync/vllm-2026-07-06-9fde043f5
[sync] vLLM 2026-07-06 — 91b564730..9fde043f5
2 parents 03d018b + 289a862 commit 0729edb

85 files changed

Lines changed: 2979 additions & 530 deletions

File tree

Some content is hidden

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

‎.sync/vllm-sha‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4a6bf3c77f05b398b46fe4207ea1ee715d56c64f
1+
ba22152096b2484faa3579624a253d54804d876d

‎aphrodite/_custom_ops.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3331,6 +3331,24 @@ def fused_experts_cpu_fake(
33313331
return torch.empty_like(hidden_states)
33323332

33333333

3334+
if hasattr(torch.ops._C, "dynamic_4bit_int_moe"):
3335+
3336+
@register_fake("_C::dynamic_4bit_int_moe")
3337+
def dynamic_4bit_int_moe_fake(
3338+
x: torch.Tensor,
3339+
topk_ids: torch.Tensor,
3340+
topk_weights: torch.Tensor,
3341+
w13_packed: torch.Tensor,
3342+
w2_packed: torch.Tensor,
3343+
hidden_size: int,
3344+
intermediate_size: int,
3345+
group_size: int,
3346+
apply_router_weight_on_input: bool,
3347+
activation_kind: int,
3348+
) -> torch.Tensor:
3349+
return x.new_empty((x.size(0), hidden_size))
3350+
3351+
33343352
def fused_experts_cpu(
33353353
hidden_states: torch.Tensor,
33363354
w1: torch.Tensor,

‎aphrodite/config/aphrodite.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,12 +1767,19 @@ def try_verify_and_update_config(self):
17671767
if architecture is None:
17681768
return
17691769

1770+
from aphrodite.model_executor.models import ModelRegistry
17701771
from aphrodite.model_executor.models.config import (
17711772
MODELS_CONFIG_MAP,
17721773
HybridAttentionMambaModelConfig,
17731774
)
17741775

17751776
cls = MODELS_CONFIG_MAP.get(architecture, None)
1777+
if cls is None:
1778+
# `architecture` may be an HF base-model name (e.g. "Mamba2Model"
1779+
# when `architectures` is omitted); normalize to the resolved arch
1780+
# so per-arch config hooks are not skipped.
1781+
architecture = ModelRegistry._normalize_arch(architecture, self.model_config)
1782+
cls = MODELS_CONFIG_MAP.get(architecture, None)
17761783
if cls is not None:
17771784
cls.verify_and_update_config(self)
17781785

‎aphrodite/config/model.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ def get_inputs_embeds_size(self) -> int:
11871187
def is_deepseek_mla(self) -> bool:
11881188
return self.model_arch_config.is_deepseek_mla
11891189

1190-
@property
1190+
@cached_property
11911191
def is_mm_prefix_lm(self) -> bool:
11921192
return self.model_arch_config.is_mm_prefix_lm
11931193

‎aphrodite/config/parallel.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,8 @@ def stateless_init_dp_group(self, return_store: bool = False) -> ProcessGroup |
608608

609609
# The all_reduce at the end of attention (during o_proj) means that
610610
# inputs are replicated across each rank of the tensor parallel group.
611-
# If using expert-parallelism with DeepEP All2All ops, replicated
612-
# tokens results in useless duplicate computation and communication.
611+
# If using expert-parallelism, replicated tokens results in useless
612+
# duplicate computation and communication.
613613
#
614614
# In this case, ensure the input to the experts is sequence parallel
615615
# to avoid the excess work.
@@ -628,7 +628,6 @@ def use_sequence_parallel_moe(self) -> bool:
628628
)
629629
and self.enable_expert_parallel
630630
and self.tensor_parallel_size > 1
631-
and self.data_parallel_size > 1
632631
)
633632

634633
@property

‎aphrodite/config/speculative.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"qwen3_5_mtp",
4545
"longcat_flash_mtp",
4646
"minimax_m3_mtp",
47+
"bailing_hybrid_mtp",
4748
"mtp",
4849
"pangu_ultra_moe_mtp",
4950
"step3p5_mtp",
@@ -324,6 +325,13 @@ def hf_config_override(hf_config: PretrainedConfig) -> PretrainedConfig:
324325
n_predict = getattr(hf_config, "num_nextn_predict_layers", None)
325326
hf_config.update({"n_predict": n_predict, "architectures": ["OpenPanguMTPModel"]})
326327

328+
architectures = getattr(hf_config, "architectures", []) or []
329+
if hf_config.model_type == "bailing_hybrid" or "BailingMoeV2_5ForCausalLM" in architectures:
330+
hf_config.model_type = "bailing_hybrid_mtp"
331+
if hf_config.model_type == "bailing_hybrid_mtp":
332+
n_predict = getattr(hf_config, "num_nextn_predict_layers", None)
333+
hf_config.update({"n_predict": n_predict, "architectures": ["BailingMoeV25MTPModel"]})
334+
327335
if hf_config.architectures[0] == "MiMoForCausalLM":
328336
hf_config.model_type = "mimo_mtp"
329337
n_predict = getattr(hf_config, "num_nextn_predict_layers", None)

‎aphrodite/distributed/device_communicators/base_device_communicator.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,8 @@ def __init__(
170170

171171
config = get_current_aphrodite_config_or_none()
172172
if config is not None:
173-
# as long as we use data parallel (coupled data parallel
174-
# where all data parallel ranks execute forward together),
175-
# we initialize the all2all manager used in expert parallel.
176-
use_ep = config.parallel_config.data_parallel_size > 1
173+
# initialize the all2all manager for DP or sequence-parallel EP.
174+
use_ep = config.parallel_config.data_parallel_size > 1 or config.parallel_config.use_sequence_parallel_moe
177175
all2all_backend = config.parallel_config.all2all_backend
178176

179177
self.is_ep_communicator = unique_name.split(":")[0] == "ep"

‎aphrodite/entrypoints/openai/responses/context.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ def append_output(self, output: RequestOutput) -> None:
344344
reasoning=reasoning,
345345
content=content,
346346
tool_calls=tool_calls,
347+
tools=self.request.tools,
347348
)
348349
)
349350
elif completion.text:

‎aphrodite/entrypoints/openai/responses/protocol.py‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,19 @@ def check_tool_usage(cls, data):
557557
)
558558
elif is_named_tool_choice and tools is not None:
559559
tool_name = tool_choice.get("name")
560-
tool_names = {t.get("name") if isinstance(t, dict) else getattr(t, "name", None) for t in tools}
560+
tool_names = set()
561+
for tool in tools:
562+
if isinstance(tool, dict):
563+
if tool.get("type") == "namespace":
564+
namespace = tool.get("name")
565+
for namespaced_tool in tool.get("tools", []):
566+
namespaced_name = namespaced_tool.get("name")
567+
tool_names.add(namespaced_name)
568+
tool_names.add(f"{namespace}__{namespaced_name}")
569+
else:
570+
tool_names.add(tool.get("name"))
571+
else:
572+
tool_names.add(getattr(tool, "name", None))
561573
if not tool_name or tool_name not in tool_names:
562574
raise APHRODITEValidationError(
563575
"Tool choice 'function' not found in 'tools' parameter.",

‎aphrodite/entrypoints/openai/responses/serving.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,7 @@ def _make_response_output_items(
10021002
content=content,
10031003
tool_calls=tool_calls,
10041004
logprobs=logprobs,
1005+
tools=request.tools,
10051006
)
10061007

10071008
# Fallback when no parser is configured
@@ -1246,7 +1247,7 @@ async def _process_simple_streaming_events(
12461247
created_time: int,
12471248
_increment_sequence_number_and_return: Callable[[StreamingResponsesResponse], StreamingResponsesResponse],
12481249
) -> AsyncGenerator[StreamingResponsesResponse, None]:
1249-
processor = SimpleStreamingEventProcessor()
1250+
processor = SimpleStreamingEventProcessor(tools=request.tools)
12501251

12511252
def _get_logprobs(
12521253
output: CompletionOutput,

0 commit comments

Comments
 (0)