strided-rs is a Rust workspace for strided tensor views, kernels, and einsum.
It is inspired by Julia's Strided.jl,
StridedViews.jl, and
OMEinsum.jl.
The recommended user-facing crate is strided-rs.
Use individual crates such as strided-perm, strided-view, or
strided-kernel directly when you need a smaller dependency surface or a
lower-level API.
strided-rs: facade crate that re-exports the main workspace APIsstrided-traits: shared scalar and element-operation traitsstrided-view: core dynamic-rank strided view/array types and metadata opsstrided-perm: cache-efficient tensor permutation / transposestrided-kernel: cache-optimized elementwise/reduction kernels over strided viewsstrided-einsum2: binary einsum (einsum2_into) on strided tensorsstrided-opteinsum: N-ary einsum frontend with nested notation and contraction-order optimizationmdarray-opteinsum: einsum wrapper formdarrayarrays (row-major ↔ column-major transparent conversion)ndarray-opteinsum: einsum wrapper forndarrayarrays (direct strides passthrough)
- Dynamic-rank strided views (
StridedView/StridedViewMut) over contiguous memory - Owned strided arrays (
StridedArray) with row-major and column-major constructors - Lazy element operations (conjugate, transpose, adjoint) with type-level composition
- Zero-copy transformations: permuting, transposing, broadcasting
- Cache-optimized iteration with automatic blocking and loop reordering
- Optional multi-threading via Rayon (
parallelfeature) with recursive dimension splitting
These crates are being prepared for crates.io publication, but this repository does not publish them automatically. Until a release is published, use workspace path dependencies:
[dependencies]
strided-rs = { path = "../strided-rs/strided-rs" }After publication, use:
[dependencies]
strided-rs = "0.1"Generate API docs locally:
cargo doc --workspace --no-depsOpen docs locally:
open target/doc/index.htmlCI also builds rustdoc on PRs and deploys workspace docs to GitHub Pages on main.
See the strided-rs Quick Start. The Rust
example there is included in crate docs and verified by doctests in CI.
See each sub-crate README for usage examples:
strided-rs— recommended facade crate and executable Quick Startstrided-view— types, view operationsstrided-perm— permutation and transpose kernelsstrided-kernel— map/reduce/broadcast kernelsstrided-einsum2— binary einsum with GEMM backendstrided-opteinsum— N-ary einsummdarray-opteinsum— einsum wrapper formdarrayarraysndarray-opteinsum— einsum wrapper forndarrayarrays
Performance design notes:
faer-kernel-writing-guide— practical rules for writing hot strided kernels based on faerfaer_design— SIMD design analysis and optimization plan
Published benchmark programs and current measured results live in
strided-rs-benchmark-suite.
Reports of bottlenecks, failure cases, or workloads where a strided path loses
to a credible naive baseline are welcome; please include shape, strides,
element type, thread count, and a minimal reproducer when possible.
This crate is inspired by and ports functionality from:
- Strided.jl by Jutho
- StridedViews.jl by Jutho
- HPTT by Paul Springer, Tong Su, and
Paolo Bientinesi, whose transpose algorithm
strided-permreimplements - OMEinsum.jl for
strided-opteinsumdesign ideas and reference test-case patterns
A per-component table of which external projects each crate builds on, and the algorithm-origin references, is maintained in the Provenance and Citation Policy.
If you use strided-rs in research, please read the
Provenance and Citation Policy
and cite the original papers of the algorithms your work relies on (for
example the HPTT paper,
ARRAY 2017, when your work relies
on strided-perm), and check the citation policies of the upstream projects
the components you use are ported from, applying them recursively. This is
the permanent citation style for this project: a future strided-rs software
paper will add to, not replace, these upstream citations. Until then,
reference strided-rs directly by repository URL and version or commit.
Licensed under either of:
- Apache License, Version 2.0 (
LICENSE-APACHE) - MIT license (
LICENSE-MIT)
See NOTICE for upstream attribution (Strided.jl / StridedViews.jl are
MIT-licensed) and THIRD-PARTY-LICENSES for the HPTT attribution; the
strided-perm crate is licensed as (MIT OR Apache-2.0) AND BSD-3-Clause
because its transpose module is derived from HPTT (BSD-3-Clause).