[GH-ISSUE #281] sglang with mooncake prefill node fail with 'Failed to register memory' error #114

Closed
opened 2026-10-29 21:09:31 +00:00 by bsakaguchi · 23 comments
Owner

Originally created by @orrorcol on GitHub (Apr 21, 2025).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/281

sglang and mooncake version:

mooncake-transfer-engine                 0.3.0b5
sglang                                   0.4.5.post2         /sgl-workspace/sglang/python

my gpu environment is:

Mon Apr 21 17:33:33 2025
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.125.06   Driver Version: 525.125.06   CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA A800-SXM...  Off  | 00000000:10:00.0 Off |                    0 |
| N/A   41C    P0    65W / 400W |      3MiB / 81920MiB |      0%      Default |
|                               |                      |             Disabled |
+-------------------------------+----------------------+----------------------+
|   1  NVIDIA A800-SXM...  Off  | 00000000:16:00.0 Off |                    0 |
| N/A   37C    P0    61W / 400W |      3MiB / 81920MiB |      0%      Default |
|                               |                      |             Disabled |
+-------------------------------+----------------------+----------------------+
|   2  NVIDIA A800-SXM...  Off  | 00000000:2A:00.0 Off |                    0 |
| N/A   37C    P0    64W / 400W |      3MiB / 81920MiB |      0%      Default |
|                               |                      |             Disabled |
+-------------------------------+----------------------+----------------------+
|   3  NVIDIA A800-SXM...  Off  | 00000000:2E:00.0 Off |                    0 |
| N/A   38C    P0    63W / 400W |      3MiB / 81920MiB |      0%      Default |
|                               |                      |             Disabled |
+-------------------------------+----------------------+----------------------+
|   4  NVIDIA A800-SXM...  Off  | 00000000:B7:00.0 Off |                    0 |
| N/A   38C    P0    65W / 400W |      3MiB / 81920MiB |      0%      Default |
|                               |                      |             Disabled |
+-------------------------------+----------------------+----------------------+
|   5  NVIDIA A800-SXM...  Off  | 00000000:BC:00.0 Off |                    0 |
| N/A   40C    P0    66W / 400W |      3MiB / 81920MiB |      0%      Default |
|                               |                      |             Disabled |
+-------------------------------+----------------------+----------------------+
|   6  NVIDIA A800-SXM...  Off  | 00000000:D0:00.0 Off |                    0 |
| N/A   37C    P0    63W / 400W |      3MiB / 81920MiB |      0%      Default |
|                               |                      |             Disabled |
+-------------------------------+----------------------+----------------------+
|   7  NVIDIA A800-SXM...  Off  | 00000000:D4:00.0 Off |                    0 |
| N/A   40C    P0    65W / 400W |      3MiB / 81920MiB |      0%      Default |
|                               |                      |             Disabled |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

prefill start command:

python3 -m sglang.launch_server --model-path /Qwen/Qwen2.5-7B-Instruct-GPTQ-Int4 --disaggregation-mode prefill --port 30000 --host ${ip} --tp-size 2

and the error log is:

INFO 04-21 09:34:25 [__init__.py:239] Automatically detected platform cuda.
KV cache is forced as chunk cache for decode server
Overlap scheduler is disabled for prefill server
[2025-04-21 09:34:28] server_args=ServerArgs(model_path='/Qwen/Qwen2.5-7B-Instruct-GPTQ-Int4', tokenizer_path='/Qwen/Qwen2.5-7B-Instruct-GPTQ-Int4', tokenizer_mode='auto', skip_tokenizer_init=False, enable_tokenizer_batch_encode=False, load_format='auto', trust_remote_code=False, dtype='auto', kv_cache_dtype='auto', quantization=None, quantization_param_path=None, context_length=None, device='cuda', served_model_name='/Qwen/Qwen2.5-7B-Instruct-GPTQ-Int4', chat_template=None, completion_template=None, is_embedding=False, revision=None, host='30.246.242.155', port=30000, mem_fraction_static=0.87, max_running_requests=None, max_total_tokens=None, chunked_prefill_size=8192, max_prefill_tokens=16384, schedule_policy='fcfs', schedule_conservativeness=1.0, cpu_offload_gb=0, page_size=1, tp_size=2, stream_interval=1, stream_output=False, random_seed=777934954, constrained_json_whitespace_pattern=None, watchdog_timeout=300, dist_timeout=None, download_dir=None, base_gpu_id=0, gpu_id_step=1, log_level='info', log_level_http=None, log_requests=False, log_requests_level=0, show_time_cost=False, enable_metrics=False, decode_log_interval=40, api_key=None, file_storage_path='sglang_storage', enable_cache_report=False, reasoning_parser=None, dp_size=1, load_balance_method='round_robin', ep_size=1, dist_init_addr=None, nnodes=1, node_rank=0, json_model_override_args='{}', lora_paths=None, max_loras_per_batch=8, lora_backend='triton', attention_backend=None, sampling_backend='flashinfer', grammar_backend='xgrammar', speculative_algorithm=None, speculative_draft_model_path=None, speculative_num_steps=None, speculative_eagle_topk=None, speculative_num_draft_tokens=None, speculative_accept_threshold_single=1.0, speculative_accept_threshold_acc=1.0, speculative_token_map=None, enable_double_sparsity=False, ds_channel_config_path=None, ds_heavy_channel_num=32, ds_heavy_token_num=256, ds_heavy_channel_type='qk', ds_sparse_decode_threshold=4096, disable_radix_cache=False, disable_cuda_graph=True, disable_cuda_graph_padding=False, enable_nccl_nvls=False, disable_outlines_disk_cache=False, disable_custom_all_reduce=False, enable_llama4_multimodal=None, disable_overlap_schedule=True, enable_mixed_chunk=False, enable_dp_attention=False, enable_ep_moe=False, enable_deepep_moe=False, deepep_mode='auto', enable_torch_compile=False, torch_compile_max_bs=32, cuda_graph_max_bs=160, cuda_graph_bs=None, torchao_config='', enable_nan_detection=False, enable_p2p_check=False, triton_attention_reduce_in_fp32=False, triton_attention_num_kv_splits=8, num_continuous_decode_steps=1, delete_ckpt_after_loading=False, enable_memory_saver=False, allow_auto_truncate=False, enable_custom_logit_processor=False, tool_call_parser=None, enable_hierarchical_cache=False, hicache_ratio=2.0, flashinfer_mla_disable_ragged=False, warmups=None, moe_dense_tp_size=None, n_share_experts_fusion=0, disable_chunked_prefix_cache=False, disable_fast_image_processor=False, debug_tensor_dump_output_folder=None, debug_tensor_dump_input_file=None, debug_tensor_dump_inject=False, disaggregation_mode='prefill', disaggregation_bootstrap_port=8998, disaggregation_transfer_backend='mooncake', disaggregation_ib_device=None)
[2025-04-21 09:34:28] The model is convertible to gptq_marlin during runtime. Using gptq_marlin kernel.
INFO 04-21 09:34:32 [__init__.py:239] Automatically detected platform cuda.
INFO 04-21 09:34:32 [__init__.py:239] Automatically detected platform cuda.
INFO 04-21 09:34:32 [__init__.py:239] Automatically detected platform cuda.
[2025-04-21 09:34:34 TP1] The model is convertible to gptq_marlin during runtime. Using gptq_marlin kernel.
[2025-04-21 09:34:34 TP0] The model is convertible to gptq_marlin during runtime. Using gptq_marlin kernel.
[2025-04-21 09:34:35 TP1] The model is convertible to gptq_marlin during runtime. Using gptq_marlin kernel.
[2025-04-21 09:34:35 TP1] Attention backend not set. Use flashinfer backend by default.
[2025-04-21 09:34:35 TP1] Init torch distributed begin.
[2025-04-21 09:34:35 TP0] The model is convertible to gptq_marlin during runtime. Using gptq_marlin kernel.
[2025-04-21 09:34:35 TP0] Attention backend not set. Use flashinfer backend by default.
[2025-04-21 09:34:35 TP0] Init torch distributed begin.
[2025-04-21 09:34:35 TP0] sglang is using nccl==2.21.5
[2025-04-21 09:34:35 TP1] sglang is using nccl==2.21.5
[2025-04-21 09:34:35 TP0] Init torch distributed ends. mem usage=0.87 GB
[2025-04-21 09:34:35 TP1] Init torch distributed ends. mem usage=0.87 GB
[2025-04-21 09:34:35 TP0] Load weight begin. avail mem=78.05 GB
[2025-04-21 09:34:35 TP1] Load weight begin. avail mem=78.05 GB
INFO 04-21 09:34:36 [gptq_marlin.py:235] Using MarlinLinearKernel for GPTQMarlinLinearMethod
INFO 04-21 09:34:36 [gptq_marlin.py:235] Using MarlinLinearKernel for GPTQMarlinLinearMethod
Loading safetensors checkpoint shards:   0% Completed | 0/2 [00:00<?, ?it/s]
Loading safetensors checkpoint shards:  50% Completed | 1/2 [00:00<00:00,  1.02it/s]
Loading safetensors checkpoint shards: 100% Completed | 2/2 [00:01<00:00,  1.62it/s]
Loading safetensors checkpoint shards: 100% Completed | 2/2 [00:01<00:00,  1.49it/s]

[2025-04-21 09:34:38 TP1] Load weight end. type=Qwen2ForCausalLM, dtype=torch.float16, avail mem=75.35 GB, mem usage=2.70 GB.
[2025-04-21 09:34:38 TP0] Load weight end. type=Qwen2ForCausalLM, dtype=torch.float16, avail mem=75.35 GB, mem usage=2.70 GB.
[2025-04-21 09:34:38 TP0] KV Cache is allocated. #tokens: 2440407, K size: 32.58 GB, V size: 32.58 GB
[2025-04-21 09:34:38 TP1] KV Cache is allocated. #tokens: 2440407, K size: 32.58 GB, V size: 32.58 GB
[2025-04-21 09:34:38 TP0] Memory pool end. avail mem=9.64 GB
[2025-04-21 09:34:38 TP1] Memory pool end. avail mem=9.64 GB
[2025-04-21 09:34:38 TP0]

CUDA Graph is DISABLED.
This will cause significant performance degradation.
CUDA Graph should almost never be disabled in most usage scenarios.
If you encounter OOM issues, please try setting --mem-fraction-static to a lower value (such as 0.8 or 0.7) instead of disabling CUDA Graph.

[2025-04-21 09:34:38 TP1]

CUDA Graph is DISABLED.
This will cause significant performance degradation.
CUDA Graph should almost never be disabled in most usage scenarios.
If you encounter OOM issues, please try setting --mem-fraction-static to a lower value (such as 0.8 or 0.7) instead of disabling CUDA Graph.

[2025-04-21 09:34:39 TP1] max_total_num_tokens=2440407, chunked_prefill_size=8192, max_prefill_tokens=16384, max_running_requests=4097, context_len=32768
[2025-04-21 09:34:39 TP0] max_total_num_tokens=2440407, chunked_prefill_size=8192, max_prefill_tokens=16384, max_running_requests=4097, context_len=32768
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0421 09:34:39.682588  4671 transfer_engine.cpp:86] Transfer Engine uses address 30.246.219.248 and port 16519 for serving local TCP service
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0421 09:34:39.685037  4670 transfer_engine.cpp:86] Transfer Engine uses address 30.246.219.248 and port 15696 for serving local TCP service
I0421 09:34:39.688733  4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_5/
I0421 09:34:39.689913  4670 rdma_context.cpp:125] RDMA device: mlx5_bond_5, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:2f
I0421 09:34:39.693037  4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_6/
I0421 09:34:39.694192  4670 rdma_context.cpp:125] RDMA device: mlx5_bond_6, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:5e
I0421 09:34:39.697597  4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_7/
I0421 09:34:39.698680  4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_5/
I0421 09:34:39.698740  4670 rdma_context.cpp:125] RDMA device: mlx5_bond_7, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:be
I0421 09:34:39.699321  4671 rdma_context.cpp:125] RDMA device: mlx5_bond_5, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:2f
I0421 09:34:39.701891  4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_8/
I0421 09:34:39.702389  4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_6/
I0421 09:34:39.703015  4671 rdma_context.cpp:125] RDMA device: mlx5_bond_6, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:5e
I0421 09:34:39.703029  4670 rdma_context.cpp:125] RDMA device: mlx5_bond_8, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:f8
I0421 09:34:39.706074  4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_7/
I0421 09:34:39.706264  4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_0/
I0421 09:34:39.706709  4671 rdma_context.cpp:125] RDMA device: mlx5_bond_7, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:be
I0421 09:34:39.707089  4670 rdma_context.cpp:125] RDMA device: mlx5_bond_0, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:f2:9b
I0421 09:34:39.710026  4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_8/
I0421 09:34:39.710624  4671 rdma_context.cpp:125] RDMA device: mlx5_bond_8, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:f8
I0421 09:34:39.711242  4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_1/
I0421 09:34:39.712035  4670 rdma_context.cpp:125] RDMA device: mlx5_bond_1, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:0c
I0421 09:34:39.713668  4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_0/
I0421 09:34:39.714257  4671 rdma_context.cpp:125] RDMA device: mlx5_bond_0, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:f2:9b
I0421 09:34:39.716200  4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_2/
I0421 09:34:39.717345  4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_1/
I0421 09:34:39.717381  4670 rdma_context.cpp:125] RDMA device: mlx5_bond_2, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:74
I0421 09:34:39.717960  4671 rdma_context.cpp:125] RDMA device: mlx5_bond_1, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:0c
I0421 09:34:39.721074  4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_2/
I0421 09:34:39.721693  4671 rdma_context.cpp:125] RDMA device: mlx5_bond_2, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:74
I0421 09:34:39.721833  4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_3/
I0421 09:34:39.723008  4670 rdma_context.cpp:125] RDMA device: mlx5_bond_3, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:a6
I0421 09:34:39.724808  4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_3/
I0421 09:34:39.725432  4671 rdma_context.cpp:125] RDMA device: mlx5_bond_3, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:a6
I0421 09:34:39.727155  4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_4/
I0421 09:34:39.728328  4670 rdma_context.cpp:125] RDMA device: mlx5_bond_4, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:d6
I0421 09:34:39.728621  4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_4/
I0421 09:34:39.729239  4671 rdma_context.cpp:125] RDMA device: mlx5_bond_4, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:d6
E0421 09:34:41.202507  4670 rdma_context.cpp:198] Failed to register memory 0x7ff278000000: Bad address [14]
[2025-04-21 09:34:41 TP0] Mooncake memory registration failed.
[2025-04-21 09:34:41 TP0] Scheduler hit an exception: Traceback (most recent call last):
  File "/sgl-workspace/sglang/python/sglang/srt/managers/scheduler.py", line 1999, in run_scheduler_process
    scheduler = Scheduler(server_args, port_args, gpu_id, tp_rank, dp_rank)
  File "/sgl-workspace/sglang/python/sglang/srt/managers/scheduler.py", line 431, in __init__
    self.init_disaggregation()
  File "/sgl-workspace/sglang/python/sglang/srt/managers/scheduler.py", line 594, in init_disaggregation
    self.disagg_prefill_pending_queue = PrefillBootstrapQueue(
  File "/sgl-workspace/sglang/python/sglang/srt/disaggregation/prefill.py", line 77, in __init__
    self.kv_manager = self._init_kv_manager()
  File "/sgl-workspace/sglang/python/sglang/srt/disaggregation/prefill.py", line 111, in _init_kv_manager
    kv_manager = kv_manager_class(
  File "/sgl-workspace/sglang/python/sglang/srt/disaggregation/mooncake/conn.py", line 115, in __init__
    self.register_buffer_to_engine()
  File "/sgl-workspace/sglang/python/sglang/srt/disaggregation/mooncake/conn.py", line 133, in register_buffer_to_engine
    self.engine.register(kv_data_ptr, kv_data_len)
  File "/sgl-workspace/sglang/python/sglang/srt/disaggregation/mooncake/transfer_engine.py", line 36, in register
    raise RuntimeError("Mooncake memory registration failed.")
RuntimeError: Mooncake memory registration failed.
Originally created by @orrorcol on GitHub (Apr 21, 2025). Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/281 sglang and mooncake version: ``` mooncake-transfer-engine 0.3.0b5 sglang 0.4.5.post2 /sgl-workspace/sglang/python ``` my gpu environment is: ``` Mon Apr 21 17:33:33 2025 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 525.125.06 Driver Version: 525.125.06 CUDA Version: 12.0 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 NVIDIA A800-SXM... Off | 00000000:10:00.0 Off | 0 | | N/A 41C P0 65W / 400W | 3MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 1 NVIDIA A800-SXM... Off | 00000000:16:00.0 Off | 0 | | N/A 37C P0 61W / 400W | 3MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 2 NVIDIA A800-SXM... Off | 00000000:2A:00.0 Off | 0 | | N/A 37C P0 64W / 400W | 3MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 3 NVIDIA A800-SXM... Off | 00000000:2E:00.0 Off | 0 | | N/A 38C P0 63W / 400W | 3MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 4 NVIDIA A800-SXM... Off | 00000000:B7:00.0 Off | 0 | | N/A 38C P0 65W / 400W | 3MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 5 NVIDIA A800-SXM... Off | 00000000:BC:00.0 Off | 0 | | N/A 40C P0 66W / 400W | 3MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 6 NVIDIA A800-SXM... Off | 00000000:D0:00.0 Off | 0 | | N/A 37C P0 63W / 400W | 3MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 7 NVIDIA A800-SXM... Off | 00000000:D4:00.0 Off | 0 | | N/A 40C P0 65W / 400W | 3MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+ ``` prefill start command: ``` python3 -m sglang.launch_server --model-path /Qwen/Qwen2.5-7B-Instruct-GPTQ-Int4 --disaggregation-mode prefill --port 30000 --host ${ip} --tp-size 2 ``` and the error log is: ``` INFO 04-21 09:34:25 [__init__.py:239] Automatically detected platform cuda. KV cache is forced as chunk cache for decode server Overlap scheduler is disabled for prefill server [2025-04-21 09:34:28] server_args=ServerArgs(model_path='/Qwen/Qwen2.5-7B-Instruct-GPTQ-Int4', tokenizer_path='/Qwen/Qwen2.5-7B-Instruct-GPTQ-Int4', tokenizer_mode='auto', skip_tokenizer_init=False, enable_tokenizer_batch_encode=False, load_format='auto', trust_remote_code=False, dtype='auto', kv_cache_dtype='auto', quantization=None, quantization_param_path=None, context_length=None, device='cuda', served_model_name='/Qwen/Qwen2.5-7B-Instruct-GPTQ-Int4', chat_template=None, completion_template=None, is_embedding=False, revision=None, host='30.246.242.155', port=30000, mem_fraction_static=0.87, max_running_requests=None, max_total_tokens=None, chunked_prefill_size=8192, max_prefill_tokens=16384, schedule_policy='fcfs', schedule_conservativeness=1.0, cpu_offload_gb=0, page_size=1, tp_size=2, stream_interval=1, stream_output=False, random_seed=777934954, constrained_json_whitespace_pattern=None, watchdog_timeout=300, dist_timeout=None, download_dir=None, base_gpu_id=0, gpu_id_step=1, log_level='info', log_level_http=None, log_requests=False, log_requests_level=0, show_time_cost=False, enable_metrics=False, decode_log_interval=40, api_key=None, file_storage_path='sglang_storage', enable_cache_report=False, reasoning_parser=None, dp_size=1, load_balance_method='round_robin', ep_size=1, dist_init_addr=None, nnodes=1, node_rank=0, json_model_override_args='{}', lora_paths=None, max_loras_per_batch=8, lora_backend='triton', attention_backend=None, sampling_backend='flashinfer', grammar_backend='xgrammar', speculative_algorithm=None, speculative_draft_model_path=None, speculative_num_steps=None, speculative_eagle_topk=None, speculative_num_draft_tokens=None, speculative_accept_threshold_single=1.0, speculative_accept_threshold_acc=1.0, speculative_token_map=None, enable_double_sparsity=False, ds_channel_config_path=None, ds_heavy_channel_num=32, ds_heavy_token_num=256, ds_heavy_channel_type='qk', ds_sparse_decode_threshold=4096, disable_radix_cache=False, disable_cuda_graph=True, disable_cuda_graph_padding=False, enable_nccl_nvls=False, disable_outlines_disk_cache=False, disable_custom_all_reduce=False, enable_llama4_multimodal=None, disable_overlap_schedule=True, enable_mixed_chunk=False, enable_dp_attention=False, enable_ep_moe=False, enable_deepep_moe=False, deepep_mode='auto', enable_torch_compile=False, torch_compile_max_bs=32, cuda_graph_max_bs=160, cuda_graph_bs=None, torchao_config='', enable_nan_detection=False, enable_p2p_check=False, triton_attention_reduce_in_fp32=False, triton_attention_num_kv_splits=8, num_continuous_decode_steps=1, delete_ckpt_after_loading=False, enable_memory_saver=False, allow_auto_truncate=False, enable_custom_logit_processor=False, tool_call_parser=None, enable_hierarchical_cache=False, hicache_ratio=2.0, flashinfer_mla_disable_ragged=False, warmups=None, moe_dense_tp_size=None, n_share_experts_fusion=0, disable_chunked_prefix_cache=False, disable_fast_image_processor=False, debug_tensor_dump_output_folder=None, debug_tensor_dump_input_file=None, debug_tensor_dump_inject=False, disaggregation_mode='prefill', disaggregation_bootstrap_port=8998, disaggregation_transfer_backend='mooncake', disaggregation_ib_device=None) [2025-04-21 09:34:28] The model is convertible to gptq_marlin during runtime. Using gptq_marlin kernel. INFO 04-21 09:34:32 [__init__.py:239] Automatically detected platform cuda. INFO 04-21 09:34:32 [__init__.py:239] Automatically detected platform cuda. INFO 04-21 09:34:32 [__init__.py:239] Automatically detected platform cuda. [2025-04-21 09:34:34 TP1] The model is convertible to gptq_marlin during runtime. Using gptq_marlin kernel. [2025-04-21 09:34:34 TP0] The model is convertible to gptq_marlin during runtime. Using gptq_marlin kernel. [2025-04-21 09:34:35 TP1] The model is convertible to gptq_marlin during runtime. Using gptq_marlin kernel. [2025-04-21 09:34:35 TP1] Attention backend not set. Use flashinfer backend by default. [2025-04-21 09:34:35 TP1] Init torch distributed begin. [2025-04-21 09:34:35 TP0] The model is convertible to gptq_marlin during runtime. Using gptq_marlin kernel. [2025-04-21 09:34:35 TP0] Attention backend not set. Use flashinfer backend by default. [2025-04-21 09:34:35 TP0] Init torch distributed begin. [2025-04-21 09:34:35 TP0] sglang is using nccl==2.21.5 [2025-04-21 09:34:35 TP1] sglang is using nccl==2.21.5 [2025-04-21 09:34:35 TP0] Init torch distributed ends. mem usage=0.87 GB [2025-04-21 09:34:35 TP1] Init torch distributed ends. mem usage=0.87 GB [2025-04-21 09:34:35 TP0] Load weight begin. avail mem=78.05 GB [2025-04-21 09:34:35 TP1] Load weight begin. avail mem=78.05 GB INFO 04-21 09:34:36 [gptq_marlin.py:235] Using MarlinLinearKernel for GPTQMarlinLinearMethod INFO 04-21 09:34:36 [gptq_marlin.py:235] Using MarlinLinearKernel for GPTQMarlinLinearMethod Loading safetensors checkpoint shards: 0% Completed | 0/2 [00:00<?, ?it/s] Loading safetensors checkpoint shards: 50% Completed | 1/2 [00:00<00:00, 1.02it/s] Loading safetensors checkpoint shards: 100% Completed | 2/2 [00:01<00:00, 1.62it/s] Loading safetensors checkpoint shards: 100% Completed | 2/2 [00:01<00:00, 1.49it/s] [2025-04-21 09:34:38 TP1] Load weight end. type=Qwen2ForCausalLM, dtype=torch.float16, avail mem=75.35 GB, mem usage=2.70 GB. [2025-04-21 09:34:38 TP0] Load weight end. type=Qwen2ForCausalLM, dtype=torch.float16, avail mem=75.35 GB, mem usage=2.70 GB. [2025-04-21 09:34:38 TP0] KV Cache is allocated. #tokens: 2440407, K size: 32.58 GB, V size: 32.58 GB [2025-04-21 09:34:38 TP1] KV Cache is allocated. #tokens: 2440407, K size: 32.58 GB, V size: 32.58 GB [2025-04-21 09:34:38 TP0] Memory pool end. avail mem=9.64 GB [2025-04-21 09:34:38 TP1] Memory pool end. avail mem=9.64 GB [2025-04-21 09:34:38 TP0] CUDA Graph is DISABLED. This will cause significant performance degradation. CUDA Graph should almost never be disabled in most usage scenarios. If you encounter OOM issues, please try setting --mem-fraction-static to a lower value (such as 0.8 or 0.7) instead of disabling CUDA Graph. [2025-04-21 09:34:38 TP1] CUDA Graph is DISABLED. This will cause significant performance degradation. CUDA Graph should almost never be disabled in most usage scenarios. If you encounter OOM issues, please try setting --mem-fraction-static to a lower value (such as 0.8 or 0.7) instead of disabling CUDA Graph. [2025-04-21 09:34:39 TP1] max_total_num_tokens=2440407, chunked_prefill_size=8192, max_prefill_tokens=16384, max_running_requests=4097, context_len=32768 [2025-04-21 09:34:39 TP0] max_total_num_tokens=2440407, chunked_prefill_size=8192, max_prefill_tokens=16384, max_running_requests=4097, context_len=32768 WARNING: Logging before InitGoogleLogging() is written to STDERR I0421 09:34:39.682588 4671 transfer_engine.cpp:86] Transfer Engine uses address 30.246.219.248 and port 16519 for serving local TCP service WARNING: Logging before InitGoogleLogging() is written to STDERR I0421 09:34:39.685037 4670 transfer_engine.cpp:86] Transfer Engine uses address 30.246.219.248 and port 15696 for serving local TCP service I0421 09:34:39.688733 4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_5/ I0421 09:34:39.689913 4670 rdma_context.cpp:125] RDMA device: mlx5_bond_5, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:2f I0421 09:34:39.693037 4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_6/ I0421 09:34:39.694192 4670 rdma_context.cpp:125] RDMA device: mlx5_bond_6, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:5e I0421 09:34:39.697597 4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_7/ I0421 09:34:39.698680 4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_5/ I0421 09:34:39.698740 4670 rdma_context.cpp:125] RDMA device: mlx5_bond_7, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:be I0421 09:34:39.699321 4671 rdma_context.cpp:125] RDMA device: mlx5_bond_5, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:2f I0421 09:34:39.701891 4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_8/ I0421 09:34:39.702389 4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_6/ I0421 09:34:39.703015 4671 rdma_context.cpp:125] RDMA device: mlx5_bond_6, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:5e I0421 09:34:39.703029 4670 rdma_context.cpp:125] RDMA device: mlx5_bond_8, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:f8 I0421 09:34:39.706074 4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_7/ I0421 09:34:39.706264 4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_0/ I0421 09:34:39.706709 4671 rdma_context.cpp:125] RDMA device: mlx5_bond_7, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:be I0421 09:34:39.707089 4670 rdma_context.cpp:125] RDMA device: mlx5_bond_0, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:f2:9b I0421 09:34:39.710026 4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_8/ I0421 09:34:39.710624 4671 rdma_context.cpp:125] RDMA device: mlx5_bond_8, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:db:f8 I0421 09:34:39.711242 4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_1/ I0421 09:34:39.712035 4670 rdma_context.cpp:125] RDMA device: mlx5_bond_1, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:0c I0421 09:34:39.713668 4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_0/ I0421 09:34:39.714257 4671 rdma_context.cpp:125] RDMA device: mlx5_bond_0, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:f2:9b I0421 09:34:39.716200 4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_2/ I0421 09:34:39.717345 4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_1/ I0421 09:34:39.717381 4670 rdma_context.cpp:125] RDMA device: mlx5_bond_2, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:74 I0421 09:34:39.717960 4671 rdma_context.cpp:125] RDMA device: mlx5_bond_1, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:0c I0421 09:34:39.721074 4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_2/ I0421 09:34:39.721693 4671 rdma_context.cpp:125] RDMA device: mlx5_bond_2, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:74 I0421 09:34:39.721833 4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_3/ I0421 09:34:39.723008 4670 rdma_context.cpp:125] RDMA device: mlx5_bond_3, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:a6 I0421 09:34:39.724808 4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_3/ I0421 09:34:39.725432 4671 rdma_context.cpp:125] RDMA device: mlx5_bond_3, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:a6 I0421 09:34:39.727155 4670 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_4/ I0421 09:34:39.728328 4670 rdma_context.cpp:125] RDMA device: mlx5_bond_4, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:d6 I0421 09:34:39.728621 4671 rdma_context.cpp:413] Find best gid index: 3 on mlx5_bond_4/ I0421 09:34:39.729239 4671 rdma_context.cpp:125] RDMA device: mlx5_bond_4, LID: 0, GID: (GID_Index 3) 00:00:00:00:00:00:00:00:00:00:ff:ff:1e:f6:da:d6 E0421 09:34:41.202507 4670 rdma_context.cpp:198] Failed to register memory 0x7ff278000000: Bad address [14] [2025-04-21 09:34:41 TP0] Mooncake memory registration failed. [2025-04-21 09:34:41 TP0] Scheduler hit an exception: Traceback (most recent call last): File "/sgl-workspace/sglang/python/sglang/srt/managers/scheduler.py", line 1999, in run_scheduler_process scheduler = Scheduler(server_args, port_args, gpu_id, tp_rank, dp_rank) File "/sgl-workspace/sglang/python/sglang/srt/managers/scheduler.py", line 431, in __init__ self.init_disaggregation() File "/sgl-workspace/sglang/python/sglang/srt/managers/scheduler.py", line 594, in init_disaggregation self.disagg_prefill_pending_queue = PrefillBootstrapQueue( File "/sgl-workspace/sglang/python/sglang/srt/disaggregation/prefill.py", line 77, in __init__ self.kv_manager = self._init_kv_manager() File "/sgl-workspace/sglang/python/sglang/srt/disaggregation/prefill.py", line 111, in _init_kv_manager kv_manager = kv_manager_class( File "/sgl-workspace/sglang/python/sglang/srt/disaggregation/mooncake/conn.py", line 115, in __init__ self.register_buffer_to_engine() File "/sgl-workspace/sglang/python/sglang/srt/disaggregation/mooncake/conn.py", line 133, in register_buffer_to_engine self.engine.register(kv_data_ptr, kv_data_len) File "/sgl-workspace/sglang/python/sglang/srt/disaggregation/mooncake/transfer_engine.py", line 36, in register raise RuntimeError("Mooncake memory registration failed.") RuntimeError: Mooncake memory registration failed. ```
bsakaguchi 2026-10-29 21:09:31 +00:00
Author
Owner

@RockGo commented on GitHub (Apr 22, 2025):

same problem

<!-- gh-comment-id:2819894276 --> @RockGo commented on GitHub (Apr 22, 2025): same problem
Author
Owner

@alogfans commented on GitHub (Apr 22, 2025):

In some environments, the RDMA driver requires root privillege to set up memory region.

<!-- gh-comment-id:2820533270 --> @alogfans commented on GitHub (Apr 22, 2025): In some environments, the RDMA driver requires root privillege to set up memory region.
Author
Owner

@weibingo commented on GitHub (Apr 29, 2025):

run transfer_engine_bench also this problem

transfer_engine_bench --mode=target
--metadata_server=http://10.112.x.x:8080/metadata
--local_server_name=10.112.x.5:3654
--protocol=rdma
--operation=write
--auto_discovery

target能正常启起来。
然后启动init就会报错
transfer_engine_bench
--metadata_server=http://10.112.x.x:8080/metadata
--segment_id=10.112.x.5:3654
--local_server_name=10.112.x.4:3655
--protocol=rdma
--operation=write
--auto_discovery

报错信息:
I0429 08:04:34.819869 1834 rdma_context.cpp:125] RDMA device: mlx5_0, LID: 17, GID: (GID_Index 0) fe:80:00:00:00:00:00:00:94:6d:ae:03:00:96:59:5a
I0429 08:04:34.823685 1834 rdma_context.cpp:426] Find best gid index: 0 on mlx5_1/
I0429 08:04:34.824589 1834 rdma_context.cpp:125] RDMA device: mlx5_1, LID: 23, GID: (GID_Index 0) fe:80:00:00:00:00:00:00:94:6d:ae:03:00:96:6c:72
I0429 08:04:34.828298 1834 rdma_context.cpp:426] Find best gid index: 0 on mlx5_2/
I0429 08:04:34.829383 1834 rdma_context.cpp:125] RDMA device: mlx5_2, LID: 3, GID: (GID_Index 0) fe:80:00:00:00:00:00:00:94:6d:ae:03:00:96:6d:06
I0429 08:04:34.833137 1834 rdma_context.cpp:426] Find best gid index: 0 on mlx5_3/
I0429 08:04:34.834007 1834 rdma_context.cpp:125] RDMA device: mlx5_3, LID: 16, GID: (GID_Index 0) fe:80:00:00:00:00:00:00:94:6d:ae:03:00:96:58:56
I0429 08:04:34.834899 1834 transfer_engine_bench.cpp:299] VRAM is used
E0429 08:04:35.036568 1834 rdma_context.cpp:201] Failed to register memory 0x7fe520000000: Bad address [14]
F0429 08:04:35.036597 1834 transfer_engine_bench.cpp:305] Assert failed: !rc

