Skip to main content

Crate burn_dispatch

Crate burn_dispatch 

Source
Expand description

Burn multi-backend dispatch.

§Available Backends

The dispatch backend supports the following variants, each enabled via cargo features:

BackendFeatureDescription
CpucpuRust CPU backend (MLIR + LLVM)
CudacudaNVIDIA CUDA backend
MetalmetalApple Metal backend via wgpu (MSL)
RocmrocmAMD ROCm backend
VulkanvulkanVulkan backend via wgpu (SPIR-V)
WgpuwebgpuWebGPU backend via wgpu (WGSL)
FlexflexPure Rust CPU backend using burn-flex
NdArrayndarrayPure Rust CPU backend using ndarray (legacy - prefer flex)
LibTorchtchLibtorch backend via tch
AutodiffautodiffAutodiff-enabled backend (used in combination with any of the backends above)

Note: WGPU-based backends (metal, vulkan, webgpu) are mutually exclusive. All other backends can be combined freely.

§WGPU Backend Exclusivity

The WGPU-based backends (metal, vulkan, webgpu) are mutually exclusive due to the current automatic compile, which can only select one target at a time.

Enable only one of these features in your Cargo.toml:

  • metal
  • vulkan
  • webgpu

If multiple WGPU features are enabled, the build script will emit a warning and disable all WGPU backends to prevent unintended behavior.

Structs§

Dispatch
The main execution backend in Burn.
DispatchTensor
A tensor that can dispatch operations to any enabled backend at runtime.

Enums§

BackendTensor
Tensor which points to a backend tensor primitive kind.
DispatchDevice
Represents a device for the Dispatch.
DispatchTensorKind
Internal representation of a DispatchTensor.