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 -- --nocaptureThe 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 FFIThe 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-kernelsdlm 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
| Path | What lives there |
|---|---|
src/forward | The kernels (CPU, GPU, streaming), the trait, and the orchestrator. |
src/gpu | The CUDA/HIP FFI and kernels.cu. |
src/profiler | The VRAM budget math. |
src/server | The OpenAI-compatible HTTP server and engine. |
src/distributed | Sharding, the coordinator, and the worker protocol. |
src/loader.rs | Float safetensors weight loading (F32/F16/BF16) — GPTQ/AWQ qweight checkpoints are refused here. |
Opening a pull request
- Branch from main and keep changes focused.
- Add or update a test — the existing suites (
tests/*.rs) are the pattern to follow. - Run
cargo testandcargo checkacross the relevant features before pushing. - Open the PR on GitHub.