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 thetracingcrate.
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§
- Fuser
Properties - The properties of a fuser.
- Fusion
- Enable dynamic operation fusion on a backend that implements fusion backend.
- Fusion
Tensor - Tensor primitive for the fusion backend for all kind.
- NoOp
- A no-operation placeholder for the fusion backend.
- Unfused
Op - An operation that isn’t fused.
Enums§
- Execution
Error - An error that can happen when syncing a device.
- Fuser
Status - The status of a fuser.
- Operation
Ran - Whether the operation that consumed a tensor ran.
Traits§
- Fusion
Backend - Trait that allows an existing backend to specify graph optimizations using operation fuser.
- Fusion
Runtime - Trait that defines a runtime that will benefits from fused operations.
- NumOperations
- The number of operations contained in the data structure.
- Operation
Fuser - 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.
- Fusion
Device - Type alias for
<R as FusionRuntime>::FusionDevice. - Fusion
Handle - Type alias for
<R as FusionRuntime>::FusionHandle.