[CI] Fix ModelExpress handling in weight transfer tests (#59772)
Signed-off-by: Djordje Ramic <djoramic@amd.com>
This commit is contained in:
@@ -7,12 +7,12 @@ Integration tests for NCCL and IPC weight transfer between processes using Ray.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import builtins
|
import builtins
|
||||||
|
import importlib.util
|
||||||
import pickle
|
import pickle
|
||||||
import runpy
|
import runpy
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
from contextlib import nullcontext
|
from contextlib import nullcontext
|
||||||
from pathlib import Path
|
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
@@ -1497,10 +1497,12 @@ class TestDeferredProcessingContract:
|
|||||||
that caller ends up reaching through a getattr."""
|
that caller ends up reaching through a getattr."""
|
||||||
|
|
||||||
def _engines(self):
|
def _engines(self):
|
||||||
return {
|
registry = dict(WeightTransferEngineFactory._registry)
|
||||||
name: loader()
|
# ModelExpress is an optional, separately installed package, but its
|
||||||
for name, loader in WeightTransferEngineFactory._registry.items()
|
# backend is always registered. Skip it when the package is missing.
|
||||||
}
|
if importlib.util.find_spec("modelexpress") is None:
|
||||||
|
registry.pop("modelexpress")
|
||||||
|
return {name: loader() for name, loader in registry.items()}
|
||||||
|
|
||||||
def test_every_engine_declares_whether_it_defers(self):
|
def test_every_engine_declares_whether_it_defers(self):
|
||||||
for name, cls in self._engines().items():
|
for name, cls in self._engines().items():
|
||||||
@@ -2054,11 +2056,11 @@ def test_sparse_nccl_trainer_non_sender_skips_client():
|
|||||||
|
|
||||||
|
|
||||||
def _import_modelexpress_shim():
|
def _import_modelexpress_shim():
|
||||||
path = (
|
spec = importlib.util.find_spec(
|
||||||
Path(__file__).parents[2]
|
"vllm.distributed.weight_transfer.modelexpress_engine"
|
||||||
/ "vllm/distributed/weight_transfer/modelexpress_engine.py"
|
|
||||||
)
|
)
|
||||||
runpy.run_path(str(path), run_name="_test_modelexpress_shim")
|
assert spec is not None and spec.origin is not None
|
||||||
|
runpy.run_path(spec.origin, run_name="_test_modelexpress_shim")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
|||||||
Reference in New Issue
Block a user