Provider Interface#
This module defines the abstract base classes that all quantization providers must implement.
If you are building a custom quantization strategy or extending Qwix, you will
implement the QuantizationProvider interface.
- class qwix.QuantizationProvider(rules: Sequence[QuantizationRule])[source]#
Interface for model integration.
A provider can be either explicitly called by model authors, or implicitly injected into the model by using interception.py.
- get_intercept_map() dict[str, Callable[[...], Any]][source]#
Returns the intercept map for interception.wrap_func_intercepted.
- class qwix.QuantizationRule(*, module_path: str = '.*', op_names: Collection[str] = (), weight_qtype: str | type[Any] | dtype | SupportsDType | None = None, act_qtype: str | type[Any] | dtype | SupportsDType | None = None, tile_size: int | float | None = None, act_static_scale: bool | None = None, weight_calibration_method: str = 'absmax', act_calibration_method: str | None = None, act_batch_axes: Collection[int] = (0,))[source]#
Quantization rules that match and configure the quantization behavior.