Skip to main content

DLSlime Transfer Engine

Project description

DLSlime logo

Docs | Roadmap | Slack | WeChat Group | Zhihu | English | 中文

Composable and Embeddable Communication Runtime for AI Services

DLSlime is a PeerAgent-centered communication and microservice toolkit for distributed AI systems. PeerAgent is the runtime hub: application services such as SlimeRPC and DLSlimeCache build on it, NanoCtrl supplies service governance and coordination metadata around it, and endpoint APIs below it drive heterogeneous transports such as RDMA, NVLink, and Ascend Direct.

DLSlime is designed to be adopted one layer at a time. Applications can start with direct endpoints, add PeerAgent coordination, use NanoCtrl for governance, or build on SlimeRPC and DLSlimeCache when they need service-shaped components. The same layers are exposed as Python/C++ APIs, local services, and HTTP control-plane contracts, so DLSlime can be embedded into existing serving, inference, cache, or RL systems instead of replacing them.

Latest News

2025
  • [2025/12] DLSlime was featured at the Global C++ and System Software Technology Conference in the talk “Design and Implementation of a Flexible and Efficient Heterogeneous Transfer Library”. View the session page.
  • [2025/09] DLSlime was open-sourced as DeepLink's unified communication library for efficient heterogeneous training and inference. Read the WeChat article.
  • [2025/07] DLSlime supports the DeepLink ultra-large-scale cross-region hybrid training solution released by Shanghai AI Laboratory, including the “3D parallelism + PS” architecture and kilometer-scale heterogeneous training deployments. Read the SHLab news.
  • [2025/06] DLSlime provides DeepSeek-V3 PD disaggregation support for LMDeploy.

PeerAgent-Centered Architecture

DLSlime is organized around PeerAgent. Application services attach to PeerAgent, NanoCtrl provides service governance and coordination metadata, and endpoint APIs drive the underlying transfer engines and devices. The diagram below shows these layers without requiring applications to bind themselves to one transport or topology.

DLSlime PeerAgent-centered architecture

How The Layers Work Together

  1. A service starts and registers itself with NanoCtrl as a generic entity, for example kind=cache or kind=rpc-worker.
  2. Each service attaches to a PeerAgent instead of managing transport state directly.
  3. PeerAgents register their resource records and memory regions with NanoCtrl.
  4. Clients discover services by kind and scope, then reach the service through its PeerAgent.
  5. PeerAgents exchange connection intent and memory-region metadata through NanoCtrl/Redis.
  6. Endpoint objects issue the actual transfer through RDMA, NVLink, Ascend Direct, or the selected backend.

Usage Scenarios

Direct Endpoint Access

Use the Endpoint API directly when the application already controls peer placement, metadata exchange, and memory lifetime. This is the lowest-level path through DLSlime: it avoids NanoCtrl and PeerAgent, and maps application transfer logic straight onto endpoint-to-endpoint data movement.

Direct endpoint-to-endpoint access

Typical examples are two-process RDMA read/write tests, NVLink transfer checks, and backend bring-up where explicit setup is more useful than service discovery.

Example: p2p_rdma_rc_read.py, p2p_rdma_rc_write.py, p2p_nvlink.py, and p2p_ascend_read.py.

python examples/python/p2p_rdma_rc_read.py
python examples/python/p2p_rdma_rc_write.py
python examples/python/p2p_rdma_rc_write_with_imm_data.py
python examples/python/p2p_rdma_rc_send_recv_gdr.py
torchrun --nproc_per_node=2 examples/python/p2p_nvlink.py
python examples/python/p2p_ascend_read.py

Ascend Direct setup details live in docs/huawei_ascend/README.md.

PeerAgent-to-PeerAgent Access

Use PeerAgent when the application wants peer-to-peer data movement without managing connection setup, memory-region discovery, and stale-state cleanup by itself. Each process owns a PeerAgent, registers its resources through NanoCtrl, and then uses the PeerAgent facade to read or write remote memory through the selected endpoint.

