Skip to main content

Crate burn_cubecl

Crate burn_cubecl 

Source
Expand description

The Burn backend for every CubeCL runtime.

CubeBackend implements Burn’s tensor operations as CubeCL kernels, compiled just in time for the device they run on. CUDA, ROCm, Metal, Vulkan, WebGPU, wgpu and the CubeCL CPU runtime all share this one backend type: a tensor’s CubeDevice says which runtime it uses. Cube is the type dispatch uses, wrapped in burn_fusion::Fusion when the fusion feature is on.

Applications reach this backend through a burn feature such as cuda, wgpu or cpu and a Device constructor; the runtime crates (burn-cuda, burn-wgpu, burn-rocm, burn-cpu) are thin wrappers that select a runtime. Use this crate directly to write custom kernels: kernel and ops hold the building blocks, and cubecl is re-exported so kernels use the same CubeCL version.

§Feature flags

  • cuda, hip, wgpu, metal, vulkan, webgpu, cpu: compile in a CubeCL runtime.
  • fusion: kernel fusion through burn-fusion.
  • autotune: benchmark kernel variants at runtime and keep the fastest.
  • fft: FFT kernels.
  • template: launch hand-written, non-JIT kernels.
  • tracing: instrument operations with the tracing crate.

Re-exports§

pub use element::BoolElement;
pub use element::CubeElement;
pub use element::FloatElement;
pub use element::IntElement;
pub use cubecl;

Modules§

element
Elements for JIT backend
fusionfusion
Module for interacting with fusion
kernel
Kernel module
ops
Utilities for implementing JIT kernels
tensor
Tensor module.

Structs§

CubeBackend
Tensor backend that compiles just-in-time for whichever runtime its device names.
CubeGraph
A captured launch sequence, tagged with the device it was captured on.
CubeTuneId
ID used to identify a Just-in-Time environment.

Enums§

CubeAutotuneKey
Key for all autotune-enabled operations
CubeDevice
The device a cube tensor lives on.

Type Aliases§

Cubefusion
The tensor backend for every cubecl runtime, fusing operations across streams. See CubeBackend for the unfused type.