[PD] feat: support mooncake intra-node nvlink kv transfer#17866
[PD] feat: support mooncake intra-node nvlink kv transfer#17866ShangmingCai merged 18 commits intosgl-project:mainfrom
Conversation
…ack is CudaMalloc
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…d else if condition for custom_mem_pool
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
/tag-and-rerun-ci |
| if ( | ||
| self.enable_custom_mem_pool and self.custom_mem_pool_type == "NVLINK" | ||
| ) or envs.SGLANG_MOONCAKE_SEND_AUX_TCP.get(): | ||
| if self.enable_custom_mem_pool and self.custom_mem_pool_type in ("NVLINK", "INTRA_NVLINK"): |
There was a problem hiding this comment.
Is this required? Why intra nvlink require send aux with tcp?
There was a problem hiding this comment.
Was there a precision issue with NVL72 previously? So tcp is a workaround for aux data. @ShangmingCai
There was a problem hiding this comment.
No modifications are needed. "Fix me when Mooncake's nvlink_transport is bug-free" applies to mnnvl.
There was a problem hiding this comment.
Yeah, mnnvl has a sync issue when transferring tiny data. So maybe this happens for intra-node nvlink as well, the granularity issue. I am shepherding this PR: #17430, maybe it will help.
There was a problem hiding this comment.
This logic might be wrong? I think intra-node nvlink should not set up SGLANG_MOONCAKE_CUSTOM_MEM_POOL, so self.enable_custom_mem_pool is False.
There was a problem hiding this comment.
This logic might be wrong? I think intra-node nvlink should not set up
SGLANG_MOONCAKE_CUSTOM_MEM_POOL, so self.enable_custom_mem_pool is False.
Problem solved by adding condition:
'elif envs.SGLANG_MOONCAKE_CUSTOM_MEM_POOL.get() == "INTRA_NVLINK":'
Due to device = 'cpu' in previous version, the register_memory will failed in Mooncake when registering aux_data_ptrs. Now, device will be assigned as 'cuda' when using INTRA_NVLINK and aux_data_ptrs will be successfully registered and also no need to send aux with tcp.

|
Let me fix the conflicts |
|
please fix lint |
Solved |
|
/tag-and-rerun-ci |
|
|
||
| # Global constants for custom memory pool types | ||
| SUPPORTED_MOONCAKE_CUSTOM_MEM_POOL_TYPES = ["NVLINK", "BAREX"] | ||
| SUPPORTED_MOONCAKE_CUSTOM_MEM_POOL_TYPES = ["NVLINK", "BAREX", "INTRA_NVLINK"] |
There was a problem hiding this comment.
INTRA_NVLINK appears unprofessional. How about INTRA_NODE_NVLINK?
|
Merge main due to #18044 |
|
/rerun-failed-ci |
1 similar comment
|
/rerun-failed-ci |
|
/rerun-failed-ci |
…t#17866) Co-authored-by: 百麒 <yaozhong.lyz@alibaba-inc.com> Co-authored-by: Teng Ma <teng-ma@linux.alibaba.com>
…t#17866) Co-authored-by: 百麒 <yaozhong.lyz@alibaba-inc.com> Co-authored-by: Teng Ma <teng-ma@linux.alibaba.com>
…t#17866) Co-authored-by: 百麒 <yaozhong.lyz@alibaba-inc.com> Co-authored-by: Teng Ma <teng-ma@linux.alibaba.com>
…t#17866) Co-authored-by: 百麒 <yaozhong.lyz@alibaba-inc.com> Co-authored-by: Teng Ma <teng-ma@linux.alibaba.com>

Motivation
Add new feature : Enable Intra_Node nvlink in SGlang to compatible with Mooncake INTRA_NODE NVLINK isolation PR
kvcache-ai/Mooncake#1341 (comment)
Modifications
Mainly modified part is /Mooncake/utils.py
Accuracy Tests
To enable intra-Node nvlink, you can launch server using the following command
export NCCL_IB_GID_INDEX=1 export NCCL_SOCKET_IFNAME=eth0,eth1 export NCCL_IB_DISABLE=0 export GLOO_SOCKET_IFNAME=eth0 model_path=/mnt/models/Qwen3-235B-A22B-FP8 FILE_NAME_PREFIX=Prefill_Mooncake_INRTANVLINK_kv_transfer_Hicache_test_qwen3_235b_tp4_1210_0 SGLANG_MOONCAKE_CUSTOM_MEM_POOL=true SGLANG_MOONCAKE_CUSTOM_MEM_POOL=INTRA_NVLINK MC_LOG_LEVEL=INFO MC_TE_METRIC=true MC_INTRANODE_NVLINK=true SGLANG_TORCH_PROFILER_DIR=/root/Yaozhong_hiecache/profile/ python3 -m sglang.launch_server \ --model-path ${model_path} \ --tp 4 \ --mem-fraction-static 0.85 \ --disaggregation-mode prefill \ --port 7001 \ --watchdog-timeout 1000000 --decode-log-interval 1 >/root/LYZ_hicache/log/${FILE_NAME_PREFIX}.log 2>&1SGLANG_MOONCAKE_CUSTOM_MEM_POOL=true is to align with the design when use MNNVL "MC_FORCE_MNNVL=true". Please be awared, "MC_FORCE_MNNVL=true" and "MC_INTRANODE_NVLINK=true" must be exclusively used when launch SGlang server.
Benchmarking and Profiling
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci