Merge remote-tracking branch 'upstream/main' into patches

Signed-off-by: MOVZX <movzx@yahoo.com>
This commit is contained in:
2026-09-29 12:54:18 +07:00
264 changed files with 13095 additions and 1541 deletions
+41 -5
View File
@@ -5,6 +5,7 @@ import json
import logging
import os
from dataclasses import MISSING, Field, asdict, dataclass, field
from datetime import timedelta
from pathlib import Path
from types import SimpleNamespace
from typing import cast
@@ -1464,6 +1465,20 @@ def test_all2all_backend_has_portable_default():
assert ParallelConfig().all2all_backend == "allgather_reducescatter"
def test_dp_group_uses_configured_timeout_without_current_config(monkeypatch):
monkeypatch.setattr(vllm_config_module, "_current_vllm_config", None)
config = ParallelConfig(cpu_distributed_timeout_seconds=30)
with (
patch(
"vllm.distributed.utils.rendezvous",
return_value=iter([(torch.distributed.HashStore(), 0, 1)]),
),
patch("vllm.distributed.utils.init_gloo_process_group") as init_group,
):
config.stateless_init_dp_group()
assert init_group.call_args.kwargs["timeout"] == timedelta(seconds=30)
@pytest.mark.parametrize(
"dp_size, across_dp, expected",
[(1, False, 4), (1, True, 4), (2, False, 4), (2, True, 8)],
@@ -1497,21 +1512,42 @@ def test_engram_dp_shared_memory_requires_cpu_offload():
EngramConfig(cpu_offload=False, dp_shared_memory=True)
@pytest.mark.skip_global_cleanup
@pytest.mark.parametrize(
"cpu_offload,dp_size,elastic_ep,expected",
[(True, 2, False, True), (False, 2, False, False), (True, 1, False, False)],
"cpu_offload,use_thp,dp_shared_memory,dp_size,elastic_ep,expected",
[
(True, False, None, 2, False, True),
(False, False, None, 2, False, False),
(True, False, None, 1, False, False),
(True, False, None, 2, True, False),
# use_thp backs private tables; sharing would silently ignore it.
(True, True, None, 2, False, False),
(True, True, False, 2, False, False),
],
)
def test_engram_dp_shared_memory_defaults_when_supported(
cpu_offload, dp_size, elastic_ep, expected
cpu_offload, use_thp, dp_shared_memory, dp_size, elastic_ep, expected
):
"""Unset dp_shared_memory enables sharing only for offloaded, non-elastic DP."""
"""Resolve sharing only where supported, preserving an explicit false."""
parallel = ParallelConfig(data_parallel_size=dp_size)
parallel.enable_elastic_ep = elastic_ep
config = EngramConfig(cpu_offload=cpu_offload)
config = EngramConfig(
cpu_offload=cpu_offload,
use_thp=use_thp,
dp_shared_memory=dp_shared_memory,
)
config.resolve_dp_shared_memory(parallel)
assert config.dp_shared_memory is expected
@pytest.mark.skip_global_cleanup
def test_engram_thp_rejects_explicit_shared_memory():
with pytest.raises(
ValueError, match="use_thp requires cpu_offload=True and dp_shared_memory=False"
):
EngramConfig(use_thp=True, dp_shared_memory=True)
@pytest.mark.parametrize(
"dp_size,load_format,multithread,error",
[