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)
WebGpuwebgpuWebGPU backend via wgpu (WGSL)
NdArrayndarrayPure Rust CPU backend using ndarray
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§

AutodiffDevice
A wrapper that enables automatic differentiation for a DispatchDevice.
Dispatch
The main execution backend in Burn.

Enums§

BackendTensor
Tensor which points to a backend tensor primitive kind.
DispatchDevice
Represents a device for the Dispatch.
DispatchTensor
Dispatch tensor that can hold tensors from any enabled backend.