Skip to content

economize.errors

The exception hierarchy.

Exception hierarchy. Every error raised on purpose by economize derives from :class:EconomizeError.

EconomizeError

Bases: Exception

Base class of all economize errors.

ConfigError

Bases: EconomizeError, ValueError

A configuration value is invalid, alone or for the model it is applied to.

UnknownNameError

Bases: EconomizeError, KeyError

A registry lookup failed. The message lists the registered names.

UnregisteredNameError

Bases: ConfigError, UnknownNameError

A configuration field names an entry its registry lacks: a :class:ConfigError and an :class:UnknownNameError (so except ValueError and except KeyError both catch it).

DuplicateNameError

Bases: EconomizeError, ValueError

A name was registered twice without override=True.

UnsupportedModelError

Bases: EconomizeError, TypeError

The model's architecture, attention implementation or cache layout is not supported.

IncompatibleTechniquesError

Bases: EconomizeError, ValueError

Two requested techniques cannot be combined on one model.

CheckpointFormatError

Bases: EconomizeError, ValueError

A checkpoint could not be recognised or does not match its configuration.

NonFiniteLossError

Bases: EconomizeError, FloatingPointError

A training step's loss is NaN or infinite (see TrainConfig.nonfinite).

UnsupportedEngineVersionError

Bases: EconomizeError, ImportError

An engine whose private classes economize patches (vLLM, SGLang, TRL) is missing or installed in a release outside the tested range (see economize._compat.ENGINES).

UntestedEngineWarning

Bases: UserWarning

An engine release outside the tested range runs because economize._compat.ALLOW_UNTESTED_ENV allows it.

SimulatedPathWarning

Bases: UserWarning

A technique attached on a path that reproduces its outputs without realizing its saving (a dequantized or masked reference; see :class:~economize.Simulation). Quality numbers are valid; memory and speed numbers of the path are not those of the technique.

CalibrationMismatchWarning

Bases: UserWarning

A checkpoint's weight techniques, replayed on load, produced weights other than those it was saved with.

The base model matches the checkpoint's, so the calibration differed: other calibration data, or a device or library version that rounds differently. Pass the calibration data the checkpoint was made with.

UnknownFieldWarning

Bases: UserWarning

A saved configuration names fields this version of economize does not know (typically a checkpoint written by a newer release). The fields are ignored and the configuration is built from the fields that are known.

TeacherMismatchWarning

Bases: UserWarning

The base model's weights differ from those a checkpoint was saved with (see teacher_fingerprint).

Lossless decoding stays exact; trained drafters may be accepted less often and lossy decoding may degrade.