This path keeps the same endpoint data plane as direct access, but moves coordination into NanoCtrl and PeerAgent. It is the right starting point for multi-process services, dynamic peer discovery, and higher-level components such as SlimeRPC and DLSlimeCache.

PeerAgent-to-PeerAgent access

Example: p2p_rdma_rc_read_ctrl_plane.py and p2p_rdma_multi_agents_ctrl_plane.py.

nanoctrl start
python examples/python/p2p_rdma_rc_read_ctrl_plane.py

DLSlimeCache Service

Use DLSlimeCache when multiple PeerAgent clients need a shared RDMA-backed cache service. PeerAgent A and PeerAgent B discover the Cache Service through NanoCtrl, fetch cache assignment metadata from the service, and then read or write cache slabs through the same PeerAgent and endpoint data plane.

In this path, NanoCtrl keeps the Cache Service discoverable as a registered service, the Cache Service owns the cache memory region and assignment manifests, and PeerAgent clients perform the data movement without embedding cache placement logic into each application process.

DLSlimeCache service access

Example: cache_client_example.py and dlslime-cache design.

nanoctrl start
dlslime-cache start --ctrl http://127.0.0.1:3000 \
  --host 127.0.0.1 --port 8765 --memory-size 1G

python examples/python/cache_client_example.py --url http://127.0.0.1:8765

dlslime-cache stop

SlimeRPC Service

Use SlimeRPC when application logic should call a Python service while keeping the transport and peer coordination inside DLSlime. A client process uses a SlimeRPC proxy on top of its PeerAgent, the service process serves Python methods through a SlimeRPC server on top of its own PeerAgent, and NanoCtrl keeps the RPC service discoverable.

RPC request and response messages are carried by the PeerAgent transport rather than the control plane. This keeps service invocation at the application layer while reusing the same PeerAgent, endpoint, and mailbox data path as lower-level peer-to-peer flows.

SlimeRPC service access

Example: rpc_example.py and rpc_flatbuf_example.py.

nanoctrl start
python examples/python/rpc_example.py --ctrl http://127.0.0.1:3000

Disaggregated Inference Service

Use DLSlime for disaggregated inference when prefill and decode run as separate serving roles. This follows the same pattern used by LMDeploy DistServe: a proxy routes requests to dedicated Prefill and Decode workers, Prefill computes prompt KV cache, Decode generates tokens, and a migration/data-plane backend transfers KV cache between the two roles.

In DLSlime terms, each Prefill or Decode worker can be modeled as a service with its own PeerAgent. NanoCtrl keeps the worker roles discoverable by kind, stores resource and memory metadata for the PeerAgents, and lets the serving proxy or workers build the required prefill-to-decode connections. The KV cache transfer then uses the PeerAgent and endpoint data plane instead of going through the control plane.

Disaggregated inference service

LMDeploy reference: DistServe with DLSlimeBackend and DistServe with MooncakeBackend.

RL Service

Coming soon.

Install

From PyPI

pip install dlslime==0.0.3.rc2

The PyPI package is built with the default CMake flags. Build from source when you need optional transports or local C++ changes.

From Source

git clone https://github.com/deeplink-org/DLSlime.git
cd DLSlime
pip install -v --no-build-isolation -e .

Pass CMake flags through the environment when enabling optional components:

BUILD_NVLINK=ON BUILD_TORCH_PLUGIN=ON \
  pip install -v --no-build-isolation -e .

For a pure C++ build:

cmake -S . -B build -GNinja -DBUILD_PYTHON=OFF -DBUILD_RDMA=ON
cmake --build build

Build Flags

Flag Default Description
BUILD_RDMA ON Build the RDMA transfer engine
BUILD_PYTHON OFF in CMake, ON in pyproject.toml Build Python bindings
BUILD_NVLINK OFF Build the NVLink transfer engine
BUILD_ASCEND_DIRECT OFF Build Ascend Direct transport
BUILD_TORCH_PLUGIN OFF Build DLSlime as a torch backend
BUILD_BENCH OFF Build C++ transfer-engine benchmarks
BUILD_TEST OFF Build C++ tests
USE_MACA OFF Enable Metax platform support for torch backend builds

