# Common configuration for the max context length exploration on P800.
# All values can be overridden via environment variables.

EXPERIMENT="dsv4_p800_max_context_length"
MODEL_NAME="DeepSeek-V4-Flash-INT8"
MODEL_PATH="/data1/models/DeepSeek-V4-Flash-INT8"
SERVED_MODEL_NAME="deepseek-v4-flash-int8"

# Port must differ from other running experiments.
PORT="${PORT:-30013}"

# We want exact input lengths, so fix the random range ratio to 1.0.
OUTPUT_LEN="${OUTPUT_LEN:-1}"
NUM_PROMPTS="${NUM_PROMPTS:-1}"
MAX_CONCURRENCY="${MAX_CONCURRENCY:-1}"
REQUEST_RATE="${REQUEST_RATE:-10000}"

# Padding added to target length when setting server context length.
CONTEXT_PAD="${CONTEXT_PAD:-1024}"

# Candidate input lengths (tokens). Override via CANDIDATE_LENS env var.
# Examples:
#   CANDIDATE_LENS="4096 8192 16384" bash run_bench.sh
#   CANDIDATE_LENS=(4096 8192 16384) bash run_bench.sh
if [[ -z "${CANDIDATE_LENS:-}" ]]; then
  declare -a CANDIDATE_LENS=(
    4096
    8192
    16384
    32768
    65536
    131072
    262144
    524288
  )
elif ! declare -p CANDIDATE_LENS 2>/dev/null | grep -q '^declare -a'; then
  # Normalize string-form arrays: remove surrounding parentheses and commas.
  _CAND_STR="${CANDIDATE_LENS#(}"
  _CAND_STR="${_CAND_STR%)}"
  _CAND_STR="${_CAND_STR//,/}"
  read -ra CANDIDATE_LENS <<< "$_CAND_STR"
  unset _CAND_STR
fi
