tracel-ai/burn · error

Distributed operations are not supported for tensor kind {ot

Error message

Distributed operations are not supported for tensor kind {other:?}

What it means

In the distributed float tensor dispatch macro, if a tensor's DispatchTensorKind matches no supported backend arm, the fallback panics 'Distributed operations are not supported for tensor kind {other:?}'.

Source

Thrown at crates/burn-dispatch/src/ops/distributed.rs:142

                    $crate::DispatchTensorKind::$Backend($inner) => {
                        let $crate::DispatchAutodiffContext::Enabled(checkpointing) = autodiff else {
                            panic!("an autodiff float primitive must have an enabled autodiff context")
                        };
                        with_autodiff_backend!($Backend, checkpointing, |B| {
                            let $inner = $inner.autodiff();
                            $crate::DispatchTensor {
                                kind: $crate::DispatchTensorKind::Autodiff(alloc::boxed::Box::new(
                                    $crate::DispatchTensorKind::$Backend(
                                        $crate::BackendTensor::Autodiff($body),
                                    ),
                                )),
                                autodiff,
                            }
                        })
                    }
                )*
                #[allow(unreachable_patterns)]
                other => panic!("Distributed operations are not supported for tensor kind {other:?}"),
            },
            $(
                #[cfg($cfg)]
                $crate::DispatchTensorKind::$Backend($inner) => {
                    assert_eq!(
                        autodiff,
                        $crate::DispatchAutodiffContext::Disabled,
                        "an enabled float tensor must use an autodiff primitive",
                    );
                    type B = $crate::backends::$Backend;
                    let $inner = $inner.float();
                    $crate::DispatchTensor {
                        kind: $crate::DispatchTensorKind::$Backend(
                            $crate::BackendTensor::Float($body),
                        ),
                        autodiff,
                    }
                }

View on GitHub (pinned to d16f7ba2ed)

Solutions

  1. Enable the backend feature matching the tensor kind
  2. Convert the tensor to a supported float backend tensor before the distributed op
  3. Do not pass quantized tensors to distributed ops; dequantize first if supported

Example fix

// before
all_reduce(qtensor);
// after
all_reduce(qtensor.dequantize().to_dtype(FloatDType::F32));
Defensive patterns

Strategy: validation

Validate before calling

fn is_supported_float_kind(k: &DispatchTensorKind) -> bool {
    matches!(k, DispatchTensorKind::Cpu(_) | DispatchTensorKind::Wgpu(_) | DispatchTensorKind::Autodiff(_))
}

Prevention

When it happens

Trigger: Dispatching a distributed op with a tensor whose kind variant corresponds to a backend not compiled in or not supported for distributed ops (e.g. a quantized/Qtensor kind or a disabled backend).

Common situations: Passing quantized or feature-gated tensors to distributed collectives; feature flags changed between build and tensor creation.

Related errors


AI-assisted analysis of tracel-ai/burn@d16f7ba2ed (2026-09-05). Data as JSON: /api/errors/661ac1cd8f6e3334. Report an issue: GitHub.