quantized
27 memberslucid.nn.quantized`lucid.nn.quantized` — quantized inference modules.
The int8-weight counterparts of the float lucid.nn layers, produced by
lucid.quantization.convert from a calibrated model. Under the
sidecar representation (design B) they store int8 weights + scale /
zero_point buffers and compute in float (dequantize → op →
fake-quantize); the real low-precision GEMM is swapped in at Phase 6.
Also holds the boundary markers QuantStub / DeQuantStub placed in a
float model and their runtime forms Quantize / DeQuantize.
Classes
ELUQuantized lucid.nn.ELU — elu(x, alpha) then output fake-quant.
HardsigmoidQuantized lucid.nn.Hardsigmoid — hardsigmoid(x) then fake-quant.
HardswishQuantized lucid.nn.Hardswish — hardswish(x) then output fake-quant.
LeakyReLUQuantized lucid.nn.LeakyReLU — leaky_relu(x, slope) then fake-quant.
SigmoidQuantized lucid.nn.Sigmoid — sigmoid(x) then output fake-quant.
TanhQuantized lucid.nn.Tanh — tanh(x) then output fake-quant.
Conv1dQuantized 1-D convolution — int8 kernel, dequantize-to-float compute.
Conv2dQuantized 2-D convolution — int8 kernel, dequantize-to-float compute.
Conv3dQuantized 3-D convolution — int8 kernel, dequantize-to-float compute.
ConvTranspose1dQuantized 1-D transposed (fractionally-strided) convolution.
ConvTranspose2dQuantized 2-D transposed (fractionally-strided) convolution.
ConvTranspose3dQuantized 3-D transposed (fractionally-strided) convolution.
FloatFunctional6 methodsFloat-domain quantizable merge ops whose output prepare observes.
QFunctional8 methodsQuantized element-wise merges — each result fake-quantized to one grid.
ConvReLU1d1 methodsQuantized 1-D convolution with a fused ReLU — int8 kernel, float compute.
ConvReLU2d1 methodsQuantized 2-D convolution with a fused ReLU — int8 kernel, float compute.
ConvReLU3d1 methodsQuantized 3-D convolution with a fused ReLU — int8 kernel, float compute.
LinearReLU1 methodsQuantized linear layer with a fused ReLU — int8 weight, float compute.
Linear4 methodsQuantized linear (fully-connected) layer — int8 weight, float compute.
QuantizedLinearMLX4 methodsWeight-only int4/int8 linear backed by a real Metal low-precision GEMM.
DeQuantize2 methodsRuntime exit from the quantized region — identity under design B.
DeQuantStub2 methodsQuantized→float boundary marker — the exit stub of a quantizable model.
Quantize3 methodsRuntime entry into the quantized region — fake-quantizes the input.
QuantStub2 methodsFloat→quantized boundary marker — the entry stub of a quantizable model.
QuantWrapper2 methodsWrap an arbitrary float model with QuantStub / DeQuantStub.
Embedding4 methodsQuantized embedding lookup table — per-row int8, dequantize-on-lookup.
EmbeddingBag4 methodsQuantized EmbeddingBag — per-row int8 table, pooled dequant lookup.