tracel-ai/burn · error

LibTorch is not supported as a remote-server backend (no Bac

Error message

LibTorch is not supported as a remote-server backend (no BackendIr impl)

What it means

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.

Source

Thrown at crates/burn-dispatch/src/remote_server.rs:97

                type $b = Cube;
                let $devices = host_devices!(cube: device);
                $body
            }
            #[cfg(any(feature = "flex", default_backend))]
            DispatchDevice::Flex(_) => {
                type $b = Flex;
                let $devices = host_devices!(DispatchDeviceId::Flex, Flex);
                $body
            }
            #[cfg(feature = "ndarray")]
            DispatchDevice::NdArray(_) => {
                type $b = NdArray;
                let $devices = host_devices!(DispatchDeviceId::NdArray, NdArray);
                $body
            }
            #[cfg(feature = "tch")]
            DispatchDevice::LibTorch(_) => {
                panic!("LibTorch is not supported as a remote-server backend (no BackendIr impl)")
            }
            #[cfg(feature = "remote")]
            DispatchDevice::Remote(_) => {
                panic!("Cannot host a remote server on a remote device")
            }
            #[cfg(feature = "capture")]
            DispatchDevice::Capture(_) => {
                panic!("Cannot host a remote server on a capture device")
            }
            #[cfg(feature = "autodiff")]
            DispatchDevice::Autodiff(_) => {
                unreachable!("Autodiff stripped by .inner() above")
            }
        }
    };
}

/// Start a remote-execution server for `device`'s backend, blocking the current thread.

View on GitHub (pinned to d16f7ba2ed)

Solutions

  1. Configure the remote server to host on a backend with BackendIr support (e.g., NdArray or a CPU backend).
  2. Change the DispatchDevice in the server config from DispatchDevice::LibTorch to DispatchDevice::NdArray (or another IR-capable backend).
  3. Disable the `tch` feature in the server binary if LibTorch hosting was unintentional, so the mismatch fails at config/validation time.
  4. Keep GPU execution on the client side by routing through a server hosted on a supported backend.

Example fix

// before (server config)
let device = DispatchDevice::LibTorch(tch_device);
// after
let device = DispatchDevice::NdArray(ndarray_device);
Defensive patterns

Strategy: validation

Validate before calling

// validate server host device before starting the remote server
match device {
    DispatchDevice::LibTorch(_) => return Err("LibTorch cannot host a remote server; use NdArray".into()),
    _ => {}
}

Type guard

fn can_host_remote_server(d: &DispatchDevice) -> bool {
    !matches!(d, DispatchDevice::LibTorch(_) | DispatchDevice::Remote(_) | DispatchDevice::Capture(_))
}

Prevention

When it happens

Trigger: Launching a remote server with DispatchDevice::LibTorch as the host device (cfg feature "tch" enabled and device set to LibTorch).

Common situations: 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.

Related errors


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