diff --git a/evolution/hardware_optimizer.py b/evolution/hardware_optimizer.py index 27866e1..67dd7da 100644 --- a/evolution/hardware_optimizer.py +++ b/evolution/hardware_optimizer.py @@ -1,5 +1,29 @@ -"""Phase 19: Hardware-Aware Inference Optimization. -Part of the TurboQuant suite for local inference excellence. +"""Backward-compatible shim for hardware-aware quantization selection. + +The original Phase 19 placeholder `hardware_optimizer.py` never shipped real +logic. The canonical implementation now lives in `evolution.quant_selector`. +This shim preserves the legacy import path for any downstream callers while +making `quant_selector.py` the single source of truth. """ -import logging -# ... (rest of the code) + +from evolution.quant_selector import ( # noqa: F401 + HardwareInfo, + QuantLevel, + QuantSelection, + QUANT_LEVELS, + detect_hardware, + estimate_kv_cache_gb, + estimate_model_memory_gb, + select_quant_level, +) + +__all__ = [ + "HardwareInfo", + "QuantLevel", + "QuantSelection", + "QUANT_LEVELS", + "detect_hardware", + "estimate_kv_cache_gb", + "estimate_model_memory_gb", + "select_quant_level", +] diff --git a/tests/test_hardware_optimizer.py b/tests/test_hardware_optimizer.py new file mode 100644 index 0000000..72358a1 --- /dev/null +++ b/tests/test_hardware_optimizer.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +"""Tests for hardware_optimizer compatibility shim.""" + +import os +import sys + +sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) + +from evolution import hardware_optimizer, quant_selector + + +def test_hardware_optimizer_reexports_quant_selector_api(): + assert hardware_optimizer.select_quant_level is quant_selector.select_quant_level + assert hardware_optimizer.detect_hardware is quant_selector.detect_hardware + assert hardware_optimizer.HardwareInfo is quant_selector.HardwareInfo + assert hardware_optimizer.QuantSelection is quant_selector.QuantSelection + + +def test_hardware_optimizer_exports_quant_level_definitions(): + assert hardware_optimizer.QUANT_LEVELS is quant_selector.QUANT_LEVELS + assert hardware_optimizer.QuantLevel is quant_selector.QuantLevel