{"record":{"id":"8eedcd8a59f8a576","repo":"tracel-ai/burn","slug":"libtorch-is-not-supported-as-a-remote-server-backe","errorCode":null,"errorMessage":"LibTorch is not supported as a remote-server backend (no BackendIr impl)","messagePattern":"LibTorch is not supported as a remote-server backend \\(no BackendIr impl\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-dispatch/src/remote_server.rs","lineNumber":97,"sourceCode":"                type $b = Cube;\n                let $devices = host_devices!(cube: device);\n                $body\n            }\n            #[cfg(any(feature = \"flex\", default_backend))]\n            DispatchDevice::Flex(_) => {\n                type $b = Flex;\n                let $devices = host_devices!(DispatchDeviceId::Flex, Flex);\n                $body\n            }\n            #[cfg(feature = \"ndarray\")]\n            DispatchDevice::NdArray(_) => {\n                type $b = NdArray;\n                let $devices = host_devices!(DispatchDeviceId::NdArray, NdArray);\n                $body\n            }\n            #[cfg(feature = \"tch\")]\n            DispatchDevice::LibTorch(_) => {\n                panic!(\"LibTorch is not supported as a remote-server backend (no BackendIr impl)\")\n            }\n            #[cfg(feature = \"remote\")]\n            DispatchDevice::Remote(_) => {\n                panic!(\"Cannot host a remote server on a remote device\")\n            }\n            #[cfg(feature = \"capture\")]\n            DispatchDevice::Capture(_) => {\n                panic!(\"Cannot host a remote server on a capture device\")\n            }\n            #[cfg(feature = \"autodiff\")]\n            DispatchDevice::Autodiff(_) => {\n                unreachable!(\"Autodiff stripped by .inner() above\")\n            }\n        }\n    };\n}\n\n/// Start a remote-execution server for `device`'s backend, blocking the current thread.","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-dispatch/src/remote_server.rs#L79-L115","documentation":"This panic occurs when starting a remote server (burn-dispatch's remote_server) and the configured hosting device is a LibTorch device. The remote server needs a backend implementing BackendIr to interpret intermediate representations, and LibTorch (the tch feature) has no BackendIr implementation, so it cannot serve as a remote-server host backend.","triggerScenarios":"Launching a remote server with DispatchDevice::LibTorch as the host device (cfg feature \"tch\" enabled and device set to LibTorch).","commonSituations":"Configuring a server binary with `tch` feature enabled and pointing DispatchDevice at a LibTorch/CUDA device; copying a client device config into the server config.","solutions":["Configure the remote server to host on a backend with BackendIr support (e.g., NdArray or a CPU backend).","Change the DispatchDevice in the server config from DispatchDevice::LibTorch to DispatchDevice::NdArray (or another IR-capable backend).","Disable the `tch` feature in the server binary if LibTorch hosting was unintentional, so the mismatch fails at config/validation time.","Keep GPU execution on the client side by routing through a server hosted on a supported backend."],"exampleFix":"// before (server config)\nlet device = DispatchDevice::LibTorch(tch_device);\n// after\nlet device = DispatchDevice::NdArray(ndarray_device);","handlingStrategy":"validation","validationCode":"// validate server host device before starting the remote server\nmatch device {\n    DispatchDevice::LibTorch(_) => return Err(\"LibTorch cannot host a remote server; use NdArray\".into()),\n    _ => {}\n}","typeGuard":"fn can_host_remote_server(d: &DispatchDevice) -> bool {\n    !matches!(d, DispatchDevice::LibTorch(_) | DispatchDevice::Remote(_) | DispatchDevice::Capture(_))\n}","tryCatchPattern":null,"preventionTips":["Host remote servers only on BackendIr-capable backends (e.g., NdArray).","Keep server and client device configs separate; never copy client device settings into the server.","Gate the `tch` feature out of server binaries unless it is a supported host backend."],"tags":["rust","remote-server","libtorch","dispatch","config"],"backgroundTag":"unsupported-backend-for-remote-server","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"}