dlpark
Library Listed
Pure Rust DLPack implementation for zero-copy tensor interoperability
- Downloads
- 68,157
- Dependents
- 5
- Stars
- 66
- Forks
- 5
- Contributors
- 8
- Commits
- 434
- Latest release
- 0.10.0 ·
About
A pure Rust implementation of DLPack for zero-copy tensor exchange. It supports the legacy and versioned ABIs, Rust container adapters, the Python Array API protocol, and DLPack 1.3 C Exchange.
Installation
No features are enabled by default. Enable only the integrations you use:
cargo add dlpark --features "ndarray half"
cargo add dlpark --features "pyo3 image"
cargo add dlpark --features "cudarc"
cargo add dlpark --features "safetensors"
Quick start
A producer owns its container through the managed tensor's deleter. The versioned ABI is recommended for new code:
use dlpark::{allocation::dynamic, ffi::DLManagedTensorVersioned, versioned};
use ndarray::arr2;
let initialized: dynamic::Initialized<DLManagedTensorVersioned> =
Box::new(arr2(&[[1_i32, 2, 3], [4, 5, 6]])).try_into()?;
let dlpack: versioned::Dlpack = unsafe { initialized.finish() };
let tensor = dlpack.validate()?;
assert_eq!(tensor.shape(), &[2, 3]);
assert_eq!(unsafe { tensor.cpu_slice::<i32>()? }, &[1, 2, 3, 4, 5, 6]);
# Ok::<(), Box<dyn std::error::Error>>(())
Read the full README
finish is unsafe because the caller must ensure that the completed
descriptor obeys the DLPack lifetime, pointer, layout, and flag requirements.
Imported descriptors should be checked with Managed::validate() before their
metadata is used.
Features
| Feature | Integration | Data movement |
|---|---|---|
pyo3 | Python capsule protocol and C Exchange API | zero-copy protocol layer |
image | ImageBuffer producer and consumer | zero-copy |
ndarray | owned arrays and borrowed views | zero-copy |
half | f16 and bf16 element types | — |
candle | CPU Tensor | zero-copy export, copying import |
cudarc | CudaSlice<T> | zero-copy |
safetensors | file/mmap export and serialization views | zero-copy |
Raw CUDA and Metal runtime policy remains application-specific. The
demos/cuda-python and demos/metal-python projects show complete native
buffer implementations.
Guides
- Ownership, validation, metadata, and versioning
- Python import, reusable export, streams, and C Exchange
- Interop backend behavior
- Development and binding regeneration
Runnable demos live under demos/:
cuda-python: CuPy and Torch exchange through a Rust-owned CUDA buffer.metal-python: MLX exchange through a sharedMTLBuffer.image-python: Torch exchange withimage::RgbImage.ndarray-candle: anndarray → DLPack → candle → DLPack → ndarrayround trip.
The API reference is available on docs.rs.
Compatibility
- Runs on
- CUDA
What shows it
- CUDA: dlpark feature cudarc (dependency cudarc)
- Native code
- None found
- No native code found
- Python bindings
- Has Python bindings
- dlpark needs Python only with feature cpu-all
- License
- Apache-2.0
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
Pure Rust DLPack implementation for zero-copy tensor interoperability Python bindings |
68,157 downloads over 30 days | 5 | 66 | 0.10.0 | CUDA | No native code found | Apache-2.0 |
|
arrow-rs Featured
Rust implementation of Apache Arrow Python bindings Also in Datasets and model formats. |
10,746,755 downloads over 30 days | 2,126 | 3,664 | 60.1.0 | GPU support unknown | Binds native code: ring (feature encryption), liblzma-sys (feature default), zstd-sys (feature default) | Apache-2.0 |
|
delta-rs Featured
Native Delta Lake implementation in Rust Also in Datasets and model formats. |
463,085 downloads over 30 days | 33 | 3,356 | 1.1.4 | GPU support unknown | Binds native code: lz4-sys (feature delta-cache), zstd-sys (feature delta-cache) | Apache-2.0 |
|
hdf5-rust Featured
Thread-safe Rust bindings for the HDF5 library. Also in Datasets and model formats. |
253,180 downloads over 30 days | 70 | 85 | 0.15.1 | GPU support unknown | Binds native code: hdf5-metno-sys, blosc-src (feature blosc), lzf-sys (feature lzf), mpi-sys (feature mpio), zfp-sys (feature zfp) | Apache-2.0 OR MIT |
|
hdf5-pure Featured
Pure-Rust HDF5 library: read, write, and edit files in place (WASM-compatible, no C dependencies) Also in Datasets and model formats. |
64,279 downloads over 30 days | 18 | 42 | 0.47.0 | GPU support unknown | No native code found | Apache-2.0 OR MIT |
|
numr Listed
The base for numerical code in Rust, in the role NumPy has in Python: n-dimensional tensors, linear algebra, FFT, statistics and autograd on CPU, CUDA and WebGPU. The backends use native kernels, with no cuBLAS, MKL or other vendor math library. Also in Tensors and GPU compute. |
1,673 downloads over 30 days | 7 | 59 | 0.15.2 | CUDA, WebGPU | Binds native code: ring (feature distributed) | Apache-2.0 |
|
hdf5-pure-rs New
Pure Rust implementation of the HDF5 file format Also in Datasets and model formats. |
801 downloads over 30 days | 5 | 5 | 0.3.10 | GPU support unknown | No native code found | BSD-3-Clause |
All projects in Datasets and model formatsAll projects in Tensors and GPU compute
Why ListedNo archive, New or Featured rule places it, so it is Listed.
What it lacks for Featured
- It has 5 active dependents and 3 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 66 stars, 5 forks and 8 contributors. It needs 4,539 stars, 434 forks and 79 contributors together.
What else the check found
- The last activity is on 26 Oct 2026, 14 days ago. The rules expect an update within 365 days. Dormancy rule
Exact rules: Listed, Featured library. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: version 0.10.0 base 140, doubled for 68157 downloads per month, raised to the 365-day floor: E = 365 daysdormancy: last activity 2026-10-26, 14 days ago, E = 365: activefeatured: not featured: active_users 5 < 11 and new_adopters 3 < 9 and repository route stars 66 (needs 4539), forks 5 (needs 434), contributors 8 (needs 79)listed: listed: no archive, new or featured rule applies
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption5 active dependents, 3 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 5 | crates.io database dump | Yes | |
| New dependents (365 days) | 3 | crates.io database dump | Yes | |
| Peak active dependents | 5 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 14 days ago3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2026-10-26 | GitHub repository | Yes | |
| Latest release | 2026-10-23 | crates.io database dump | Yes | |
| First release | 2023-05-09 | crates.io database dump | Yes | |
| Latest version | 0.10.0 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 0 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 19 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution25 releases, 68,157 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 25 | crates.io database dump | Yes | |
| Downloads over 30 days | 68157 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository66 stars, 5 forks, 8 contributors, 434 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 66 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 5 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 8 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 434 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | Apache-2.0 | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | CUDA | crates.io database dump | No | |
| What shows each backend | CUDA: dlpark feature cudarc (dependency cudarc) | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | No native code found | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | Has Python bindings: dlpark needs Python only with feature cpu-all | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 5 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.