disagg.sh 1.11 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/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..."
    kill $DYNAMO_PID $PREFILL_PID 2>/dev/null || true
    wait $DYNAMO_PID $PREFILL_PID 2>/dev/null || true
    echo "Cleanup complete."
}
trap cleanup EXIT INT TERM


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

# run prefill worker
20
python3 -m dynamo.sglang \
21
22
  --model-path Qwen/Qwen3-0.6B \
  --served-model-name Qwen/Qwen3-0.6B \
23
24
25
26
  --page-size 16 \
  --tp 1 \
  --trust-remote-code \
  --disaggregation-mode prefill \
27
28
  --disaggregation-bootstrap-port 12345 \
  --host 0.0.0.0 \
29
30
31
32
  --disaggregation-transfer-backend nixl &
PREFILL_PID=$!

# run decode worker
33
CUDA_VISIBLE_DEVICES=1 python3 -m dynamo.sglang \
34
35
  --model-path Qwen/Qwen3-0.6B \
  --served-model-name Qwen/Qwen3-0.6B \
36
37
38
39
  --page-size 16 \
  --tp 1 \
  --trust-remote-code \
  --disaggregation-mode decode \
40
41
  --disaggregation-bootstrap-port 12345 \
  --host 0.0.0.0 \
42
  --disaggregation-transfer-backend nixl