添加参数--use_vram=0,则可以,但此参数是在cpu上申请的地址,想测试不同节点间gpu通信速度。为何在gpu上registerLocalMemory就失败呢

<!-- gh-comment-id:2837851801 --> @weibingo commented on GitHub (Apr 29, 2025): run transfer_engine_bench also this problem transfer_engine_bench --mode=target \ --metadata_server=http://10.112.x.x:8080/metadata \ --local_server_name=10.112.x.5:3654 \ --protocol=rdma \ --operation=write \ --auto_discovery target能正常启起来。 然后启动init就会报错 transfer_engine_bench \ --metadata_server=http://10.112.x.x:8080/metadata \ --segment_id=10.112.x.5:3654 \ --local_server_name=10.112.x.4:3655 \ --protocol=rdma \ --operation=write \ --auto_discovery 报错信息: I0429 08:04:34.819869 1834 rdma_context.cpp:125] RDMA device: mlx5_0, LID: 17, GID: (GID_Index 0) fe:80:00:00:00:00:00:00:94:6d:ae:03:00:96:59:5a I0429 08:04:34.823685 1834 rdma_context.cpp:426] Find best gid index: 0 on mlx5_1/ I0429 08:04:34.824589 1834 rdma_context.cpp:125] RDMA device: mlx5_1, LID: 23, GID: (GID_Index 0) fe:80:00:00:00:00:00:00:94:6d:ae:03:00:96:6c:72 I0429 08:04:34.828298 1834 rdma_context.cpp:426] Find best gid index: 0 on mlx5_2/ I0429 08:04:34.829383 1834 rdma_context.cpp:125] RDMA device: mlx5_2, LID: 3, GID: (GID_Index 0) fe:80:00:00:00:00:00:00:94:6d:ae:03:00:96:6d:06 I0429 08:04:34.833137 1834 rdma_context.cpp:426] Find best gid index: 0 on mlx5_3/ I0429 08:04:34.834007 1834 rdma_context.cpp:125] RDMA device: mlx5_3, LID: 16, GID: (GID_Index 0) fe:80:00:00:00:00:00:00:94:6d:ae:03:00:96:58:56 I0429 08:04:34.834899 1834 transfer_engine_bench.cpp:299] VRAM is used E0429 08:04:35.036568 1834 rdma_context.cpp:201] Failed to register memory 0x7fe520000000: Bad address [14] F0429 08:04:35.036597 1834 transfer_engine_bench.cpp:305] Assert failed: !rc 添加参数--use_vram=0,则可以,但此参数是在cpu上申请的地址,想测试不同节点间gpu通信速度。为何在gpu上registerLocalMemory就失败呢
Author
Owner

