-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
[CI/Build] Add basic multimodal lm eval for CI testing #19959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# For vllm script, with -t option (tensor parallel size). | ||
# sh .buildkite/lm-eval-harness/run-lm-eval-chartqa-vllm-vlm-baseline.sh -m Qwen/Qwen2.5-VL-7B-Instruct -l 2500 -t 1 | ||
|
||
model_name: "Qwen/Qwen2.5-VL-7B-Instruct" | ||
backend: "vllm-vlm" | ||
tasks: | ||
- name: "chartqa" | ||
metrics: | ||
- name: "relaxed_accuracy,none" | ||
value: 0.855 | ||
limit: 2500 | ||
num_fewshot: 0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Qwen2.5-VL-7B-Instruct.yaml |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,44 @@ | ||||||||||||||||||||||||||||||||||||||
#!/bin/bash | ||||||||||||||||||||||||||||||||||||||
# We can use this script to compute baseline accuracy on chartqa for vllm. | ||||||||||||||||||||||||||||||||||||||
# | ||||||||||||||||||||||||||||||||||||||
# Make sure you have lm-eval-harness installed: | ||||||||||||||||||||||||||||||||||||||
# pip install lm-eval==0.4.9 | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
usage() { | ||||||||||||||||||||||||||||||||||||||
echo`` | ||||||||||||||||||||||||||||||||||||||
echo "Runs lm eval harness on ChartQA using multimodal vllm." | ||||||||||||||||||||||||||||||||||||||
echo "This pathway is intended to be used to create baselines for " | ||||||||||||||||||||||||||||||||||||||
echo "our correctness tests in vllm's CI." | ||||||||||||||||||||||||||||||||||||||
echo | ||||||||||||||||||||||||||||||||||||||
echo "usage: ${0} <options>" | ||||||||||||||||||||||||||||||||||||||
echo | ||||||||||||||||||||||||||||||||||||||
echo " -m - huggingface stub or local directory of the model" | ||||||||||||||||||||||||||||||||||||||
echo " -l - limit number of samples to run" | ||||||||||||||||||||||||||||||||||||||
echo " -t - tensor parallel size to run at" | ||||||||||||||||||||||||||||||||||||||
echo | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
while getopts "m:l:t:" OPT; do | ||||||||||||||||||||||||||||||||||||||
case ${OPT} in | ||||||||||||||||||||||||||||||||||||||
m ) | ||||||||||||||||||||||||||||||||||||||
MODEL="$OPTARG" | ||||||||||||||||||||||||||||||||||||||
;; | ||||||||||||||||||||||||||||||||||||||
l ) | ||||||||||||||||||||||||||||||||||||||
LIMIT="$OPTARG" | ||||||||||||||||||||||||||||||||||||||
;; | ||||||||||||||||||||||||||||||||||||||
t ) | ||||||||||||||||||||||||||||||||||||||
TP_SIZE="$OPTARG" | ||||||||||||||||||||||||||||||||||||||
;; | ||||||||||||||||||||||||||||||||||||||
\? ) | ||||||||||||||||||||||||||||||||||||||
usage | ||||||||||||||||||||||||||||||||||||||
exit 1 | ||||||||||||||||||||||||||||||||||||||
;; | ||||||||||||||||||||||||||||||||||||||
esac | ||||||||||||||||||||||||||||||||||||||
done | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
lm_eval --model vllm-vlm \ | ||||||||||||||||||||||||||||||||||||||
--model_args "pretrained=$MODEL,tensor_parallel_size=$TP_SIZE" \ | ||||||||||||||||||||||||||||||||||||||
--tasks chartqa \ | ||||||||||||||||||||||||||||||||||||||
--batch_size auto \ | ||||||||||||||||||||||||||||||||||||||
--apply_chat_template \ | ||||||||||||||||||||||||||||||||||||||
--limit $LIMIT | ||||||||||||||||||||||||||||||||||||||
Comment on lines
+39
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider validating that the required arguments (
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,12 +26,16 @@ def launch_lm_eval(eval_config, tp_size): | |
f"trust_remote_code={trust_remote_code}" | ||
) | ||
results = lm_eval.simple_evaluate( | ||
model="vllm", | ||
model=eval_config["backend"], | ||
model_args=model_args, | ||
tasks=[task["name"] for task in eval_config["tasks"]], | ||
num_fewshot=eval_config["num_fewshot"], | ||
limit=eval_config["limit"], | ||
batch_size="auto", | ||
# TODO(yeq): using chat template w/ fewshot_as_multiturn is supposed help | ||
# text models. however, this is regressing measured strict-match for | ||
# existing text models in CI, so only apply it for mm. | ||
apply_chat_template=eval_config["backend"] == "vllm-vlm", | ||
Comment on lines
+29
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To prevent results = lm_eval.simple_evaluate(
model=eval_config.get("backend", "vllm"),
model_args=model_args,
tasks=[task["name"] for task in eval_config["tasks"]],
num_fewshot=eval_config["num_fewshot"],
limit=eval_config["limit"],
batch_size="auto",
# TODO(yeq): using chat template w/ fewshot_as_multiturn is supposed help
# text models. however, this is regressing measured strict-match for
# existing text models in CI, so only apply it for mm.
apply_chat_template=eval_config.get("backend") == "vllm-vlm",
) |
||
) | ||
return results | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line contains a typo:
echo`` will print a backtick. Use
echoor
echo ""` to print an empty line.