Skip to main content

Module rt

Module rt 

Source
Expand description

Helpers that generated code calls (not meant to be used directly).

Structs§

ConvDims
The dimension numbers of a convolution, as JAX’s ConvDimensionNumbers: each spec lists dimensions of an operand or of the result.
ConvWindow
The window of a convolution: one entry per spatial dimension.
Function
A function of the IR (a closed jaxpr).
Heap
An array of N elements on the heap whose buffer goes back to a pool of the thread when dropped, for the next array of the same layout: the large arrays of a step are allocated again at every step, and fresh allocations of that size are mapped pages that fault and are zeroed by the system at every first touch.
HostArray
An array in host memory: a typed buffer and a shape.
bf16
A 16-bit floating point type implementing the bfloat16 format.
f16
A 16-bit floating point type implementing the IEEE 754-2008 standard binary16 a.k.a “half” format.

Enums§

BinaryOp
An elementwise operation with two operands of the same type and a result of that type.
CompareOp
A comparison.
CumulativeOp
The operation of a cumulative reduction (cumsum and the like).
UnaryOp
An elementwise operation with one operand and a result of the same type.

Traits§

Element
A Rust type that is an element type of ruxla. It is implemented for bool, the integer types, f16, bf16, f32, f64, c64, and c128.
Ops
Elementwise operations on one element type. Calling an operation that the type does not support (see UnaryOp::supports) panics; callers check the types first.

Functions§

boxed_copy
A copy of x on the heap.
build
[f(0), f(1), ..., f(N - 1)].
build_boxed
build on the heap.
cast
Converts between element types with the semantics of XLA’s convert on CPU:
cholesky
The Cholesky factors (lower) of batch matrices n x n (ruxla_kernels::linalg::cholesky: NaN where a matrix is not positive definite).
compare
Compares two values (floats follow IEEE 754: comparisons with NaN are false, except Ne).
conv
conv_general_dilated of operands of the result’s type (ruxla_kernels::window::conv_general_dilated).
cumulative
A cumulative reduction of x (of shape shape) along axis, in the order XLA combines the elements on CPU (ruxla_kernels::array::cumulative).
eval
Evaluates a serialized function (deserialized once into cell) with the interpreter: the equations that generated code does not specialize.
filled
An array of N copies of x on the heap (without a copy on the stack).
from_host
The elements of a host array of N elements of type T.
from_host_scalar
The element of a host array of one element of type T.
host
A host array of data with shape dims.
integer_pow
x^y for an integer exponent, by repeated squaring in the same order as JAX’s lowering of integer_pow (which fixes the rounding of floats). Negative exponents take the reciprocal at the end.
overwritten
An array (on the stack) that the caller overwrites before reading; the generated code writes it so for reused on the heap.
reused
An array of N elements on the heap that the caller overwrites before reading (Heap::reused).
sort_order
The order of lax.sort keys: integers and booleans in their natural order, and floats in the total order -inf < ... < 0 < ... < inf < NaN in which -0.0 equals 0.0 and all NaNs are equal, as JAX’s comparator makes it by canonicalizing zeros and NaNs before a total-order comparison.
threefry2x32
The threefry2x32 hash (20 rounds) of the counters (x1, x2) with the key (k1, k2), as in jax.random.
top_k
top_k along axis (ruxla_kernels::array::top_k): the values and their indices.
triangular_solve
triangular_solve of batch systems with right-hand sides m x n (ruxla_kernels::linalg::triangular_solve; the flags as its options: left side, lower, transpose, conjugate, unit diagonal).