disagg_dp_attn.sh 1.45 KB
Newer Older
1
2
3
4
5
6
7
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# Setup cleanup trap
cleanup() {
    echo "Cleaning up background processes..."
8
9
    kill $DYNAMO_PID $PREFILL_PID 2>/dev/null || true
    wait $DYNAMO_PID $PREFILL_PID 2>/dev/null || true
10
11
12
13
14
15
    echo "Cleanup complete."
}
trap cleanup EXIT INT TERM


# run ingress
16
python3 -m dynamo.frontend --http-port=8000 &
17
18
DYNAMO_PID=$!

19
20
21
22
# Set the expert distribution recording directory
mkdir -p /tmp/sglang_expert_distribution_record
export SGLANG_EXPERT_DISTRIBUTION_RECORDER_DIR=/tmp/sglang_expert_distribution_record

23
# run prefill worker
24
python3 -m dynamo.sglang \
25
26
27
28
  --model-path silence09/DeepSeek-R1-Small-2layers \
  --served-model-name silence09/DeepSeek-R1-Small-2layers \
  --tp 2 \
  --dp-size 2 \
29
  --page-size 16 \
30
31
32
33
  --enable-dp-attention \
  --trust-remote-code \
  --disaggregation-mode prefill \
  --disaggregation-transfer-backend nixl \
34
  --expert-distribution-recorder-mode stat \
35
36
37
38
  --port 30000 &
PREFILL_PID=$!

# run decode worker
39
CUDA_VISIBLE_DEVICES=2,3 python3 -m dynamo.sglang \
40
41
42
43
  --model-path silence09/DeepSeek-R1-Small-2layers \
  --served-model-name silence09/DeepSeek-R1-Small-2layers \
  --tp 2 \
  --dp-size 2 \
44
  --page-size 16 \
45
46
47
48
  --enable-dp-attention \
  --trust-remote-code \
  --disaggregation-mode decode \
  --disaggregation-transfer-backend nixl \
49
  --expert-distribution-recorder-mode stat \
50
  --port 31000