Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

330 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

strided-rs

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.

Workspace Layout

  • strided-rs: facade crate that re-exports the main workspace APIs
  • strided-traits: shared scalar and element-operation traits
  • strided-view: core dynamic-rank strided view/array types and metadata ops
  • strided-perm: cache-efficient tensor permutation / transpose
  • strided-kernel: cache-optimized elementwise/reduction kernels over strided views
  • strided-einsum2: binary einsum (einsum2_into) on strided tensors
  • strided-opteinsum: N-ary einsum frontend with nested notation and contraction-order optimization
  • mdarray-opteinsum: einsum wrapper for mdarray arrays (row-major ↔ column-major transparent conversion)
  • ndarray-opteinsum: einsum wrapper for ndarray arrays (direct strides passthrough)

Features

  • 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 (parallel feature) with recursive dimension splitting

Installation

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"

Documentation

Generate API docs locally:

cargo doc --workspace --no-deps

Open docs locally:

open target/doc/index.html

CI also builds rustdoc on PRs and deploys workspace docs to GitHub Pages on main.

Quick Start

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:

Performance design notes:

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.

Acknowledgments

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-perm reimplements
  • OMEinsum.jl for strided-opteinsum design 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.

How to Cite

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.

License

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).

About

Strided tensor views, kernels, permutation and einsum

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages