forked from EvolvingLMMs-Lab/lmms-eval
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvllm_qwen3vl.sh
More file actions
executable file
·107 lines (88 loc) · 3.32 KB
/
Copy pathvllm_qwen3vl.sh
File metadata and controls
executable file
·107 lines (88 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash
# Qwen3-VL Evaluation Script with vLLM Backend
# This script demonstrates how to evaluate Qwen3-VL models using vLLM for accelerated inference
#
# Requirements:
# - vllm>=0.11.0
# - qwen-vl-utils
# - CUDA-enabled GPU(s)
#
# Installation:
# uv add vllm qwen-vl-utils
# OR
# pip install vllm>=0.11.0 qwen-vl-utils
# ============================================================================
# Configuration
# ============================================================================
# Model Configuration
# Available Qwen3-VL models:
# - Qwen/Qwen3-VL-30B-A3B-Instruct
# - Qwen/Qwen3-VL-30B-A3B-Thinking
# - Qwen/Qwen3-VL-235B-A22B-Instruct
# - Qwen/Qwen3-VL-235B-A22B-Thinking
MODEL="Qwen/Qwen3-VL-30B-A3B-Instruct"
# Parallelization Settings
# Adjust based on your GPU configuration.
# If DATA_PARALLEL_SIZE > 1, this script automatically switches to torchrun.
TENSOR_PARALLEL_SIZE=4 # Number of GPUs for tensor parallelism
DATA_PARALLEL_SIZE=1 # Global number of data-parallel replicas, not a per-GPU local value
# Memory and Performance Settings
GPU_MEMORY_UTILIZATION=0.85 # Fraction of GPU memory to use (0.0 - 1.0)
BATCH_SIZE=64 # Batch size for evaluation
# Task Configuration
# Common tasks: mmmu_val, mme, mathvista, ai2d, etc.
TASKS="mmmu_val,mme"
# Output Configuration
OUTPUT_PATH="./logs/qwen3vl_vllm"
LOG_SAMPLES=true
LOG_SUFFIX="qwen3vl_vllm"
# Evaluation Limits (optional)
# LIMIT=100 # Uncomment to limit number of samples (for testing)
# ============================================================================
# NCCL Configuration (for multi-GPU setups)
# ============================================================================
export NCCL_BLOCKING_WAIT=1
export NCCL_TIMEOUT=18000000
# export NCCL_DEBUG=INFO # Uncomment for debugging
# ============================================================================
# Run Evaluation
# ============================================================================
echo "=========================================="
echo "Qwen3-VL Evaluation with vLLM"
echo "=========================================="
echo "Model: $MODEL"
echo "Tensor Parallel Size: $TENSOR_PARALLEL_SIZE"
echo "Data Parallel Size: $DATA_PARALLEL_SIZE"
echo "Tasks: $TASKS"
echo "Batch Size: $BATCH_SIZE"
echo "Output Path: $OUTPUT_PATH"
echo "=========================================="
LAUNCHER="uv run python -m lmms_eval"
MODEL_ARGS="model=${MODEL},tensor_parallel_size=${TENSOR_PARALLEL_SIZE},gpu_memory_utilization=${GPU_MEMORY_UTILIZATION}"
if [ "${DATA_PARALLEL_SIZE}" -gt 1 ]; then
LAUNCHER="uv run python -m torch.distributed.run --standalone --nproc_per_node=$((TENSOR_PARALLEL_SIZE * DATA_PARALLEL_SIZE)) -m lmms_eval"
MODEL_ARGS="${MODEL_ARGS},data_parallel_size=${DATA_PARALLEL_SIZE}"
fi
CMD="${LAUNCHER} \
--model vllm \
--model_args ${MODEL_ARGS} \
--tasks ${TASKS} \
--batch_size ${BATCH_SIZE} \
--output_path ${OUTPUT_PATH}"
# Add optional arguments
if [ "$LOG_SAMPLES" = true ]; then
CMD="$CMD --log_samples --log_samples_suffix ${LOG_SUFFIX}"
fi
if [ ! -z "$LIMIT" ]; then
CMD="$CMD --limit ${LIMIT}"
fi
# Execute
echo "Running command:"
echo "$CMD"
echo ""
eval $CMD
echo ""
echo "=========================================="
echo "Evaluation Complete!"
echo "Results saved to: $OUTPUT_PATH"
echo "=========================================="