tracel-ai/burn · error
lookup quantization is not supported by the ndarray backend
Error message
lookup quantization is not supported by the ndarray backend
What it means
Capability guard in the ndarray quantized tensor's `strategy()`: lookup-based (codebook/LUT) quantization has no ndarray implementation, so requesting the quantization strategy of such a tensor panics.
Source
Thrown at crates/burn-ndarray/src/tensor.rs:736
pub fn strategy(&self) -> QuantizationStrategy {
match (self.scheme.mode, self.scheme.block_size()) {
(QuantMode::Symmetric, None) => QuantizationStrategy::PerTensorSymmetric(
SymmetricQuantization::init(self.qparams[0], self.scheme.value),
),
(QuantMode::Symmetric, Some(block_size)) => QuantizationStrategy::PerBlockSymmetric(
self.qparams
.iter()
.map(|&s| {
SymmetricQuantization::init(
self.global.unwrap_or(1.0) * s,
self.scheme.value,
)
})
.collect(),
block_size,
),
(QuantMode::Lookup, _) => {
unimplemented!("lookup quantization is not supported by the ndarray backend")
}
}
}
}
impl TensorMetadata for NdArrayQTensor {
type Device = NdArrayDevice;
fn dtype(&self) -> DType {
DType::QFloat(self.scheme)
}
fn shape(&self) -> Shape {
self.qtensor.shape()
}
fn rank(&self) -> usize {
self.shape().num_dims()
}View on GitHub (pinned to d16f7ba2ed)
Solutions
- Use a symmetric (non-lookup) quantization scheme with the ndarray backend
- Dequantize on a backend that supports lookup quantization before moving to ndarray
- Implement lookup support in burn-ndarray if required
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at crates/burn-ndarray/src/tensor.rs:736 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of tracel-ai/burn@d16f7ba2ed (2026-09-05).
Data as JSON: /api/errors/4942cb6165137ce4.
Report an issue: GitHub.