{"record":{"id":"bb44d33f64c31465","repo":"tracel-ai/burn","slug":"distributed-operations-are-not-supported-for-tenso","errorCode":null,"errorMessage":"Distributed operations are not supported for tensor kind {other:?}","messagePattern":"Distributed operations are not supported for tensor kind (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-dispatch/src/backend.rs","lineNumber":656,"sourceCode":"                            param_id,\n                        )),\n                    )))\n                }\n                #[cfg(feature = \"remote\")]\n                DispatchTensorKind::Remote(tensor) => {\n                    DispatchTensorKind::Autodiff(Box::new(DispatchTensorKind::Remote(\n                        crate::BackendTensor::Autodiff(Autodiff::<Remote>::set_distributed_params(\n                            tensor.as_autodiff().clone(),\n                            param_id,\n                        )),\n                    )))\n                }\n                DispatchTensorKind::Autodiff(_) => {\n                    panic!(\"Autodiff should not wrap an autodiff tensor.\")\n                }\n                #[allow(unreachable_patterns)]\n                other => {\n                    panic!(\"Distributed operations are not supported for tensor kind {other:?}\")\n                }\n            },\n            _ => panic!(\"Requires autodiff tensor.\"),\n        };\n\n        DispatchTensor { kind, autodiff }\n    }\n\n    #[allow(unused_variables)]\n    fn distributed_params(tensor: &DispatchTensor) -> Option<DistributedParams> {\n        let DispatchTensor { kind, autodiff: _ } = tensor;\n\n        match &kind {\n            DispatchTensorKind::Autodiff(inner_kind) => match &**inner_kind {\n                #[cfg(cube_backend)]\n                DispatchTensorKind::Cube(tensor) => {\n                    tensor.as_autodiff().node.distributed_params.clone()\n                }","sourceCodeStart":638,"sourceCodeEnd":674,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-dispatch/src/backend.rs#L638-L674","documentation":"set_distributed_params only supports distributed-capable backends (Cube via cube_backend, Remote via the remote feature). Any other inner tensor kind (Flex, NdArray, LibTorch, Capture, Int/Bool variants, etc.) reaches the catch-all arm and panics with the unsupported kind name, because only collective-capable backends can carry distributed parameter metadata.","triggerScenarios":"Calling set_distributed_params on a tensor whose inner kind is not Cube or Remote — e.g. NdArray/Flex/LibTorch tensors, or a build where cube_backend/remote cfgs exclude the arms. The panic message embeds the offending kind via Debug formatting.","commonSituations":"Distributed training code registering DistributedParamId on a model running on a non-distributed backend (e.g. local NdArray or LibTorch); forgetting to enable the `remote` feature (or cube backend) so the tensor stays on a non-collective backend; running distributed workflows on a single-node backend.","solutions":["Run the distributed workload on Cube or Remote backend (enable the `remote` feature or a cube_backend) so the tensor kind matches the distributed arms.","Only call set_distributed_params (distributed parameter registration) on tensors from a collective-capable backend; skip it on other backends.","Check tensor.kind before the call and branch to a non-distributed path when the kind is not Autodiff(Cube|Remote)."],"exampleFix":"// before: registering distributed params regardless of backend\nlet t = set_distributed_params(tensor, param_id); // panics on NdArray/Flex\n\n// after: guard on backend kind\nif matches!(\n    &tensor.kind,\n    DispatchTensorKind::Autodiff(inner)\n        if matches!(**inner, DispatchTensorKind::Cube(_) | DispatchTensorKind::Remote(_))\n) {\n    let t = set_distributed_params(tensor, param_id);\n} else {\n    // non-distributed path\n}","handlingStrategy":"validation","validationCode":"fn supports_distributed(t: &DispatchTensor) -> bool {\n    matches!(\n        &t.kind,\n        DispatchTensorKind::Autodiff(inner)\n            if matches!(**inner, DispatchTensorKind::Cube(_) | DispatchTensorKind::Remote(_))\n    )\n}\nif supports_distributed(&tensor) {\n    let t = set_distributed_params(tensor, param_id);\n} else {\n    // fall back to non-distributed handling\n}","typeGuard":"fn is_distributed_capable(t: &DispatchTensor) -> bool {\n    matches!(\n        &t.kind,\n        DispatchTensorKind::Autodiff(inner)\n            if matches!(**inner, DispatchTensorKind::Cube(_) | DispatchTensorKind::Remote(_))\n    )\n}","tryCatchPattern":"// panic-based; check is_distributed_capable before registering DistributedParamId","preventionTips":["Only use distributed parameter APIs with Cube or Remote backends.","Enable the `remote` feature (or a cube backend) for distributed training runs.","Don't run distributed registration on NdArray/Flex/LibTorch backends (e.g. local testing configs).","Check backend kind before entering distributed code paths."],"tags":["rust","distributed","panic","backend-unsupported"],"backgroundTag":"backend-not-supported","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"}