tracel-ai/burn · error
Not yet supported, will be used for quantization
Error message
Not yet supported, will be used for quantization
What it means
`elem_type_to_dtype` in crates/burn-backend/src/cubecl.rs converts CubeCL element types to Burn `DType`; low-precision float kinds (E2M1x2, E2M3, E3M2, E4M3, E5M2, UE8M0 — FP4/FP6/FP8-style formats) hit `unimplemented!("Not yet supported, will be used for quantization")` because these formats are reserved for future quantization support.
Source
Thrown at crates/burn-backend/src/cubecl.rs:46
///
/// Panics if the cubecl type has no direct burn equivalent (e.g. `TF32`).
pub fn elem_type_to_dtype(value: ElemType) -> DType {
match value {
ElemType::Float(float_kind) => match float_kind {
FloatKind::F16 => DType::F16,
FloatKind::BF16 => DType::BF16,
FloatKind::Flex32 => DType::Flex32,
FloatKind::F32 => DType::F32,
FloatKind::F64 => DType::F64,
FloatKind::TF32 => panic!("Not a valid DType for tensors."),
FloatKind::E2M1
| FloatKind::E2M1x2
| FloatKind::E2M3
| FloatKind::E3M2
| FloatKind::E4M3
| FloatKind::E5M2
| FloatKind::UE8M0 => {
unimplemented!("Not yet supported, will be used for quantization")
}
},
ElemType::Int(int_kind) => match int_kind {
IntKind::I8 => DType::I8,
IntKind::I16 => DType::I16,
IntKind::I32 => DType::I32,
IntKind::I64 => DType::I64,
},
ElemType::UInt(uint_kind) => match uint_kind {
UIntKind::U8 => DType::U8,
UIntKind::U16 => DType::U16,
UIntKind::U32 => DType::U32,
UIntKind::U64 => DType::U64,
},
_ => panic!("Not a valid DType for tensors."),
}
}
View on GitHub (pinned to d16f7ba2ed)
Solutions
- Use a supported float dtype (F32/F16/BF16) for the tensor/kernel output instead of the microscaling float kinds.
- Keep quantized data in a supported scale dtype (see ScaleDtype handling) and store quantized values as integer dtypes.
- Upgrade Burn to a version where the FP8/FP4 dtype mapping is implemented.
Example fix
// before let dtype = elem_type_to_dtype(ElemType::Float(FloatKind::E4M3)); // panics // after let dtype = elem_type_to_dtype(ElemType::Float(FloatKind::BF16)); // supported
Defensive patterns
Strategy: validation
Validate before calling
fn is_supported_float_kind(kind: &FloatKind) -> bool {
!matches!(kind, FloatKind::E2M1x2 | FloatKind::E2M3 | FloatKind::E3M2 | FloatKind::E4M3 | FloatKind::E5M2 | FloatKind::UE8M0)
} Type guard
fn is_microscaling(kind: &FloatKind) -> bool {
matches!(kind, FloatKind::E2M1x2 | FloatKind::E2M3 | FloatKind::E3M2 | FloatKind::E4M3 | FloatKind::E5M2 | FloatKind::UE8M0)
} Prevention
- Restrict kernels/outputs to F32/F16/BF16 until FP8/FP4 mapping lands.
- Validate dtype conversions in tests when upgrading CubeCL versions.
- Keep quantized payloads in int dtypes with supported scale dtypes.
When it happens
Trigger: Converting a CubeCL `FloatKind::E2M1x2|E2M3|E3M2|E4M3|E5M2|UE8M0` element type to a Burn dtype — e.g. when a kernel or tensor uses microscaling/FP8 types and the result metadata is mapped back to Burn dtypes via `run`, `reduce_logical`, `reduce_dim_with_indices`, or `init_reduce_output`.
Common situations: Enabling FP8/FP4 quantized kernels on CubeCL-backed hardware; upgrading CubeCL where new float kinds appear in tensor metadata while Burn's mapping lacks support.
Related errors
- Not yet supported
- ctc_loss_backward: 2 * max_target_len + 1 = {} exceeds the k
- Can't store native sub-byte values
- Should be float, got quantized
- Expected quantized dtype, got {:?}
AI-assisted analysis of tracel-ai/burn@d16f7ba2ed (2026-09-05).
Data as JSON: /api/errors/640eed182b5d963d.
Report an issue: GitHub.