@stmatengss commented on GitHub (May 1, 2025):

Before running benchmark, please check GDR is support or not. Could you please provide the hardware confifurations?

<!-- gh-comment-id:2844592065 --> @stmatengss commented on GitHub (May 1, 2025): Before running benchmark, please check GDR is support or not. Could you please provide the hardware confifurations?
Author
Owner

@weibingo commented on GitHub (May 6, 2025):

Before running benchmark, please check GDR is support or not. Could you please provide the hardware confifurations?

nvidia-smi
Tue May 6 02:47:34 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 560.35.03 Driver Version: 560.35.03 CUDA Version: 12.6 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA H800 On | 00000000:19:00.0 Off | 0 |
| N/A 35C P0 84W / 700W | 1MiB / 81559MiB | 0% Default |
| | | Disabled |
+-----------------------------------------+------------------------+----------------------+
| 1 NVIDIA H800 On | 00000000:3A:00.0 Off | 0 |
| N/A 39C P0 82W / 700W | 1MiB / 81559MiB | 0% Default |
| | | Disabled |
+-----------------------------------------+------------------------+----------------------+
| 2 NVIDIA H800 On | 00000000:4C:00.0 Off | 0 |
| N/A 41C P0 89W / 700W | 1MiB / 81559MiB | 0% Default |
| | | Disabled |
+-----------------------------------------+------------------------+----------------------+
| 3 NVIDIA H800 On | 00000000:5C:00.0 Off | 0 |
| N/A 38C P0 84W / 700W | 1MiB / 81559MiB | 0% Default |
| | | Disabled |
+-----------------------------------------+------------------------+----------------------+
| 4 NVIDIA H800 On | 00000000:9A:00.0 Off | 0 |
| N/A 41C P0 90W / 700W | 1MiB / 81559MiB | 0% Default |
| | | Disabled |
+-----------------------------------------+------------------------+----------------------+
| 5 NVIDIA H800 On | 00000000:BA:00.0 Off | 0 |
| N/A 36C P0 85W / 700W | 1MiB / 81559MiB | 0% Default |
| | | Disabled |
+-----------------------------------------+------------------------+----------------------+
| 6 NVIDIA H800 On | 00000000:CA:00.0 Off | 0 |
| N/A 37C P0 83W / 700W | 1MiB / 81559MiB | 0% Default |
| | | Disabled |
+-----------------------------------------+------------------------+----------------------+
| 7 NVIDIA H800 On | 00000000:DA:00.0 Off | 0 |
| N/A 40C P0 87W / 700W | 1MiB / 81559MiB | 0% Default |
| | | Disabled |
+-----------------------------------------+------------------------+----------------------+

