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

From the project README ·

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

FeatureIntegrationData movement
pyo3Python capsule protocol and C Exchange APIzero-copy protocol layer
imageImageBuffer producer and consumerzero-copy
ndarrayowned arrays and borrowed viewszero-copy
halff16 and bf16 element types—
candleCPU Tensorzero-copy export, copying import
cudarcCudaSlice<T>zero-copy
safetensorsfile/mmap export and serialization viewszero-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

Runnable demos live under demos/:

  • cuda-python: CuPy and Torch exchange through a Rust-owned CUDA buffer.
  • metal-python: MLX exchange through a shared MTLBuffer.
  • image-python: Torch exchange with image::RgbImage.
  • ndarray-candle: an ndarray → DLPack → candle → DLPack → ndarray round trip.

The API reference is available on docs.rs.

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.

dlpark beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
dlpark This page Listed

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

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
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 days
  • dormancy: last activity 2026-10-26, 14 days ago, E = 365: active
  • featured: 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
Adoption5 active dependents, 3 new dependents in 365 days1 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependents5crates.io database dumpYes
New dependents (365 days)3crates.io database dumpYes
Peak active dependents5crates.io database dumpYes
Active dependents as a share of the peak1crates.io database dumpYes
Binary downloads per releaseNot measuredYes
MaintenanceLatest human commit: 14 days ago3 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2026-10-26GitHub repositoryYes
Latest release2026-10-23crates.io database dumpYes
First release2023-05-09crates.io database dumpYes
Latest version0.10.0crates.io database dumpYes
Days the oldest outside issue waits for a reply0GitHub repositoryYes
Maintainer replies over 365 days19GitHub repositoryYes
Repository archivedfalseGitHub repositoryYes
Repository gonefalseGitHub repositoryYes
Release commit or manifest in the repotruecrates.io packageYes
Published docstruecrates.io database dumpYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityUnpatched vulnerabilities: none
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windownoneRustSec advisory databaseYes
RustSec unmaintained advisorynoneRustSec advisory databaseYes
Deprecation noticenonecrates.io database dumpYes
Deprecated requirementnonecrates.io database dumpYes
Distribution25 releases, 68,157 downloads over 30 days5 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases25crates.io database dumpYes
Downloads over 30 days68157crates.io database dumpYes
Binary downloads over the last 3 releasesNot measuredYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleasefalsecrates.io database dumpYes
Every version 0.0.xfalsecrates.io database dumpYes
Every version yankedfalsecrates.io database dumpYes
Crate deleted from crates.iofalsecrates.io database dumpYes
Repository66 stars, 5 forks, 8 contributors, 434 commits. Stars alone never qualify a project.
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars66GitHub repositoryYes — one part of the repository route
GitHub forks5GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account8GitHub contributorsYes — one part of the repository route
Commits on the default branch434GitHub repositoryNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseApache-2.0crates.io database dumpNo
Runs on, from listed crates and their direct dependenciesCUDAcrates.io database dumpNo
What shows each backendCUDA: dlpark feature cudarc (dependency cudarc)crates.io database dumpNo
Native code, from listed crates and their dependenciesNo native code foundcrates.io database dumpNo
Python bindings, from direct dependencies of listed cratesHas Python bindings: dlpark needs Python only with feature cpu-allcrates.io database dumpNo
Crates that depend on a listed crate directly5crates.io database dumpNo

Corrections and review history

Report a correction

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.