Skip to content

Contributing

dlm is Apache-2.0 and built in the open. It’s a single Rust crate that builds and tests entirely on CPU — no GPU required to hack on it.

Build & test

$git clone https://github.com/vedantnimbarte/dlm && cd dlm
$cargo build --release
$cargo test
$cargo test -- --nocapture

The suite covers the safetensors parser and zero-copy reads, the VRAM math against hand-computed values, pinned-buffer alignment, tensor classification, the layer catalog, and the double-buffer schedule and execution correctness.

Feature flags

Type-checking works without any GPU toolkit; building the GPU paths needs the matching runtime. See Build & features for the full matrix.

$cargo check --features cuda # validates the CUDA FFI
$cargo check --features rocm # validates the ROCm/HIP FFI

The GPU parity test

On a CUDA machine, the parity test decodes the same random model on both the CPU and GPU kernels and asserts the hidden states match — the CPU kernel is the correctness oracle for the device code.

$cargo test --features cuda-kernels
dlm doctor runs the same CPU-vs-GPU parity probe live on real hardware — use it to check the GPU paths on a machine with a card.

Codebase map

PathWhat lives there
src/forwardThe kernels (CPU, GPU, streaming), the trait, and the orchestrator.
src/gpuThe CUDA/HIP FFI and kernels.cu.
src/profilerThe VRAM budget math.
src/serverThe OpenAI-compatible HTTP server and engine.
src/distributedSharding, the coordinator, and the worker protocol.
src/loader.rsFloat safetensors weight loading (F32/F16/BF16) — GPTQ/AWQ qweight checkpoints are refused here.

Opening a pull request