<!-- gh-comment-id:2853128058 --> @weibingo commented on GitHub (May 6, 2025): > Before running benchmark, please check GDR is support or not. Could you please provide the hardware confifurations? nvidia-smi Tue May 6 02:47:34 2025 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 560.35.03 Driver Version: 560.35.03 CUDA Version: 12.6 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA H800 On | 00000000:19:00.0 Off | 0 | | N/A 35C P0 84W / 700W | 1MiB / 81559MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ | 1 NVIDIA H800 On | 00000000:3A:00.0 Off | 0 | | N/A 39C P0 82W / 700W | 1MiB / 81559MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ | 2 NVIDIA H800 On | 00000000:4C:00.0 Off | 0 | | N/A 41C P0 89W / 700W | 1MiB / 81559MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ | 3 NVIDIA H800 On | 00000000:5C:00.0 Off | 0 | | N/A 38C P0 84W / 700W | 1MiB / 81559MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ | 4 NVIDIA H800 On | 00000000:9A:00.0 Off | 0 | | N/A 41C P0 90W / 700W | 1MiB / 81559MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ | 5 NVIDIA H800 On | 00000000:BA:00.0 Off | 0 | | N/A 36C P0 85W / 700W | 1MiB / 81559MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ | 6 NVIDIA H800 On | 00000000:CA:00.0 Off | 0 | | N/A 37C P0 83W / 700W | 1MiB / 81559MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ | 7 NVIDIA H800 On | 00000000:DA:00.0 Off | 0 | | N/A 40C P0 87W / 700W | 1MiB / 81559MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+
Author
Owner

