Skip to main content

Crate fusion

Crate fusion 

Expand description

§Burn Fusion

Kernel fusion as a backend decorator.

Fusion wraps a backend that implements FusionBackend and defers its operations instead of running each one immediately. Queued operations are grouped by OperationFusers into Optimizations, so several element-wise operations can run as a single kernel and intermediate tensors never reach device memory.

Applications do not use this crate directly. The CubeCL backends (CUDA, ROCm, Metal, Vulkan, WebGPU, wgpu and the CubeCL CPU runtime) enable it by default. Backend authors implement FusionBackend and FusionRuntime to opt in; custom lets backend extensions register their own fused operations.

§Feature flags

  • std (default): standard library support.
  • memory-checks: check the fusion runtime for leaked tensors (for tests).
  • tracing: instrument operations with the tracing crate.

Modules§

client
Client module exposing types to communicate with the fusion server.
custom
Types used to define and register custom Fusion operations.
observer
Watching the fusion server register operations and run blocks of them.
stream
Stream module exposing all tensor operations that can be optimized.

Macros§

binary_float_cmp_ops
binary_float_ops
binary_int_cmp_ops
binary_int_ops
memory_checks
Export memory checks tests.
reduce_ops
scalar_float2int_ops
scalar_float_cmp_ops
scalar_float_ops
scalar_int_cmp_ops
scalar_int_ops
unary_float_ops
unary_int_ops

Structs§

FuserProperties
The properties of a fuser.
Fusion
Enable dynamic operation fusion on a backend that implements fusion backend.
FusionTensor
Tensor primitive for the fusion backend for all kind.
NoOp
A no-operation placeholder for the fusion backend.
UnfusedOp
An operation that isn’t fused.

Enums§

ExecutionError
An error that can happen when syncing a device.
FuserStatus
The status of a fuser.
OperationRan
Whether the operation that consumed a tensor ran.

Traits§

FusionBackend
Trait that allows an existing backend to specify graph optimizations using operation fuser.
FusionRuntime
Trait that defines a runtime that will benefits from fused operations.
NumOperations
The number of operations contained in the data structure.
OperationFuser
The fusion operation abstraction allows implementations to fuse many tensor operations into one, improving the performance of the backend.
Optimization
The optimization created from a fuser.

Functions§

get_client
Get the client for the given device.

Type Aliases§

Client
Client alias.
FusionDevice
Type alias for <R as FusionRuntime>::FusionDevice.
FusionHandle
Type alias for <R as FusionRuntime>::FusionHandle.