{"record":{"id":"22a18ddf8713058a","repo":"tracel-ai/burn","slug":"interpolate-backward-kernel-failed-device-0","errorCode":null,"errorMessage":"interpolate_backward kernel failed (device={0:?}, dtype={1:?}, options={2:?}): {3}","messagePattern":"interpolate_backward kernel failed \\(device=(.+?), dtype=(.+?), options=(.+?)\\): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-cubecl/src/kernel/interpolate/base.rs","lineNumber":125,"sourceCode":"\n    let output_shape = input.shape();\n    let output = empty_device_dtype(\n        input.client.clone(),\n        input.device.clone(),\n        output_shape,\n        input.dtype,\n    );\n\n    cubek_interpolate_backward(\n        &input.client.clone(),\n        input.clone().binding(),\n        out_grad.binding(),\n        output.clone().binding(),\n        map_options(options.clone()),\n        dtype_to_storage_type(input.dtype),\n    )\n    .unwrap_or_else(|e| {\n        panic!(\n            \"interpolate_backward kernel failed (device={0:?}, dtype={1:?}, options={2:?}): {3}\",\n            input.device, input.dtype, options, e\n        )\n    });\n\n    permute_nhwc_to_nchw(output)\n}\n\npub(crate) fn map_mode(mode: InterpolateMode) -> CubekInterpolateMode {\n    match mode {\n        InterpolateMode::Nearest => CubekInterpolateMode::Nearest(CubekNearestMode::Floor),\n        InterpolateMode::NearestExact => CubekInterpolateMode::Nearest(CubekNearestMode::Exact),\n        InterpolateMode::Bilinear => CubekInterpolateMode::Bilinear,\n        InterpolateMode::Bicubic => CubekInterpolateMode::Bicubic,\n        InterpolateMode::Lanczos3 => CubekInterpolateMode::Lanczos3,\n    }\n}\n","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-cubecl/src/kernel/interpolate/base.rs#L107-L143","documentation":"This panic occurs when the backward-pass interpolation (upsampling gradient) kernel fails to launch on the CubeCL backend. It reports the input device, dtype, and the mapped interpolation options alongside the underlying error, since launch failures are fatal to the autodiff step.","triggerScenarios":"Backward pass of interpolate with an unsupported dtype/device combination, an output_grad whose shape is inconsistent with the recorded output shape, or a backend kernel-compile error for the chosen interpolation mode/algorithm.","commonSituations":"Training models with F.interpolate on GPU where f16 kernels aren't available, or shapes changed between forward and backward due to incorrect tensor plumbing.","solutions":["Inspect the wrapped error for the concrete launch failure","Ensure output_grad shape matches the forward output shape used in interpolate","Use a dtype supported by the interpolate kernels (f32 is safest) on the current device","Test the forward interpolate on the same device/dtype first to confirm kernel availability"],"exampleFix":"// before: f16 backward on unsupported device\nlet grad_out = interpolate_backward(grad, output, options); // panics\n// after: cast to f32\nlet grad = grad.cast(DType::F32);\nlet grad_out = interpolate_backward(grad, output.cast(DType::F32), options);","handlingStrategy":"validation","validationCode":"assert_eq!(grad.shape(), output.shape(), \"output_grad must match forward output shape\");\nassert!(matches!(input.dtype, DType::F32 | DType::F16), \"unsupported interpolate dtype\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the forward interpolate once at startup to verify kernel availability","Keep grad/output shapes paired through your autodiff plumbing","Prefer f32 for training-time interpolate ops"],"tags":["gpu","interpolate","backward","kernel-launch","burn"],"backgroundTag":"gpu-kernel-launch-failed","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"}