Expand description
This library provides the core types that define how Ruda tensor data is represented, stored, and interpreted.
Re-exports§
Modules§
- api
api - Public tensor API built on the shared backend contracts and primitives.
- backend
Backendtrait and required types.- cast
- Tensor element casting.
- collective
- Explicit rank communicators for floating tensor collectives.
- device
- distribution
- Random value distributions used to initialize and populate tensor data.
- element
- Traits and helpers for working with element types and conversions.
- expert_
projection - Original native trainable floating expert projections and source SwiGLU derivatives. Original native floating expert projections and storage-rounded SwiGLU input VJPs.
- frozen_
awq - Native frozen AWQ projections and their packed-weight input derivatives. Optional backend extension for frozen, directly packed AWQ projections.
- frozen_
nf4 - Original RUDA byte-packed NF4 frozen projections and input derivatives. Backend extension for the original RUDA high-nibble-first NF4 format.
- grouped_
nf4 - Original byte-packed NF4 selected expert projections and SwiGLU derivatives. Frozen original RUDA NF4 expert cubes, with discrete native U32 row assignments.
- indexing
- Indexing utilities.
- moe
- Native selected router weights and complete local MoE training operations. Native local MoE training contracts over existing device routing and expert kernels.
- moe_
exchange - Original native expert-parallel dispatch/receive/combine contracts. Native routing/dispatch, received expert rows and ordered combine for expert-parallel graphs.
- ops
- packed_
experts - Original independently selected AWQ/NF4 expert payloads and native derivatives. Actual original AWQ/NF4 selected expert payloads and their native first-order chains.
- primitive
- quantization
- Quantization data representation.
- shape
- Shape definition.
- slice
- Slice utilities.
- tensor
- Backend tensor primitives and operations.
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
ruda-tensorAPI docs. - make_
element - Macro to implement the element trait for a type.
Structs§
- Bytes
- A buffer similar to
Box<[u8]>that supports custom memory alignment and allows trailing uninitialized bytes. - Device
Handle - TODO: Docs
- Distribution
Sampler - Distribution sampler for random value of a tensor.
- Stream
Id - Unique identifier that can represent a stream based on the current thread id.
- 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.
- Bool
Store - Data type used to store boolean values.
- DType
- Data
Error - The things that can go wrong when manipulating tensor data.
- Distribution
- Distribution for random value of a tensor.
- Distribution
Sampler Kind - Distribution sampler kind for random value of a tensor.
- FloatD
Type - IntD
Type - Scalar
- A scalar element.
Traits§
- Element
- Core element trait for tensor values.
- Element
Comparison - Element ordering trait.
- Element
Conversion - Element conversion trait for tensor.
- Element
Eq - Element trait for equality of a tensor.
- Element
Limits - Element limits trait.
- Element
Ordered - Ordered element trait for tensor values.
- Element
Random - Element trait for random value of a tensor.
Functions§
- read_
sync - Read a future synchronously.
- try_
read_ sync - Read a future synchronously.
Type Aliases§
- BoolD
Type - Boolean dtype.