Benchmarks

Benchmark commands and historical performance tables now live under the benchmark directory:

Common entry points:

# Aggregated RDMA transfer benchmark, two nodes
torchrun --master-addr <addr> --master-port 6006 \
  --nnodes 2 --nproc-per-node 8 --node-rank <rank> \
  bench/python/agg_transfer_bench_spmd.py \
  --qp-num 8 --transfer-engine dlslime \
  --batch-size 64 --num-iteration 100 --num-concurrency 8

# SlimeRPC vs Ray local benchmark
bash bench/python/run_rpc_bench.sh

Repository Layout

dlslime/   Core Python package, C++ bindings, and transfer/runtime primitives
NanoCtrl/  Service governance control plane
examples/  Runnable examples for endpoint, PeerAgent, cache, and RPC flows
bench/     Benchmark scripts and benchmark README
docs/      Design notes, roadmap, and platform guides
tests/     Python and C++ tests

Documentation

License

See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dlslime-0.1.0-cp313-cp313-manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.13

dlslime-0.1.0-cp312-cp312-manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.12

dlslime-0.1.0-cp311-cp311-manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.11

dlslime-0.1.0-cp310-cp310-manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10

dlslime-0.1.0-cp39-cp39-manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.9

dlslime-0.1.0-cp38-cp38-manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.8

File details

Details for the file dlslime-0.1.0-cp313-cp313-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dlslime-0.1.0-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8948cd744fddcc3f6e5f3e171aa7f2b0475762d25141f59b737068754d2a9b96
MD5 be4b2292f167847d039fd6c2e4d2b078
BLAKE2b-256 5e1006f12472d9e9a3bd4f5defc03bf9108c8dc6fb3bc25f67d755bd606527a5

See more details on using hashes here.

File details

Details for the file dlslime-0.1.0-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dlslime-0.1.0-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d1e939aa5631f091fc78cb67233e6a453e9434fe7f2b3417cbda76bc6fdf3cea
MD5 dda617504a53e061fbcc612ef5921cbb
BLAKE2b-256 05ea6f91cfb6733cde767bf34fac919291120714efd338a6236ca9c33479eeca

See more details on using hashes here.

File details

Details for the file dlslime-0.1.0-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dlslime-0.1.0-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7003bbdcfaf01203fd4510528f32b7b51edb29e2caeb9c475b7c8a62481ea675
MD5 882b2deb3b05dbdba016c4d29f3932ba
BLAKE2b-256 da52fc40fcb954934a75f42b8528ecdbd2f7431c91ac16fae5e2654d6cb9e122

See more details on using hashes here.

File details

Details for the file dlslime-0.1.0-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dlslime-0.1.0-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8756b06b2d45a25d18ad200796bb5f3f28e8d96304c440f57a322488105ed9bc
MD5 1f46d6e425e74cc2e35b677d1be6c946
BLAKE2b-256 2ba7a3f43a27eac3cf05af3ae8577f84fe34a8496a415d0c0ac14f79e3b6bd03

See more details on using hashes here.

File details

Details for the file dlslime-0.1.0-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dlslime-0.1.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6bca5db31a8feae5e624afccee9463df49118cf2fb99747c55eeeb2f1984634a
MD5 49b4381135808179a8abeebddf55b661
BLAKE2b-256 bbb78d930e968c137f8197f73968ba230bf0c91527afae96cc42dc1ebc58c6c0

See more details on using hashes here.

File details

Details for the file dlslime-0.1.0-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dlslime-0.1.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 33d5fe9e8c4a75a7e80bee8f3ef1d13f7a4a2ba58249dd9e0bb103ec4b87349d
MD5 cd868ad423ea4b48ad2f97914e90277b
BLAKE2b-256 0ea5aab819c71867c7411cc0b258bb349d7528c5872f50f7296567550b3108a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page