{"record":{"id":"e2024bcfe3b937af","repo":"tracel-ai/burn","slug":"unsupported-precision-for-fusion","errorCode":null,"errorMessage":"Unsupported precision for fusion","messagePattern":"Unsupported precision for fusion","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-cubecl-fusion/src/engine/codegen/ir.rs","lineNumber":1009,"sourceCode":"        match value {\n            DType::F32 => Self::F32,\n            DType::Flex32 => Self::Flex32,\n            DType::F16 => Self::F16,\n            DType::BF16 => Self::BF16,\n            DType::I64 => Self::I64,\n            DType::I32 => Self::I32,\n            DType::I16 => Self::I16,\n            DType::I8 => Self::I8,\n            DType::U64 => Self::U64,\n            DType::U32 => Self::U32,\n            DType::U16 => Self::U16,\n            DType::U8 => Self::U8,\n            DType::Bool(BoolStore::Native) => Self::U32,\n            DType::Bool(BoolStore::U8) => Self::U8,\n            DType::Bool(BoolStore::U32) => Self::U32,\n            DType::F64 => Self::F64,\n            DType::QFloat(scheme) => Self::from_quant_scheme(scheme)\n                .unwrap_or_else(|| unimplemented!(\"Unsupported precision for fusion\")),\n        }\n    }\n}\n\nimpl Display for FuseArg {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        match self {\n            FuseArg::Input(pos, ..) => write!(f, \"input({pos})\"),\n            FuseArg::Output(pos, ..) => write!(f, \"output({pos})\"),\n            FuseArg::BlockLocal { pos, ty } => write!(f, \"local({pos}, {ty:?})\"),\n            FuseArg::MultiBlockLocal(mbp, ..) => write!(f, \"{mbp}\"),\n            FuseArg::MultiBlockGlobal(mbp, ..) => write!(f, \"global_{mbp}\"),\n            FuseArg::Scalar(pos, ..) => write!(f, \"scalar({pos})\"),\n            FuseArg::ScalarShape(pos) => write!(f, \"scalar_shape({pos})\"),\n            FuseArg::Literal(val, ..) => write!(f, \"literal_{val}\"),\n            FuseArg::InputReshaped { original, .. } => write!(f, \"input_reshaped_{original}\"),\n            FuseArg::InputSwapDims { original, .. } => write!(f, \"input_swap_dims_{original}\"),\n        }","sourceCodeStart":991,"sourceCodeEnd":1027,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-cubecl-fusion/src/engine/codegen/ir.rs#L991-L1027","documentation":"The fusion engine's codegen IR maps Burn DTypes to fusion IR element types. When a tensor carries a quantized dtype (QFloat) whose quantization scheme cannot be lowered to a fusion IR type, this unimplemented! panics. It signals that fused-kernel codegen does not yet support that quantization scheme.","triggerScenarios":"Calling a fused operation (via burn-cubecl-fusion engine) on a tensor whose dtype is DType::QFloat with a quantization scheme whose From<QuantScheme> conversion returns None, e.g. an exotic packing/block scheme unsupported by the fusion IR.","commonSituations":"Using quantized models (INT8/FP8/4-bit packing variants) with the fusion engine enabled; enabling fusion after migrating a quantized workload; new quant schemes added to burn-core but not yet supported by fusion codegen.","solutions":["Disable the fusion engine for this workload or run the quantized op outside a fused region so it falls back to the eager CubeCL path","Use a quantization scheme supported by the fusion engine (e.g. plain per-tensor/per-block INT8) via QuantScheme::setting or q_params configuration","Check the burn version and upgrade — fusion support for more quant schemes is added over time","File/track an issue on burn to request fusion codegen for the specific scheme"],"exampleFix":"// before\nlet tensor = Tensor::<Backend, 2>::from_data(data, &device).quantize(&qconfig); // fused op panics\n// after\nlet tensor = Tensor::<Backend, 2>::from_data(data, &device).quantize(&QuantizationStrategy::PerTensorInt8(...)); // supported scheme","handlingStrategy":"validation","validationCode":"fn fusion_supports_dtype(dtype: DType) -> bool {\n    match dtype {\n        DType::QFloat(scheme) => matches!(scheme, QuantScheme::PerTensor... /* supported schemes only */),\n        _ => true,\n    }\n}","typeGuard":"fn is_non_quant(t: &Tensor<B, R>) -> bool { !matches!(t.dtype, DType::QFloat(_)) }","tryCatchPattern":"// unimplemented! panics; cannot be caught as Result in Rust.\n// Guard before the fused call:\nif fusion_supports_dtype(tensor.dtype) { fused_op(tensor) } else { eager_op(tensor) }","preventionTips":["Check the quant scheme against fusion-supported schemes before enabling fusion","Run quantized workloads on the eager path","Keep burn updated for new fusion quant support"],"tags":["quantization","fusion","gpu","unimplemented"],"backgroundTag":"unsupported-dtype-for-fusion","analyzedSha":"d16f7ba2ed0d41408189384044cc886fb4c8f957","analyzedAt":"2026-09-05T13:19:14.260Z","contentChangedAt":"2026-09-05T13:19:14.260Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}