{"record":{"id":"98c8aca5c72dea3a","repo":"tracel-ai/burn","slug":"unimplemented","errorCode":null,"errorMessage":"unimplemented!()","messagePattern":"unimplemented!\\(\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/burn-backend/src/backend/distributed/ops.rs","lineNumber":121,"sourceCode":"        let _ = (tensor, distributed_params);\n    }\n\n    /// all_reduce operation.\n    ///\n    /// # Arguments\n    ///\n    /// * `tensors` - The tensors on which to perform all_reduce.\n    /// * `op` - The [`ReduceOperation`].\n    ///\n    /// # Returns\n    ///\n    /// The corresponding [CollectiveTensor].\n    fn all_reduce(\n        _tensor: FloatTensor<B>,\n        _op: ReduceOperation,\n        _device_ids: Vec<DeviceId>,\n    ) -> CollectiveTensor<B> {\n        unimplemented!()\n    }\n\n    /// Sync the collective operations.\n    ///\n    /// # Arguments\n    ///\n    /// * `device` - The device to sync.\n    fn sync_collective(_device: &B::Device) {\n        unimplemented!()\n    }\n\n    /// Get the device of the tensor reference.\n    ///\n    /// # Arguments\n    ///\n    /// * `tensor` - The tensor reference.\n    ///\n    /// # Returns","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-backend/src/backend/distributed/ops.rs#L103-L139","documentation":"The `all_reduce` operation in the distributed backend trait (`BackendOps` in crates/burn-backend/src/backend/distributed/ops.rs) is a default trait method whose body is `unimplemented!()`. Backends are expected to override it with a real collective implementation; calling the default means the selected backend does not implement distributed all-reduce.","triggerScenarios":"Calling `all_reduce(tensor, op, device_ids)` on a backend that has not overridden the default method (e.g. a single-device backend used in a distributed code path).","commonSituations":"Running a distributed training script while the backend only supports single-device execution; forgetting to enable/select the distributed backend feature; a partially migrated custom backend that left the default stub in place.","solutions":["Use a backend that implements the distributed collective ops (e.g. the distributed/NCCL-style backend) instead of the default stub.","Override `all_reduce` in your custom backend trait implementation with a real reduction.","Guard distributed code paths so `all_reduce` is only invoked when a distributed backend is actually configured."],"exampleFix":"// before\nB::all_reduce(tensor, ReduceOperation::Sum, device_ids); // panics\n\n// after\n// build/run with a backend implementing distributed ops, e.g. the distributed backend feature,\n// or implement in your backend:\nfn all_reduce(tensor: FloatTensor<Self>, op: ReduceOperation, device_ids: Vec<DeviceId>) -> CollectiveTensor<Self> {\n    /* real implementation */\n}","handlingStrategy":"validation","validationCode":"// Rust: ensure the backend supports distributed collectives before calling\nif !B::SUPPORTS_DISTRIBUTED { /* or check via feature/capability flag */\n    panic!(\"backend does not implement all_reduce; use a distributed backend\");\n}","typeGuard":null,"tryCatchPattern":"// Rust panics are not catchable with catch_unwind across the whole program safely, but:\nlet result = std::panic::catch_unwind(|| B::all_reduce(t, op, devices));\nif result.is_err() { /* fall back to single-device path */ }","preventionTips":["Only enable distributed training code paths when a distributed backend feature is compiled in.","Assert backend collective capability at startup, not at first collective call.","Add compile-time feature gates around all_reduce/sync_collective calls."],"tags":["rust","distributed","unimplemented-stub"],"backgroundTag":"backend-method-unimplemented","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"}