[Feature] Integrate Mooncake Transfer Engine with TurboMind for PD disaggregation and remote KV

Đang mở
#4,443 5 bình luận 2 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
cpp, python

Hướng nghiên cứu

Bắt đầu bằng cách đọc lmdeploy/pytorch/disagg/backend/mooncake.py và config.py, sau đó kiểm tra SequenceManager., BlockManager., src/turbomind/engine/engine.cc của TurboMind cùng mã request/scheduling. Chia công việc thành các giai đoạn được đề xuất: dependency CMake, metadata/RPC, các hook truyền dữ liệu bộ nhớ và xác thực trên hai máy. Công việc được xem là hoàn tất khi quá trình phân tách PD của Mooncake hoạt động end-to-end với TurboMind, đồng thời duy trì metadata và hành vi KV tương thích.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Motivation

Motivation

LMDeploy already provides PD disaggregation (DistServe) on the PyTorch engine via lmdeploy/pytorch/disagg/, with Mooncake as an optional KV migration backend (MooncakeBackend, using the Python mooncake.engine.TransferEngine).

TurboMind (C++) remains a high-performance path, but it is not integrated with Mooncake today, so Prefill/Decode split deployments cannot reuse TurboMind's paged KV and kernel stack for cross-node KV.

We would like to integrate Mooncake's Transfer Engine (or an equivalent C++ SDK) into TurboMind's C++ layer to:

  • Align block lifecycle with SequenceManager / BlockManager (including optional prefix caching and consistent KV quantization layout);
  • Asynchronously export KV after prefill on the prefill side, asynchronously pull on the decode side, and overlap transfer with compute;
  • Align or stay compatible with Conductor / metadata protocols used on the PyTorch side to avoid diverging semantics.

Goal: enable end-to-end Mooncake-based PD disaggregation on TurboMind with minimal impact on throughput.

Related resources

  • In-repo: lmdeploy/pytorch/disagg/backend/mooncake.py, lmdeploy/pytorch/disagg/config.py (MooncakeEngineConfig, MigrationBackend)
  • Mooncake: https://github.com/kvcache-ai/Mooncake
  • TurboMind pointers: src/turbomind/models/llama/SequenceManager., BlockManager., src/turbomind/engine/engine.cc and request/scheduling code

Additional context

  • Current state: Mooncake PD disaggregation is implemented for PyTorch; TurboMind has no Mooncake / disagg integration.
  • Challenges: block/chunk mapping between TurboMind and Mooncake, KV sharding under attn_tp / attn_cp, and scheduling/state machine when waiting for remote KV.
  • Suggested phases: optional CMake dependency -> metadata/RPC -> memory transfer hooks -> two-machine e2e validation.

One-liner

PyTorch engine supports PD disaggregation and KV migration via Mooncake (and DLSlime); TurboMind does not yet support Mooncake-based PD disaggregation.

Related resources

No response

Additional context

No response

Ngôn ngữ chính
Python
Star
8.2k
Fork
797
Merge trung bình
3 ngày 15 giờ
Pull request đã merge (30 ngày)
52

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của InternLM/lmdeploy

Tất cả issue của InternLM/lmdeploy

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.