# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

Frontend:
  served_model_name: deepseek-ai/DeepSeek-R1
  endpoint: dynamo.SGLangWorker.generate
  port: 8000

SGLangWorker:
  model-path: /model/
  served-model-name: deepseek-ai/DeepSeek-R1
  skip-tokenizer-init: true
  disaggregation-mode: prefill
  disaggregation-transfer-backend: nixl
  disaggregation-bootstrap-port: 30001
  dist-init-addr: HEAD_PREFILL_NODE_IP:29500
  nnodes: 2
  node-rank: 0
  tp-size: 16
  dp-size: 16
  enable-dp-attention: true
  decode-log-interval: 1
  # when MoE is enabled ep-size == tp-size
  enable-deepep-moe: true
  page-size: 1
  trust-remote-code: true
  moe-dense-tp-size: 1
  enable-dp-lm-head: true
  disable-radix-cache: true
  watchdog-timeout: 1000000
  enable-two-batch-overlap: true
  deepep-mode: normal
  mem-fraction-static: 0.85
  # SGLang's instructions for benchmarking include these flags
  #max-running-requests: 8192
  #max-total-tokens: 131072
  #context-length: 8192
  #init-expert-location: /configs/prefill_in4096.json
  #deepep-config: /configs/deepep.json
  chunked-prefill-size: 524288
  ep-num-redundant-experts: 32
  ep-dispatch-algorithm: dynamic
  eplb-algorithm: deepseek
  ServiceArgs:
    workers: 1
    resources:
      gpu: 8
    envs:
      MC_TE_METRIC: true
      SGLANG_TBO_DEBUG: 1

SGLangDecodeWorker:
  model-path: /model/
  served-model-name: deepseek-ai/DeepSeek-R1
  skip-tokenizer-init: true
  disaggregation-mode: decode
  disaggregation-transfer-backend: nixl
  disaggregation-bootstrap-port: 30001
  dist-init-addr: HEAD_DECODE_NODE_IP:29500
  nnodes: 4
  node-rank: 0
  tp-size: 32
  dp-size: 32
  enable-dp-attention: true
  decode-log-interval: 1
  enable-deepep-moe: true
  page-size: 1
  trust-remote-code: true
  # when MoE is enabled ep-size == tp-size
  moe-dense-tp-size: 1
  enable-dp-lm-head: true
  disable-radix-cache: true
  watchdog-timeout: 1000000
  enable-two-batch-overlap: true
  deepep-mode: low_latency
  mem-fraction-static: 0.835
  # SGLang's instructions for benchmarking include these flags
  #max-running-requests: 18432
  #context-length: 4500
  #init-expert-location: /configs/decode_in2000out100.json
  ep-num-redundant-experts: 32
  cuda-graph-bs: 256
  ServiceArgs:
    workers: 1
    resources:
      gpu: 8
    envs:
      MC_TE_METRIC: true
      SGLANG_TBO_DEBUG: 1
