[CI/Build][The Rock] Use model_class_overrides so spawned worker can use test PredictableLlamaForCausalLM class when worker spawned using Python 3.14 (#49218)

Signed-off-by: Randall Smith <Randall.Smith@amd.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
rasmith
2026-08-26 00:55:07 -07:00
committed by GitHub
co-authored by mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 796822d141
commit cde7ba92da
3 changed files with 16 additions and 15 deletions
@@ -8,7 +8,7 @@ import pytest
import torch
from tests.utils import create_new_process_for_each_test, multi_gpu_test
from vllm import LLM, ModelRegistry, SamplingParams
from vllm import LLM, SamplingParams
from vllm.distributed.kv_transfer.kv_connector.v1 import (
example_hidden_states_connector,
)
@@ -67,16 +67,12 @@ def predictable_llama_config_path(tmp_path_factory):
return str(config_dir)
@pytest.fixture(scope="module", autouse=True)
def register_predictable_model():
"""Register the PredictableLlamaForCausalLM model."""
from .predictable_llama import PredictableLlamaForCausalLM
if "PredictableLlamaForCausalLM" not in ModelRegistry.get_supported_archs():
ModelRegistry.register_model(
"PredictableLlamaForCausalLM", PredictableLlamaForCausalLM
)
yield
# Need for Python 3.14 compatibility, vLLM with force spawn due to CUDA
# reinitialization, and register will not persist.
PREDICTABLE_LLAMA_MODEL_CLS = (
"tests.v1.kv_connector.extract_hidden_states_integration"
".predictable_llama:PredictableLlamaForCausalLM"
)
def test_extract_hidden_states_with_predictable_dummy_model(
@@ -104,6 +100,9 @@ def test_extract_hidden_states_with_predictable_dummy_model(
llm = LLM(
model=predictable_llama_config_path,
model_class_overrides={
"PredictableLlamaForCausalLM": PREDICTABLE_LLAMA_MODEL_CLS,
},
speculative_config={
"method": "extract_hidden_states",
"num_speculative_tokens": 1,