repair_formats#

Differentiable IQ native scale fields; all code and additive bits stay fixed.

Classes

IQScaleState

FP32 log-scale masters projected onto legal native FP16/integer fields.

Functions

repair_grouped_linear

Try compatible native expert banks; heterogeneous/frozen banks keep their forward.

repair_linear

Try the prepared representation without bypassing quantizer post-transforms.

class IQScaleState#

Bases: Module

FP32 log-scale masters projected onto legal native FP16/integer fields.

__init__(quantizer, processed_weight, weight_shape, field_prefix)#

Capture the PTQ payload in logical projection coordinates.

finalize_(quantizer, weight)#

Bake processed coordinates once and persist the exact native codes/scales.

forward(inputs)#

Decode only this replay’s weight and release its expanded levels afterward.

linear(inputs, bias=None)#

Use packed GEMM only in a numerically and empirically qualified regime.

native_payload()#

Write only scale bits into the original native payload.

project_()#

Bound log masters before native projection.

projected_steps()#

Compose the codec’s native hierarchical scale geometry.

scales()#

Project global and local fields with straight-through native rounding.

values()#

Return canonical IDs and FP32 masters for ownership and checkpointing.

repair_grouped_linear(quantizers, inputs, offsets, bias=None, *, is_transposed=False)#

Try compatible native expert banks; heterogeneous/frozen banks keep their forward.

repair_linear(quantizer, inputs, bias=None)#

Try the prepared representation without bypassing quantizer post-transforms.