|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +source "$(dirname "$0")/../benchmark_lib.sh" |
| 4 | + |
| 5 | +check_env_vars \ |
| 6 | + CONC_LIST \ |
| 7 | + ISL \ |
| 8 | + OSL \ |
| 9 | + IMAGE \ |
| 10 | + SPEC_DECODING \ |
| 11 | + MODEL_PATH \ |
| 12 | + PREFILL_NUM_WORKERS \ |
| 13 | + PREFILL_TP \ |
| 14 | + PREFILL_EP \ |
| 15 | + PREFILL_DP_ATTN \ |
| 16 | + DECODE_NUM_WORKERS \ |
| 17 | + DECODE_TP \ |
| 18 | + DECODE_EP \ |
| 19 | + DECODE_DP_ATTN \ |
| 20 | + PREFILL_NODES \ |
| 21 | + DECODE_NODES \ |
| 22 | + RANDOM_RANGE_RATIO |
| 23 | + |
| 24 | +if [[ -n "$SLURM_JOB_ID" ]]; then |
| 25 | + echo "JOB $SLURM_JOB_ID running on $SLURMD_NODENAME" |
| 26 | +fi |
| 27 | + |
| 28 | +set -x |
| 29 | + |
| 30 | +# Use upstreamed multi_node scripts (no external clone needed) |
| 31 | +cd "$GITHUB_WORKSPACE/benchmarks/multi_node/amd_utils" || exit 1 |
| 32 | + |
| 33 | +# Set up SGL launch script-specific environment variables |
| 34 | +export TIME_LIMIT="08:00:00" |
| 35 | +export MODEL_PATH=$MODEL_PATH |
| 36 | +export MODEL_NAME=$MODEL_NAME |
| 37 | +export CONTAINER_IMAGE=$IMAGE |
| 38 | + |
| 39 | +if [[ "${PREFILL_EP:-1}" -eq 1 ]]; then |
| 40 | +export PREFILL_ENABLE_EP=false |
| 41 | +else |
| 42 | +export PREFILL_ENABLE_EP=true |
| 43 | +fi |
| 44 | + |
| 45 | +if [[ "$PREFILL_DP_ATTN" == "true" ]]; then |
| 46 | +export PREFILL_ENABLE_DP=true |
| 47 | +else |
| 48 | +export PREFILL_ENABLE_DP=false |
| 49 | +fi |
| 50 | + |
| 51 | +if [[ "${DECODE_EP:-1}" -eq 1 ]]; then |
| 52 | +export DECODE_ENABLE_EP=false |
| 53 | +else |
| 54 | +export DECODE_ENABLE_EP=true |
| 55 | +fi |
| 56 | + |
| 57 | +if [[ "$DECODE_DP_ATTN" == "true" ]]; then |
| 58 | +export DECODE_ENABLE_DP=true |
| 59 | +else |
| 60 | +export DECODE_ENABLE_DP=false |
| 61 | +fi |
| 62 | + |
| 63 | +# Launch jobs based on ISL/OSL |
| 64 | +# Replace ' ' in CONC_LIST with 'x' such that the concurrency list is represented |
| 65 | +# by a list of numbers delimited by 'x'. This is because of how the underlying launch script |
| 66 | +# expects the concurrencies. |
| 67 | +JOB_ID=$(bash ./submit.sh $PREFILL_NODES \ |
| 68 | + $PREFILL_NUM_WORKERS \ |
| 69 | + $DECODE_NODES \ |
| 70 | + $DECODE_NUM_WORKERS \ |
| 71 | + $ISL $OSL "${CONC_LIST// /x}" inf \ |
| 72 | + ${PREFILL_ENABLE_EP} ${PREFILL_ENABLE_DP} \ |
| 73 | + ${DECODE_ENABLE_EP} ${DECODE_ENABLE_DP} \ |
| 74 | + ${PREFILL_TP} ${DECODE_TP} \ |
| 75 | + ${RANDOM_RANGE_RATIO} \ |
| 76 | + ${NODE_LIST:-}) |
| 77 | + |
| 78 | +if [[ $? -ne 0 ]]; then |
| 79 | + echo "Failed to submit job" >&2 |
| 80 | + exit 1 |
| 81 | +fi |
| 82 | + |
| 83 | +echo "$JOB_ID" |
0 commit comments