run.sh 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/bin/bash
  2. # The PR gate: quality battery and speed suite against a running stack.
  3. #
  4. # gate/run.sh full LABEL everything a PR needs (about 2.5 hours)
  5. # gate/run.sh quick LABEL the reduced gate (about 1 hour)
  6. #
  7. # Run it on the head node from the repo root, with the stack up and nothing else
  8. # using it. GATE_URL (http://127.0.0.1:8002), GATE_MODEL (glm53), GATE_IMAGE
  9. # (build.sh's default tag, runs the HumanEval programs with no network), QUALITY_DIR
  10. # (GSM8K and HumanEval data, see experimental/quality/quality.py) and
  11. # RIGMARK_DIR (a RigMark checkout; RigMark is skipped without it).
  12. set -u
  13. MODE=${1:?full or quick}; LABEL=${2:?label}
  14. export GATE_URL=${GATE_URL:-http://127.0.0.1:8002} GATE_MODEL=${GATE_MODEL:-glm53}
  15. export QUALITY_URL=$GATE_URL QUALITY_DIR=${QUALITY_DIR:-quality-data}
  16. IMAGE=${GATE_IMAGE:-spark-glm53:v8}
  17. full() { [ "$MODE" = full ]; }
  18. # The HumanEval programs run in a container; without docker access this fell
  19. # through to "permission denied" and HumanEval went unscored.
  20. DOCKER=docker; docker info >/dev/null 2>&1 || DOCKER="sudo docker"
  21. echo "--- smoketest"
  22. bash smoketest/run.sh "$GATE_URL" 2>&1 | tail -1
  23. echo "--- NLL against bf16 dense"
  24. python3 gate/nll.py compare | cut -c1-100
  25. echo "--- GSM8K$(full && echo ' and HumanEval')"
  26. python3 experimental/quality/quality.py "$LABEL" 250 2>&1 | grep -E "GSM8K|Error"
  27. if full; then
  28. $DOCKER run --rm --network none -v "$(realpath "$QUALITY_DIR/$LABEL")":/q:ro \
  29. -v "$PWD/experimental/quality/run_he.py":/run_he.py:ro --entrypoint python3 "$IMAGE" /run_he.py /q 2>&1 | tail -1
  30. echo "--- count to 200"
  31. python3 gate/count.py 5 | tail -1
  32. fi
  33. echo "--- tool call at 42k context"
  34. python3 dev/repro/toolcall_corruption.py --url "$GATE_URL" --model "$GATE_MODEL" \
  35. --runs "$(full && echo 40 || echo 10)" --concurrency 4 2>&1 | grep diverge | tail -1
  36. echo "--- agent tools"
  37. python3 experimental/quality/agent_tools.py "$GATE_URL" --model "$GATE_MODEL" 2>&1 | tail -1
  38. echo "--- needle"
  39. if full; then LENGTHS="32000 128000 256000 480000"; else LENGTHS="128000 480000"; fi
  40. python3 dev/repro/needle.py --url "$GATE_URL" --model "$GATE_MODEL" --lengths $LENGTHS 2>&1 | tail -1
  41. echo "--- prefill 32k, 128k (cold)"
  42. for i in $(seq 1 "$(full && echo 4 || echo 2)"); do
  43. python3 gate/prefill.py --base "$GATE_URL/v1" --model "$GATE_MODEL" --sizes 32k,128k --skip-thinking \
  44. --seed $RANDOM 2>&1 | grep -E "^ +[0-9]{4,}" | awk '{print $3}' | tr "\n" " "; echo
  45. done
  46. echo "--- decode"
  47. python3 gate/decode.py | tail -3
  48. python3 gate/decode_stream.py | tail -3
  49. echo "--- concurrent streams (mixed prompts)"
  50. python3 gate/conc.py 1 2 4 8 16 | tail -5
  51. curl -s "$GATE_URL/metrics" | grep -E "^vllm:num_preemptions_total"
  52. if full && [ -n "${RIGMARK_DIR:-}" ]; then
  53. echo "--- RigMark"
  54. mkdir -p gate-results
  55. (cd "$RIGMARK_DIR" && timeout 1800 python3 bench.py --base-url "$GATE_URL" --model "$GATE_MODEL" \
  56. --label "$LABEL" --comparison-id ringside-redhat-rowsplit-20260926 --seed 20260905 --runs 2 \
  57. --metadata "$OLDPWD/gate/rigmark-metadata.json" \
  58. --decode-tokens 4096 --extra-body '{"chat_template_kwargs":{"reasoning_effort":"low"}}' \
  59. --skip-concurrency --prefill-depths 8192,32768,65536 --prefill-runs 1 \
  60. --output "$OLDPWD/gate-results/$LABEL.json" 2>&1 | grep -E "GATES")
  61. python3 gate/rigsum.py "gate-results/$LABEL.json"
  62. fi
  63. echo "--- done"