@doujiang24 commented on GitHub (May 6, 2025):

@weibingo could you please provide the result of the command: lsmod | grep nv.

<!-- gh-comment-id:2853359233 --> @doujiang24 commented on GitHub (May 6, 2025): @weibingo could you please provide the result of the command: `lsmod | grep nv`.
Author
Owner

@bliu3650 commented on GitHub (May 6, 2025):

@weibingo could you please provide the result of the command: lsmod | grep nv.

@doujiang24 same problem as mine.

Here is my hardware info: (Driver Version: 535.183.06 CUDA Version: 12.6)
Image

and output of lsmod | grep nv:
Image

This kind of "failed to register address" error can also be reproduced by NIXL with UCX backend with test/python/nixl_api_test.py simply by changing host memory to cuda memory at line 40:
Image
ib_md.c:282 UCX ERROR ibv_reg_mr(address=0xa02000000, length=2097152, access=0xf) failed: Bad address
ucp_mm.c:76 UCX ERROR failed to register address 0xa02000000 (cuda) length 2097152 on md[7]=mlx5_bond_0: Input/output error (md supports: host|cuda)

So I guess this might be related to RDMA driver setting or other kernel module dependency? Could you help me out? Thanks.

<!-- gh-comment-id:2854227407 --> @bliu3650 commented on GitHub (May 6, 2025): > [@weibingo](https://github.com/weibingo) could you please provide the result of the command: `lsmod | grep nv`. @doujiang24 same problem as mine. Here is my hardware info: (Driver Version: 535.183.06 CUDA Version: 12.6) ![Image](https://github.com/user-attachments/assets/9fe9b7ce-39e3-4fbc-b028-9c97e890909e) and output of lsmod | grep nv: ![Image](https://github.com/user-attachments/assets/c39c0bb9-5360-4134-9a91-d52df46bf333) This kind of "failed to register address" error can also be reproduced by NIXL with UCX backend with [test/python/nixl_api_test.py](https://github.com/ai-dynamo/nixl/blob/0.1.0/test/python/nixl_api_test.py) simply by changing host memory to cuda memory at line 40: ![Image](https://github.com/user-attachments/assets/1b1ba2a7-e5dc-4718-9b87-82eba7419151) ib_md.c:282 UCX ERROR ibv_reg_mr(address=0xa02000000, length=2097152, access=0xf) failed: Bad address ucp_mm.c:76 UCX ERROR failed to register address 0xa02000000 (cuda) length 2097152 on md[7]=mlx5_bond_0: Input/output error (md supports: host|cuda) So I guess this might be related to RDMA driver setting or other kernel module dependency? Could you help me out? Thanks.
Author
Owner

@doujiang24 commented on GitHub (May 7, 2025):

lsmod | grep nv looks good to me. @bliu3650 please contact me via wechat(id: doujiang24) if it's convenient for you.

<!-- gh-comment-id:2859140059 --> @doujiang24 commented on GitHub (May 7, 2025): `lsmod | grep nv` looks good to me. @bliu3650 please contact me via wechat(id: doujiang24) if it's convenient for you.
Author
Owner

@bliu3650 commented on GitHub (May 9, 2025):

More debugging with small test case, I found an interesting difference between my system environment with yours.

  1. Keep the default setting to run sglang v0.4.6 with mooncake, the pointer to KV gpu buffer which allocated by torch automatically starts with "0x2cbxxx" instread of "0x7fxxxx". Then the memory registeration failed with "Bad address".

  2. Under my system environment, I create a small test to debug this "ibv_reg_mr" issue, but alloate the gpu memory using cuMemAlloc manually. As expected, the pointer to this gpu memory starts with "0x7fxxxx", and the memory registeration by ibv_reg_mr successed, except some other permission issue (ignored...).

Could anyone kindly help explain what might caused these different behaviors? Espeically why I got "0x2cbxxx" pointer from torch. Appreciated.

<!-- gh-comment-id:2866273030 --> @bliu3650 commented on GitHub (May 9, 2025): More debugging with small test case, I found an interesting difference between my system environment with yours. 1. Keep the default setting to run sglang v0.4.6 with mooncake, the pointer to KV gpu buffer which allocated by torch automatically starts with "**0x2cbxxx**" instread of "**0x7fxxxx**". Then the memory registeration failed with "Bad address". 2. Under my system environment, I create a small test to debug this "ibv_reg_mr" issue, but alloate the gpu memory using cuMemAlloc manually. As expected, the pointer to this gpu memory starts with "**0x7fxxxx**", and the memory registeration by ibv_reg_mr successed, except some other permission issue (ignored...). Could anyone kindly help explain what might caused these different behaviors? Espeically why I got "**0x2cbxxx**" pointer from torch. Appreciated.
Author
Owner

@bliu3650 commented on GitHub (May 11, 2025):

To someone who might hit similiar issue,

After replaced the default torch memory allocator with external one, all the KV buffers are now allocated with the address beginning with "0x7fxxx" which can then be successfully registered to RDMA memory region.

import torch

ext_alloc = torch.cuda.memory.CUDAPluggableAllocator(
    "<path-to-your-ext_allocator.so>",
    "ext_cu_malloc",
    "ext_cu_free"
)

torch.cuda.memory.change_current_allocator(ext_alloc)

Reference:
https://kshitij12345.github.io/python,/pytorch/2023/02/26/External-CUDA-Allocator-With-PyTorch.html

Known issues and walkaround:

  1. RuntimeError: Can't swap an already initialized allocator
    -> walkaround: put this replacement at the begining of your applicaton
  2. RuntimeError: CUDAPluggableAllocator does not yet support getDeviceStats
    -> walkaround: remove any calling to torch.cuda.max_memory_allocated()
<!-- gh-comment-id:2869622467 --> @bliu3650 commented on GitHub (May 11, 2025): To someone who might hit similiar issue, After replaced the default torch memory allocator with external one, all the KV buffers are now allocated with the address beginning with "0x7fxxx" which can then be successfully registered to RDMA memory region. ``` import torch ext_alloc = torch.cuda.memory.CUDAPluggableAllocator( "<path-to-your-ext_allocator.so>", "ext_cu_malloc", "ext_cu_free" ) torch.cuda.memory.change_current_allocator(ext_alloc) ``` Reference: https://kshitij12345.github.io/python,/pytorch/2023/02/26/External-CUDA-Allocator-With-PyTorch.html Known issues and walkaround: 1. RuntimeError: Can't swap an already initialized allocator -> walkaround: put this replacement at the begining of your applicaton 2. RuntimeError: CUDAPluggableAllocator does not yet support getDeviceStats -> walkaround: remove any calling to torch.cuda.max_memory_allocated()
Author
Owner

@CSEEduanyu commented on GitHub (May 11, 2025):

To someone who might hit similiar issue,

After replaced the default torch memory allocator with external one, all the KV buffers are now allocated with the address beginning with "0x7fxxx" which can then be successfully registered to RDMA memory region.

import torch

ext_alloc = torch.cuda.memory.CUDAPluggableAllocator(
    "<path-to-your-ext_allocator.so>",
    "ext_cu_malloc",
    "ext_cu_free"
)

torch.cuda.memory.change_current_allocator(ext_alloc)

Reference: https://kshitij12345.github.io/python,/pytorch/2023/02/26/External-CUDA-Allocator-With-PyTorch.html

Known issues and walkaround:

  1. RuntimeError: Can't swap an already initialized allocator
    -> walkaround: put this replacement at the begining of your applicaton
  2. RuntimeError: CUDAPluggableAllocator does not yet support getDeviceStats
    -> walkaround: remove any calling to torch.cuda.max_memory_allocated()

Thank you for your reply. I would like to know what exactly is the reason that we need to perform these additional steps?

<!-- gh-comment-id:2869624204 --> @CSEEduanyu commented on GitHub (May 11, 2025): > To someone who might hit similiar issue, > > After replaced the default torch memory allocator with external one, all the KV buffers are now allocated with the address beginning with "0x7fxxx" which can then be successfully registered to RDMA memory region. > > ``` > import torch > > ext_alloc = torch.cuda.memory.CUDAPluggableAllocator( > "<path-to-your-ext_allocator.so>", > "ext_cu_malloc", > "ext_cu_free" > ) > > torch.cuda.memory.change_current_allocator(ext_alloc) > ``` > > Reference: https://kshitij12345.github.io/python,/pytorch/2023/02/26/External-CUDA-Allocator-With-PyTorch.html > > Known issues and walkaround: > > 1. RuntimeError: Can't swap an already initialized allocator > -> walkaround: put this replacement at the begining of your applicaton > 2. RuntimeError: CUDAPluggableAllocator does not yet support getDeviceStats > -> walkaround: remove any calling to torch.cuda.max_memory_allocated() Thank you for your reply. I would like to know what exactly is the reason that we need to perform these additional steps?
Author
Owner

@CSEEduanyu commented on GitHub (May 11, 2025):

What do these two different addresses represent? So is this actually a problem with the torch environment? @bliu3650

<!-- gh-comment-id:2869626359 --> @CSEEduanyu commented on GitHub (May 11, 2025): What do these two different addresses represent? So is this actually a problem with the torch environment? @bliu3650
Author
Owner

@bliu3650 commented on GitHub (May 12, 2025):

What do these two different addresses represent? So is this actually a problem with the torch environment? @bliu3650

@CSEEduanyu Hi, these two addresses are both pointing to KV buffers. One is allocated by torch automatcially, another one is allocated by my external allocator. I just walkarouded to setup the entire sglang/pd flow, which was blocked by the torch mem allocator(and then memory register to RDMA) on my infra environment. There should be a problem about our hardware setting, but not the official torch, since many others in the community not report this kind of issue so far.

I'm very curious about the gpu memory address allocated by torch default behaviour (under different environment). I did not know why the address starts with 0x2cxx failed but 0x7fxx successed in this case.

<!-- gh-comment-id:2870709421 --> @bliu3650 commented on GitHub (May 12, 2025): > What do these two different addresses represent? So is this actually a problem with the torch environment? [@bliu3650](https://github.com/bliu3650) @CSEEduanyu Hi, these two addresses are both pointing to KV buffers. One is allocated by torch automatcially, another one is allocated by my external allocator. I just walkarouded to setup the entire sglang/pd flow, which was blocked by the torch mem allocator(and then memory register to RDMA) on my infra environment. There should be a problem about our hardware setting, but not the official torch, since many others in the community not report this kind of issue so far. I'm very curious about the gpu memory address allocated by torch default behaviour (under different environment). I did not know why the address starts with 0x2cxx failed but 0x7fxx successed in this case.
Author
Owner

@CSEEduanyu commented on GitHub (May 12, 2025):

What do these two different addresses represent? So is this actually a problem with the torch environment? @bliu3650

@CSEEduanyu Hi, these two addresses are both pointing to KV buffers. One is allocated by torch automatcially, another one is allocated by my external allocator. I just walkarouded to setup the entire sglang/pd flow, which was blocked by the torch mem allocator(and then memory register to RDMA) on my infra environment. There should be a problem about our hardware setting, but not the official torch, since many others in the community not report this kind of issue so far.

I'm very curious about the gpu memory address allocated by torch default behaviour (under different environment). I did know why the address starts with 0x2xxx failed but 0x2fxx successed in this case.

Thank you for your response. Could you please provide your allocator.so library? I'd like to try and see if it can resolve the issue. @bliu3650

<!-- gh-comment-id:2870720082 --> @CSEEduanyu commented on GitHub (May 12, 2025): > > What do these two different addresses represent? So is this actually a problem with the torch environment? [@bliu3650](https://github.com/bliu3650) > > [@CSEEduanyu](https://github.com/CSEEduanyu) Hi, these two addresses are both pointing to KV buffers. One is allocated by torch automatcially, another one is allocated by my external allocator. I just walkarouded to setup the entire sglang/pd flow, which was blocked by the torch mem allocator(and then memory register to RDMA) on my infra environment. There should be a problem about our hardware setting, but not the official torch, since many others in the community not report this kind of issue so far. > > I'm very curious about the gpu memory address allocated by torch default behaviour (under different environment). I did know why the address starts with 0x2xxx failed but 0x2fxx successed in this case. Thank you for your response. Could you please provide your allocator.so library? I'd like to try and see if it can resolve the issue. @bliu3650
Author
Owner

@bliu3650 commented on GitHub (May 12, 2025):

The creation of the external allocator is just the same as the one in this reference.

<!-- gh-comment-id:2870775577 --> @bliu3650 commented on GitHub (May 12, 2025): The creation of the external allocator is just the same as the one in this [reference](https://kshitij12345.github.io/python,/pytorch/2023/02/26/External-CUDA-Allocator-With-PyTorch.html).
Author
Owner

@CSEEduanyu commented on GitHub (May 12, 2025):

The creation of the external allocator is just the same as the one in this reference.

Great, this really works

<!-- gh-comment-id:2870967243 --> @CSEEduanyu commented on GitHub (May 12, 2025): > The creation of the external allocator is just the same as the one in this [reference](https://kshitij12345.github.io/python,/pytorch/2023/02/26/External-CUDA-Allocator-With-PyTorch.html). Great, this really works
Author
Owner

@CSEEduanyu commented on GitHub (May 15, 2025):

The creation of the external allocator is just the same as the one in this reference.

This method indeed no longer throws an error, but I found that it causes a significant performance drop @bliu3650

<!-- gh-comment-id:2883019203 --> @CSEEduanyu commented on GitHub (May 15, 2025): > The creation of the external allocator is just the same as the one in this [reference](https://kshitij12345.github.io/python,/pytorch/2023/02/26/External-CUDA-Allocator-With-PyTorch.html). This method indeed no longer throws an error, but I found that it causes a significant performance drop @bliu3650
Author
Owner

@CSEEduanyu commented on GitHub (May 15, 2025):

@RockGo @orrorcol Have you completely resolved this issue?

<!-- gh-comment-id:2883833061 --> @CSEEduanyu commented on GitHub (May 15, 2025): @RockGo @orrorcol Have you completely resolved this issue?
Author
Owner

@CSEEduanyu commented on GitHub (May 16, 2025):

I found that the root cause of this problem is that the kv_cache address allocated by native torch.zero() is different from the kv_cache address allocated by cuda_malloc(). The former will cause an error of bad address when calling ibv_reg_mr(), while the latter will not, but it will cause sglang's throughput to decrease. @doujiang24 @ShangmingCai I contacted SRE, but it seems they don't have much information either. Could you please advise me on how to troubleshoot this issue?

<!-- gh-comment-id:2885796331 --> @CSEEduanyu commented on GitHub (May 16, 2025): I found that the root cause of this problem is that the kv_cache address allocated by native torch.zero() is different from the kv_cache address allocated by cuda_malloc(). The former will cause an error of bad address when calling ibv_reg_mr(), while the latter will not, but it will cause sglang's throughput to decrease. @doujiang24 @ShangmingCai I contacted SRE, but it seems they don't have much information either. Could you please advise me on how to troubleshoot this issue?
Author
Owner

@ShangmingCai commented on GitHub (May 16, 2025):

I found that the root cause of this problem is that the kv_cache address allocated by native torch.zero() is different from the kv_cache address allocated by cuda_malloc(). The former will cause an error of bad address when calling ibv_reg_mr(), while the latter will not, but it will cause sglang's throughput to decrease. @doujiang24 @ShangmingCai I contacted SRE, but it seems they don't have much information either. Could you please advise me on how to troubleshoot this issue?

@CSEEduanyu We don't allocate GPU mem buffer in the mooncake layer, we merely register it. The allocation is done by sglang, maybe you could report this to the sglang repo to see if there are some parameters or env vars that you could use for this scenario.

<!-- gh-comment-id:2885816233 --> @ShangmingCai commented on GitHub (May 16, 2025): > I found that the root cause of this problem is that the kv_cache address allocated by native torch.zero() is different from the kv_cache address allocated by cuda_malloc(). The former will cause an error of bad address when calling ibv_reg_mr(), while the latter will not, but it will cause sglang's throughput to decrease. [@doujiang24](https://github.com/doujiang24) [@ShangmingCai](https://github.com/ShangmingCai) I contacted SRE, but it seems they don't have much information either. Could you please advise me on how to troubleshoot this issue? @CSEEduanyu We don't allocate GPU mem buffer in the mooncake layer, we merely register it. The allocation is done by sglang, maybe you could report this to the sglang repo to see if there are some parameters or env vars that you could use for this scenario.
Author
Owner

@ShangmingCai commented on GitHub (May 16, 2025):

@CSEEduanyu It maybe also be related to the machines' setup (please check this with your SRE), one of the machines does not properly set up the GDR env, so the torch will use another impl to allocate the buffer.

<!-- gh-comment-id:2885820618 --> @ShangmingCai commented on GitHub (May 16, 2025): @CSEEduanyu It maybe also be related to the machines' setup (please check this with your SRE), one of the machines does not properly set up the GDR env, so the torch will use another impl to allocate the buffer.
Author
Owner

@github-actions[bot] commented on GitHub (Jul 14, 2026):

This issue has had no activity for 90 days and will be closed in 7 days if there is no further activity. Please comment or react if it should stay open.

<!-- gh-comment-id:4965315742 --> @github-actions[bot] commented on GitHub (Jul 14, 2026): This issue has had no activity for 90 days and will be closed in 7 days if there is no further activity. Please comment or react if it should stay open.
Author
Owner

@github-actions[bot] commented on GitHub (Jul 21, 2026):

Closing due to 3 months of inactivity. If this is still relevant, please comment and we can reopen.

<!-- gh-comment-id:5030321941 --> @github-actions[bot] commented on GitHub (Jul 21, 2026): Closing due to 3 months of inactivity. If this is still relevant, please comment and we can reopen.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#114
No description provided.