{"record":{"id":"a389f0e0af6c43e8","repo":"tracel-ai/burn","slug":"irfft-kernel-launch-failed-device-input-device","errorCode":null,"errorMessage":"irfft kernel launch failed (device={input_device:?}, dtype={input_dtype:?}, dim={dim}, requested_n={requested_n}, fft_size={fft_size}): {e}","messagePattern":"irfft kernel launch failed \\(device=(.+?), dtype=(.+?), dim=(.+?), requested_n=(.+?), fft_size=(.+?)\\): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-cubecl/src/kernel/fft/base.rs","lineNumber":145,"sourceCode":"    signal_shape[dim] = fft_size;\n\n    let signal = empty_device_dtype(\n        spectrum_re.client.clone(),\n        spectrum_re.device.clone(),\n        signal_shape,\n        spectrum_re.dtype,\n    );\n\n    irfft_launch(\n        &spectrum_re.client.clone(),\n        spectrum_re.binding(),\n        spectrum_im.binding(),\n        signal.clone().binding(),\n        dim,\n        dtype,\n    )\n    .unwrap_or_else(|e| {\n        panic!(\n            \"irfft kernel launch failed (device={input_device:?}, dtype={input_dtype:?}, \\\n             dim={dim}, requested_n={requested_n}, fft_size={fft_size}): {e}\"\n        )\n    });\n\n    if fft_size > requested_n {\n        pad_to_length(signal, dim, requested_n)\n    } else {\n        signal\n    }\n}\n","sourceCodeStart":127,"sourceCodeEnd":157,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-cubecl/src/kernel/fft/base.rs#L127-L157","documentation":"This panic fires when the irfft (inverse real FFT) CubeCL kernel fails to launch. The message includes the input device, dtype, the dimension being transformed, the requested output length n, and the inferred FFT size, plus the underlying kernel error. The library panics because a failed kernel launch is unrecoverable at this API level.","triggerScenarios":"Calling irfft on a CubeTensor whose dtype or device is not supported by the compiled kernel, passing a dim out of range for the tensor rank, or an invalid spectrum shape so requested_n/fft_size are inconsistent; also when the backend returns a launch/compilation error.","commonSituations":"Running on a GPU runtime where the FFT kernel is not compiled for the dtype (e.g. f16 on hardware without support), transforming an innermost dim with a spectrum whose last dimension doesn't match fft_size/2+1, or mismatches after moving tensors between devices.","solutions":["Verify the spectrum tensor has the expected shape (last dim = n/2+1 along `dim`) and dtype supported by the backend","Check the tensor is on a device whose runtime supports the FFT kernel for this dtype","Read the wrapped error `{e}` for the concrete launch failure (compilation vs out-of-bounds)","Reduce to a smaller n / supported dim to isolate whether size or dtype is the problem"],"exampleFix":"// before\nlet out = input.irfft(256, 2);\n// after: ensure spectrum shape matches requested n along dim\nassert_eq!(input.shape().dims[2], 256 / 2 + 1);\nlet out = input.irfft(256, 2);","handlingStrategy":"validation","validationCode":"assert!(matches!(input.dtype, DType::F32 | DType::F16), \"unsupported irfft dtype\");\nassert!(dim < input.dims().len(), \"irfft dim out of range\");\nassert_eq!(input.dims()[dim], requested_n / 2 + 1, \"spectrum shape mismatch\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep spectrum tensors produced by rfft() so shapes match irfft expectations","Check backend kernel support for your dtype/device before using FFT ops","Sanity-check requested_n against spectrum last-dim before transforming"],"tags":["gpu","fft","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"}