[Test] Unify L2/L3 test layout, Buildkite steps, and test helpers (#2556)
Signed-off-by: wangyu <410167048@qq.com> Signed-off-by: Huang, Zeyu <11222265+fhfuih@users.noreply.github.com> Signed-off-by: wangyu <53896905+yenuo26@users.noreply.github.com> Co-authored-by: Huang, Zeyu <11222265+fhfuih@users.noreply.github.com>
This commit is contained in:
1 parent
b85833eeec
commit
6f2ad7b403
134 files changed
+4904
-4185
No files matched your search
@@ -7,19 +7,46 @@ For modelopt FP8/FP4/MXFP8 checkpoints the Thinker LM is the only
|
||||
quantized component. Vision and audio encoder weights are BF16 with no
|
||||
FP8 scale tensors — passing quant_config to them causes FP8 kernels to
|
||||
run on BF16 weights, producing garbage embeddings.
|
||||
|
||||
**Import note (pytest + ``tests/model_executor`` only):** :mod:`vllm_omni.quantization`
|
||||
:file:`__init__` pulls ``factory``/``inc`` and reproduces vLLM CustomOp double
|
||||
registration. We load the same :file:`component_config.py` via
|
||||
:data:`importlib` under a *non-package* name so the package ``__init__`` is
|
||||
never executed for this file.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
from vllm_omni.quantization.component_config import (
|
||||
PRE_QUANTIZED_METHODS,
|
||||
ComponentQuantizationConfig,
|
||||
resolve_encoder_quant_config,
|
||||
)
|
||||
_CC_MODULE_NAME = "_vllm_omni_tests_component_config_encoder_quant"
|
||||
|
||||
|
||||
def _load_component_config():
|
||||
if _CC_MODULE_NAME in sys.modules:
|
||||
return sys.modules[_CC_MODULE_NAME]
|
||||
root = Path(__file__).resolve().parents[3]
|
||||
path = root / "vllm_omni" / "quantization" / "component_config.py"
|
||||
if not path.is_file():
|
||||
raise FileNotFoundError(f"expected component_config at {path}")
|
||||
spec = importlib.util.spec_from_file_location(_CC_MODULE_NAME, path)
|
||||
if spec is None or spec.loader is None:
|
||||
raise RuntimeError("failed to create import spec for component_config")
|
||||
mod = importlib.util.module_from_spec(spec)
|
||||
sys.modules[_CC_MODULE_NAME] = mod
|
||||
spec.loader.exec_module(mod)
|
||||
return mod
|
||||
|
||||
|
||||
_cc = _load_component_config()
|
||||
PRE_QUANTIZED_METHODS = _cc.PRE_QUANTIZED_METHODS
|
||||
ComponentQuantizationConfig = _cc.ComponentQuantizationConfig
|
||||
resolve_encoder_quant_config = _cc.resolve_encoder_quant_config
|
||||
|
||||
pytestmark = [pytest.mark.core_model, pytest.mark.cpu]
|
||||
|
||||
|
||||
Reference in new issue
Block a user