start-tp4.sh 1.5 KB

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env bash
  2. # start-tp4.sh — DeepSeek-V4.1-Flash on 4× DGX Spark (TP4/EP4).
  3. #
  4. # Same engine, image and commands as start.sh, with a profile of its own:
  5. # .env.tp4 settings for this profile (copied from .env.tp4.example on first run)
  6. # state-tp4/ launch record, smoke result, api key, DSpark tables
  7. # logs-tp4/ engine log
  8. # The 3-Spark profile (.env, state/, logs/) is untouched, so one checkout can drive
  9. # either fleet. Every TP4-specific runtime choice (context, KV pool, concurrency,
  10. # prefill chunk, memory fraction, no head padding) lives in .env.tp4.example.
  11. # Serving knobs shared with TP3 (DSpark k, max_tokens cap, loop abort, thinking
  12. # alias) are in start.sh + the overlay image; .env.tp4.example defaults match.
  13. #
  14. # Usage: ./start-tp4.sh doctor | build | share | pack | serve | stop | status | logs | smoke
  15. #
  16. # DSV41_LAUNCHER=tp4 is the only switch that arms TP4 behavior inside start.sh
  17. # and the adapter: the named Dockerfile, EXTRA_CONTAINER_ENV, the shared-pad
  18. # defaults, the anchored worker rsync, EP 1/2 on the ring, and the production
  19. # hooks. ./start.sh leaves it unset, and that path stays as it was.
  20. set -euo pipefail
  21. ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  22. export ENV_FILE="$ROOT/.env.tp4"
  23. export ENV_EXAMPLE="$ROOT/.env.tp4.example"
  24. export STATE_DIR="${STATE_DIR:-$ROOT/state-tp4}"
  25. export LOG_DIR="${LOG_DIR:-$ROOT/logs-tp4}"
  26. export SERVE_LOG="${SERVE_LOG:-$LOG_DIR/dsv41.log}"
  27. export DSV41_LAUNCHER=tp4
  28. exec "$ROOT/start.sh" "$@"