deepmd
Repository: github.com/eugenehp/deepmd-rs
DeePMD-kit deep potential models as RLX IR graph builders.
This crate translates the inference-side graph construction from
deepmd.dpmodel into
rlx_ir::Graph objects. Compile and execute
them on any RLX backend (CPU, Metal, MLX, CUDA, WGPU, …).
Quick start
Add to Cargo.toml:
[]
= "0.1"
= { = "0.2", = false, = ["cpu"] }
Build and run a small energy model on CPU:
use ;
use build_dp_energy_graph;
use DType;
use ;
let cfg = DPModelConfig ;
let nf = 1;
let nloc = 4;
let = build_dp_energy_graph.unwrap;
let mut graph = graph;
graph.set_outputs;
let session = new;
let compiled = session.compile;
// Bind weights with `compiled.set_param_typed(...)`, then `compiled.run(...)`.
let _ = compiled;
Optional backends
Enable GPU backends via Cargo features on deepmd (they forward to
rlx-runtime):
| Feature | Backend | Platform |
|---|---|---|
| (default) | CPU | everywhere |
metal |
Apple Metal | macOS |
mlx |
Apple MLX | macOS |
cuda |
NVIDIA CUDA | Linux / Windows + NVIDIA GPU |
wgpu |
cross-vendor GPU | Metal / Vulkan / DX12 |
ane |
Apple Neural Engine | macOS (requires CoreML backend in RLX) |
See docs/backend-selection.md for measured latency crossovers and parity notes across backends.
Testing
Golden parity tests compare RLX execution against Python deepmd-kit
reference fixtures:
# CPU parity (default)
# Cross-backend sweep (enable features for your hardware)
License
GPL-3.0-only. See the RLX project for upstream licensing details.