Crate ir
Expand description
Burn’s intermediate representation of tensors and tensor operations.
Every backend operation has a serializable description here: OperationIr and its
per-kind enums (FloatOperationIr, IntOperationIr, BaseOperationIr, …) name
the operation and the TensorIrs it reads and writes. GraphIr groups operations
with explicit inputs and outputs, and CustomOpIr carries operations defined by backend
extensions.
Describing work as data rather than calls lets it be inspected, optimized and moved before
it runs. Kernel fusion (burn-fusion), remote execution (burn-remote, through
burn-router) and graph capture (burn-capture) are built on it. A backend that
implements BackendIr can execute operations received in this form.
Applications do not use this crate directly.
§Feature flags
std(default): standard library support. Without it the crate isno_stdwithalloc.tracing: instrument operations with thetracingcrate.
Structs§
- Adaptive
AvgPool1d Backward OpIr - Adaptive
AvgPool1d OpIr - Adaptive
AvgPool2d Backward OpIr - Adaptive
AvgPool2d OpIr - Adaptive
AvgPool3d Backward OpIr - Adaptive
AvgPool3d OpIr - AllReduce
OpIr - Attention
OpIr - Attention
Options Ir - AvgPool1d
Backward OpIr - AvgPool1d
OpIr - AvgPool2d
Backward OpIr - AvgPool2d
OpIr - Batch
Norm OpIr - Batch normalization using explicitly supplied channel statistics.
- Binary
OpIr - Cast
OpIr - CatOpIr
- Clamp
OpIr - Conv1d
Bias Backward OpIr - Conv1d
OpIr - Conv1d
Options Ir - Conv1d
Weight Backward OpIr - Conv1dX
Backward OpIr - Conv2d
Bias Backward OpIr - Conv2d
OpIr - Conv2d
Options Ir - Conv2d
Weight Backward OpIr - Conv2dX
Backward OpIr - Conv3d
Bias Backward OpIr - Conv3d
OpIr - Conv3d
Options Ir - Conv3d
Weight Backward OpIr - Conv3dX
Backward OpIr - Conv
Transpose1d Bias Backward OpIr - Operation IR for the bias-gradient of
conv_transpose1d. - Conv
Transpose1d OpIr - Conv
Transpose1d Options Ir - Conv
Transpose1d Weight Backward OpIr - Operation IR for the weight-gradient of
conv_transpose1d. - Conv
Transpose2d Bias Backward OpIr - Operation IR for the bias-gradient of
conv_transpose2d. - Conv
Transpose2d OpIr - Conv
Transpose2d Options Ir - Conv
Transpose2d Weight Backward OpIr - Operation IR for the weight-gradient of
conv_transpose2d. - Conv
Transpose3d Bias Backward OpIr - Operation IR for the bias-gradient of
conv_transpose3d. - Conv
Transpose3d OpIr - Conv
Transpose3d Options Ir - Conv
Transpose3d Weight Backward OpIr - Operation IR for the weight-gradient of
conv_transpose3d. - Creation
OpIr - Creation operation intermediate representation. As opposed to InitOperationIr, creation operations are lazy initialized.
- Cross
OpIr - CtcLoss
Backward OpIr - CtcLoss
OpIr - Custom
OpIr - Custom operation in fusion stream, declaring its inputs, outputs and scalar arguments.
- Deform
Conv2d Backward OpIr - Deform
Conv2d OpIr - Deformable
Conv2d Options Ir - Dequantize
OpIr - Device
IdIr - Serializable representation of a device id.
- DimOpIr
- IR for operations that operate along a dimension without reducing it.
Unlike
ReduceDimOpIr, the output shape is the same as the input shape. - Embedding
Backward OpIr - Embedding
OpIr - Flip
OpIr - Flip operation intermediate representation.
- Full
OpIr - Full operation intermediate representation.
- Gather
NdOp Ir - Gather
OpIr - Graph
Bindings - Per-invocation bindings used to specialize a cached graph to concrete tensors.
- Graph
Boundary - Tensor boundary inferred from an operation sequence.
- GraphId
- Identifier for a cached, reusable group of operations (a graph).
- GraphIr
- An ordered operation graph with an explicit tensor boundary.
- Grid
Sample2d OpIr - Grid
Sample Options Ir - Handle
Container - Keep all tensor handles in one place and ensure that all resources are used optimally.
- Hard
Sigmoid OpIr - Operation IR for the hard-sigmoid activation function, which takes two scalars
(
alphaandbeta) in addition to the input tensor. - Init
Operation Ir - Declares a tensor has been initialized.
- Interpolate
Backward OpIr - Interpolate
OpIr - Interpolate
Options Ir - Layer
Norm OpIr - Operation IR for layer normalization with optional bias.
- Linear
Bias Backward OpIr - Linear
OpIr - Linear
Weight Backward OpIr - LinearX
Backward OpIr - Mask
Fill OpIr - Mask
Where OpIr - Matmul
OpIr - MaxPool1d
OpIr - MaxPool1d
With Indices Backward OpIr - MaxPool1d
With Indices OpIr - MaxPool2d
OpIr - MaxPool2d
With Indices Backward OpIr - MaxPool2d
With Indices OpIr - PadOpIr
- Padding operation intermediate representation.
- Permute
OpIr - Permute operation intermediate representation.
- Quantization
Parameters Ir - Quantization parameters intermediate representation.
- Quantize
OpIr - Random
OpIr - Reduce
DimOp Ir - Reduce
DimWith Indices OpIr - Reduce
Dims OpIr - A reduction over several dimensions at once, each kept with length one.
- Reduce
OpIr - Repeat
DimOp Ir - Scalar
OpIr - Scatter
NdOp Ir - Scatter
OpIr - Select
Assign OpIr - Select
OpIr - Shape
OpIr - Shape operation intermediate representation.
- Slice
Assign OpIr - Slice
OpIr - Sort
OpIr - Operation IR for sort along a dim. The output preserves the input shape/dtype.
- Sort
With Indices OpIr - Operation IR for sort-with-indices: returns sorted values + source indices.
- Swap
Dims OpIr - Swap dim operation intermediate representation.
- Tensor
Error - Why a tensor holds no data: the work that was going to write it did not run, so its bytes were never produced.
- Tensor
Handle - A tensor representation containing a reference to a tensor resource with a given shape.
- Tensor
Id - The tensor unique identifier.
- Tensor
Ir - A tensor definition represents a snapshot of a tensor when it was used.
- TopK
With Indices OpIr - Like
ReduceDimWithIndicesOpIr, but for a top-k: the reduced axis keepskentries instead of collapsing to 1, sokhas to be carried explicitly. - Unary
OpIr - Unfold4d
OpIr - Operation IR for unfold4d (a 4d sliding-window kernel-as-explicit-columns reshape).
- Unfold4d
Options Ir - Options for
Unfold4dOpIr— mirrors the backend’sUnfoldOptions. - Unfold
OpIr - Unfold operation intermediate representation.
Enums§
- Activation
Operation Ir - Operation intermediate representation for activation functions.
- Base
Operation Ir - Basic operations that can be done on any tensor type.
- Bool
Operation Ir - Operation intermediate representation specific to a bool tensor.
- Distributed
Operation Ir - Operations that can be done on distributed tensors.
- Float
Operation Ir - Operation intermediate representation specific to a float tensor.
- Grid
Sample Padding Mode Ir - Handle
- Backend tensor handle wrapper tracking their creation state
- Handle
Kind - Handle which points to a backend tensor primitive kind.
- IntOperation
Ir - Operation intermediate representation specific to an int tensor.
- Interpolate
Mode Ir - IrError
- Module
Operation Ir - Operation intermediate representation specific to module.
- Numeric
Operation Ir - Numeric operations on int and float tensors.
- Operation
Ir - Describe all tensor operations possible.
- PadMode
Ir - Serializable padding mode intermediate representation.
- Scalar
Ir - A scalar representation.
- Tensor
Status - The status of the current tensor.
Traits§
- Backend
Ir - Backend extension trait that allows an existing backend to use the Burn tensor intermediate representation for compilation purpose or other…
- IrVisitor
Mut - Visitor for mutating the components of an
OperationIrin place. - Operation
Output - Extension trait to extract outputs when registering an operation.