Skip to main content

Crate prism_tensor

Crate prism_tensor 

Source
Expand description

Prism standard-library tensor-compute sub-crate.

prism-tensor realizes the tensor Layer-3 of the standard library named in Wiki ADR-031: declares TensorAxis and ActivationAxis through the axis! SDK macro and supplies parametric CPU integer-precision reference impls preserving bit-determinism per fixed (HostTypes, HostBounds, AxisTuple) selection (per ADR-030’s per-axis substitution-determinism note).

§Scope

  • TensorAxis — fixed-shape matmul. Parametric reference: CpuI8MatmulSquare<DIM> for DIM × DIM i8 × i8i16 matrices. DIM is unconstrained at the axis level: per ADR-060 there is no AXIS_OUTPUT_BYTES_MAX cap — axis-kernel output flows through the source-polymorphic TermValue carrier (Inline/Borrowed/Stream), whose inline width derives from the application’s HostBounds structural-count primitives via foundation const fns. The axis impl performs only a DIM == 0 structural well-formedness check.
  • ActivationAxis — element-wise nonlinearity. Parametric reference: CpuI8VectorActivation<N> for length-N i8 vectors. N is likewise unconstrained at the axis level per ADR-060; the impl performs only an N == 0 structural check.
  • dtype — GGML / GGUF / ONNX tensor element-type alphabet per ADR-057: 43 sealed dtype::Dtype impls (continuous floats, ONNX FLOAT8 / complex / packed-4-bit, signed / unsigned integers, boolean, GGML legacy block-32 quantization, GGML K-series block-256 quantization, GGML IQ-series importance-aware quantization) exposed through the dtype::TensorDtypeRegistry shape-IRI registry as Term::Recurse targets for container-format realizations. Compression-operator codomain context: per ADR-058 the κ-derivation is the framework’s compression operator; tensor element types occupy the R-level of the operator-geometry codomain per ADR-059.
  • shape — higher-rank tensor shape carriers: shape::Tensor3Shape (rank-3) and shape::Tensor4Shape (rank-4). Common GGUF / ONNX rank coverage; higher ranks compose through partition_product! per ADR-033/044.

§ConstrainedTypeShape declarations

Per ADR-031’s Tensor<Element, Shape> shape commitment:

Higher-rank tensors compose through partition_product! per ADR-033/044; the axis layer fixes the atom shape.

§Closure under uor-foundation (ADR-013)

Every axis trait declared here has ::uor_foundation::pipeline::AxisExtension as a supertrait; parametric impls hand-write their AxisExtension impl since the axis!-emitted companion macro takes :ident.

§See also

Re-exports§

pub use activation::ActivationAxis;
pub use activation::CpuI8VectorActivation;
pub use shape::Tensor3Shape;
pub use shape::Tensor4Shape;
pub use tensor::CpuI8MatmulSquare;
pub use tensor::MatrixShape;
pub use tensor::TensorAxis;
pub use tensor::VectorShape;

Modules§

activation
ActivationAxis declaration + parametric element-wise i8 nonlinearity reference impls.
dtype
GGML / GGUF / ONNX tensor element-type alphabet per Wiki ADR-031.
shape
Higher-rank tensor ConstrainedTypeShape carriers (Tensor3Shape, Tensor4Shape).
tensor
TensorAxis declaration + parametric square-matmul impl + shape.
verbs
Layer-3 substrate-Term verbs per Wiki ADR-024 + Wiki ADR-055 + Wiki ADR-056 (ψ-residuals discipline scope refined to route bodies only — verb bodies admit comparison + concat + hash composition).

Macros§

axis_extension_impl_for_activation_axis
Wiki ADR-030 companion macro: instantiate AxisExtension for a concrete struct implementing this axis trait. The macro emits an impl AxisExtension for <StructIdent> block that delegates dispatch_kernel to the axis-trait methods per KERNEL_* id. The orphan-rule-conformant per-struct impl mechanism replacing the blanket impl<T: <axis>> AxisExtension for T (which would violate Rust’s orphan rule from any crate that does not define AxisExtension).
axis_extension_impl_for_tensor_axis
Wiki ADR-030 companion macro: instantiate AxisExtension for a concrete struct implementing this axis trait. The macro emits an impl AxisExtension for <StructIdent> block that delegates dispatch_kernel to the axis-trait methods per KERNEL_* id. The orphan-rule-conformant per-struct impl mechanism replacing the blanket impl<T: <axis>> AxisExtension for T (which would violate Rust’s orphan rule from any crate that does not define AxisExtension).

Constants§

STANDARD_LIBRARY_VERSION
Wiki ADR-031 standard-library version banner.