Module backend
Expand description
Backend module.
Modules§
- autodiff
- Burn Autodiff
- backend
Backendtrait and required types.- distribution
- Random value distributions. Random value distributions used to initialize and populate tensor data.
- element
- Traits for tensor element types and conversions. Traits and helpers for working with element types and conversions.
- flex
- burn-flex
- fusion
- Burn Fusion
- indexing
- Indexing utilities.
- ir
- Burn’s intermediate representation of tensors and tensor operations.
- quantization
- Quantization data representation.
- shape
- Shape definition.
- slice
- Slice utilities.
- tensor
- Backend type aliases.
Macros§
- dequant_
op_ flow - Automatically applies
dequantization -> float operation [-> quantization]. - dequant_
op_ quant - Automatically applies
dequantization -> float operation -> quantization. - doc_
tensor - Convenience macro to link to the
burn-tensordocs for this crate version. - s
- Slice argument constructor for tensor indexing.
- shape
Structs§
- Autodiff
- Enable auto-differentiation on a backend.
- Autodiff
Device - A wrapper that enables automatic differentiation for a
DispatchDevice. - Back
Trace - Contains the backtrace information if available.
- Bytes
- A buffer similar to
Box<[u8]>that supports custom memory alignment and allows trailing uninitialized bytes. - Device
Handle - A handle to one service, reached as
S. - Device
Id - The device id.
- Device
Settings - Settings controlling the default data types for a specific device.
- Dispatch
- The main execution backend in Burn.
- Dispatch
Tensor - A tensor that can dispatch operations to any enabled backend at runtime.
- Distribution
Sampler - Distribution sampler for random value of a tensor.
- Flex
- The Flex backend, a fast, portable CPU backend for Burn.
- Flex
Device - CPU device for the Flex backend.
- HashMap
- A hash map implemented with quadratic probing and SIMD lookup.
- Index
Wrap - Wraps an index with negative indexing support.
- Memory
Pool Usage - One reading of a device allocator’s state, across the runtime’s streams and pools.
- Profile
Duration - Result from profiling between two measurements. This can either be a duration or a future that resolves to a duration.
- Profile
Options - How a profiled window treats the work a backend still holds in a queue when the window closes.
- Profile
Ticks - Start and end point for a profile. Can be turned into a duration.
- Profile
Token - An open profiling window on a backend, handed out by
profile_startand passed back toprofile_endto close it. - Service
Id - One service instance: the device it runs on and the type of service running
there. This pair is what the device registry keys on, so two instances never
share one, whatever
DeviceIdtwo runtimes happen to hand out. - Shape
- Shape of a tensor.
- Slice
- A slice specification for a single tensor dimension.
- Slice
Iter - Defines an
Iteratorover aSlice. - Sliced
Pool Report - One dynamic pool’s measured state, in the order allocations are routed through the pools.
- Small
Vec - A
Vec-like container that can store a small number of elements inline. - Stream
Id - Unique identifier representing the stream on which work is submitted.
- Tensor
Data - Data structure for tensors.
- Tolerance
- The tolerance used to compare to floating point numbers.
- bf16
- A 16-bit floating point type implementing the
bfloat16format. - f16
- A 16-bit floating point type implementing the IEEE 754-2008 standard
binary16a.k.a “half” format.
Enums§
- Allocation
Property - The kind of allocation behind the Bytes type.
- Backend
Tensor - Tensor which points to a backend tensor primitive kind.
- Bool
Store - Data type used to store boolean values.
- DType
- DType
Usage - Describes how a data type can be used on a given device.
- Data
Error - Errors that can occur while accessing or converting
TensorData. - Device
Error - Errors returned by device-related operations.
- Device
Service Stage - Pipeline stage a
DeviceServiceruns on. Each stage gets its own runner thread per device, allowing upstream work to overlap with downstream kernel dispatch. - Dispatch
Autodiff Context - The autodiff backend associated with a dispatch tensor.
- Dispatch
Device - Represents a device for the
Dispatch. - Dispatch
Device Id - Dispatch
Graph - A captured graph from one of the dispatched backends (see
BackendTypes::GraphPrimitive). - Dispatch
Tensor Kind - Internal representation of a
DispatchTensor. - Distribution
- Distribution for random value of a tensor.
- Distribution
Sampler Kind - Distribution sampler kind for random value of a tensor.
- Execution
Error - An error that can happen when syncing a device.
- Expression
Error - Common Expression Error.
- FloatD
Type - Gradient
Checkpointing Strategy - Gradient checkpointing strategy for autodiff.
- Graph
Unsupported - Placeholder graph primitive for backends without graph-capture support.
- IntD
Type - Metadata
Error - Error that can occur when attempting to modify shapes.
- Router
Device Type - The type id a device behind burn-router puts in its
DeviceId. - Scalar
- A scalar element.
- Split
Policy - Controls how
Bytes::splitbehaves when the allocation can’t be split in place. - Tensor
Primitive - A primitive tensor representation.
- Timing
Method - How a benchmark’s execution times are measured.
Traits§
- AsIndex
- Helper trait for implementing indexing with support for negative indices.
- AsSize
- Types which can be converted to a
usizeSize. - Autodiff
Backend - Trait that allows a backend to support autodiff.
- Backend
- This trait defines all types and functions needed for a backend to be used with burn.
- Backend
Types - The mapping of types used by Backend and traits.
- Device
- Device trait for all cubecl devices.
- Device
Ops - Device trait for all burn backend devices.
- Device
Service - Represent a service that runs on a device.
- Dispatch
Kind Conversion - Trait to execute runtime routing conversions between the dynamic dispatch layer and specific backends.
- Element
- Core element trait for tensor values.
- Element
Add - Element addition trait.
- Element
Conversion - Element conversion trait for tensor.
- Element
Eq - Element trait for equality of a tensor.
- Element
Ordered - Ordered element trait for tensor values.
- Element
Random - Element trait for random value of a tensor.
- Extension
Type - A trait to map custom structs and enums of tensor primitives across the
Dispatchboundary, in both directions. - Slice
Arg - Trait for slice arguments that can be converted into an array of slices.
This allows the
slicemethod to accept both single slices (froms![..]) and arrays of slices (froms![.., ..]or[0..5, 1..3]). - Slice
Ops - Slice-related ops on
Shape - Tensor
Metadata - Tensor metadata trait for tensor primitive.
Functions§
- calculate_
matmul_ output - Compute the output shape for matrix multiplication with broadcasting support.
- get_
device_ settings - Returns the configured settings, or backend defaults without initializing them.
- get_
or_ init_ device_ settings - Get the
device’s settings, initializing them to defaults if unset. - profile_
system_ time - Measure
funcin wall-clock time between two syncs ofdevice. - profile_
with_ tokens - A closure-bracketed window over a backend’s split
profile_start/profile_end, falling back toprofile_system_timewhen the backend opens none. - ravel_
index - Compute the ravel index for the given coordinates.
- read_
sync - Read a future synchronously.
- set_
default_ dtypes - Sets the default data types for the device.
- try_
read_ sync - Read a future synchronously.
- wrap_
index - Wraps a dimension index to be within the bounds of the dimension size.
Type Aliases§
- Backend
Graph - Captured graph primitive type used by the backend (see
BackendTypes::GraphPrimitive). - BoolD
Type - Boolean dtype.
- DType
Usage Set - A set of DTypeUsage representing the total capabilities of a data type on a device.
- Server
Utilities Handle - An pointer to a service’s server utilities.
Attribute Macros§
- backend_
extension - Generates the
Dispatchimplementation for a backend extension trait.
Derive Macros§
- Extension
Type - Maps structs and enums of backend tensor primitives across the
Dispatchboundary.