Skip to content

[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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yeqcharlotte
Copy link
Collaborator

@yeqcharlotte yeqcharlotte commented Jun 23, 2025

Essential Elements of an Effective PR Description Checklist

  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Purpose

None of existing CI tests E2E eval correctness for multimodal models.

So improve this coverage by running chartqa using "vllm-vlm" backend in lm_eval.
chartqa requires 0.4.9, #19962 to upgrade and see if there's any issues.

For reviewer, most relevant changes are in:

  • .buildkite/lm-eval-harness/configs/Qwen2.5-VL-7B-Instruct.yaml
  • .buildkite/lm-eval-harness/test_lm_eval_correctness.py

Follow-ups not included in this PR:

  • Make this more accessible by users and other model developers for onboarding
  • Use more sensitive eval e.g. math vista that is not available in lm-eval

Test Plan

(We can wait for ~1 week to add them to CI)

pytest -s -v test_lm_eval_correctness.py \
    --config-list-file=configs/models-mm-small.txt \
    --tp-size=1

Confirm existing tests still work:

CUDA_VISIBLE_DEVICES=1 pytest -s -v test_lm_eval_correctness.py \
    --config-list-file=configs/models-small.txt \
    --tp-size=1

Test Result

New mm test

chartqa | relaxed_accuracy,none: ground_truth=0.855 | measured=0.858
PASSED
...
======================================== 1 passed, 2 warnings in 218.56s (0:03:38) ========================================

Right now we run the full test which takes ~3.5 min. 500 examples takes ~90s, but there's a big drop in metrics to ~0.76. This is likely due to the questions are off different complextiy.

Adding requests: 100%|███████████████████████████████████████████████████████████████████| 500/500 [00:08<00:00, 58.83it/s]
Processed prompts: 100%|██████| 500/500 [00:20<00:00, 24.93it/s, est. speed input: 17508.04 toks/s, output: 3651.71 toks/s]
Running generate_until requests with text+image input: 100%|█████████████████████████████| 500/500 [00:28<00:00, 17.40it/s]
chartqa | relaxed_accuracy,none: ground_truth=0.855 | measured=0.758
FAILED

Qwen reported 87.3: https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct
I was able to get 86.6 in tp2 but tp1 is around 86. Some potential kernel issues to dig into as a follow-up. But I'll leave them as it is.

| Tasks |Version|Filter|n-shot|     Metric      |   |Value |   |Stderr|
|-------|------:|------|-----:|-----------------|---|-----:|---|-----:|
|chartqa|      0|none  |     0|anywhere_accuracy|↑  |0.8676|±  |0.0068|
|       |       |none  |     0|exact_match      |↑  |0.5424|±  |0.0100|
|       |       |none  |     0|relaxed_accuracy |↑  |0.8660|±  |0.0068|

*Existing text test
it passes on this PR.

================================================================================ 6 passed, 13 warnings in 341.89s (0:05:41) ================================================================================

i tried to enable chat template for text models with fewshot_as_multiturn but observed regression in 5 out of 5 test models' strict-match so only apply chat template to mm.

Qwen/Qwen2.5-1.5B-Instruct:
gsm8k | exact_match,strict-match: ground_truth=0.54 | measured=0.3502653525398029
gsm8k | exact_match,flexible-extract: ground_truth=0.59 | measured=0.599696739954511
FAILED

neuralmagic/Llama-3.2-1B-Instruct-quantized.w8a8
gsm8k | exact_match,strict-match: ground_truth=0.356 | measured=0.276
gsm8k | exact_match,flexible-extract: ground_truth=0.358 | measured=0.362
FAILED

nm-testing/Meta-Llama-3-8B-Instruct-W8-Channel-A8-Dynamic-Asym-Per-Token-Test
gsm8k | exact_match,strict-match: ground_truth=0.764 | measured=0.66
gsm8k | exact_match,flexible-extract: ground_truth=0.764 | measured=0.756
FAILED

nm-testing/Meta-Llama-3-8B-Instruct-nonuniform-test
gsm8k | exact_match,strict-match: ground_truth=0.758 | measured=0.657
gsm8k | exact_match,flexible-extract: ground_truth=0.759 | measured=0.758
FAILED

RedHatAI/Qwen2.5-VL-3B-Instruct-FP8-Dynamic
gsm8k | exact_match,strict-match: ground_truth=0.47 | measured=0.47308567096285065
gsm8k | exact_match,flexible-extract: ground_truth=0.64 | measured=0.66868840030326
PASSED

nm-testing/Qwen1.5-MoE-A2.7B-Chat-quantized.w4a16
gsm8k | exact_match,strict-match: ground_truth=0.3 | measured=0.22896133434420016
gsm8k | exact_match,flexible-extract: ground_truth=0.465 | measured=0.4715693707354056
FAILED

Signed-off-by: Ye (Charlotte) Qi <[email protected]>
Signed-off-by: Ye (Charlotte) Qi <[email protected]>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @yeqcharlotte, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the CI pipeline by introducing initial end-to-end evaluation correctness testing for multimodal models. It specifically adds a test for the chartqa task using the vllm-vlm backend, filling a critical gap in current CI coverage. The changes also include standardizing existing model configurations and making the evaluation framework more flexible to support different model backends.

Highlights

  • CI Coverage for Multimodal Models: Introduced a new CI test to evaluate the end-to-end correctness of multimodal models, specifically using the chartqa task with the vllm-vlm backend. This addresses a current gap in CI coverage for multimodal capabilities.
  • New Multimodal Evaluation Configuration: Added a new YAML configuration file (Qwen2.5-VL-7B-Instruct.yaml) for the Qwen2.5-VL-7B-Instruct multimodal model, specifying vllm-vlm as its evaluation backend and chartqa as the task.
  • Flexible LM Eval Backend Selection: Modified the test_lm_eval_correctness.py script to dynamically select the lm_eval model backend based on the evaluation configuration, allowing for vllm-vlm alongside the existing vllm backend.
  • Conditional Chat Template Application: Implemented logic within the test_lm_eval_correctness.py script to apply chat templates only for vllm-vlm backends during evaluation. This avoids regressions observed when applying chat templates to existing text models.
  • Dedicated Multimodal Evaluation Script: Added a new bash script (run-lm-eval-chartqa-vllm-vlm-baseline.sh) to facilitate running lm_eval specifically for multimodal models on the chartqa dataset.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mergify mergify bot added the ci/build label Jun 23, 2025
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This PR introduces a new CI test for multimodal models using lm-eval-harness. The changes include a new test configuration, a script to run the evaluation, and updates to existing configurations and test logic to support different backends. I've suggested adding validation for required arguments in the new shell script and making the Python test logic more robust.

Comment on lines +39 to +44
lm_eval --model vllm-vlm \
--model_args "pretrained=$MODEL,tensor_parallel_size=$TP_SIZE" \
--tasks chartqa \
--batch_size auto \
--apply_chat_template \
--limit $LIMIT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Consider validating that the required arguments (-m, -l, -t) are provided to the script. This will prevent lm_eval from being called with empty variables, which could lead to errors.

Suggested change
lm_eval --model vllm-vlm \
--model_args "pretrained=$MODEL,tensor_parallel_size=$TP_SIZE" \
--tasks chartqa \
--batch_size auto \
--apply_chat_template \
--limit $LIMIT
if [[ -z "$MODEL" || -z "$LIMIT" || -z "$TP_SIZE" ]]; then
echo "Error: -m, -l, and -t are required arguments."
usage
exit 1
fi
lm_eval --model vllm-vlm \
--model_args "pretrained=$MODEL,tensor_parallel_size=$TP_SIZE" \
--tasks chartqa \
--batch_size auto \
--apply_chat_template \
--limit $LIMIT

# pip install lm-eval==0.4.9

usage() {
echo``
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line contains a typo: echo`` will print a backtick. Use echoorecho ""` to print an empty line.

Suggested change
echo``
echo

Comment on lines +29 to +38
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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To prevent KeyError exceptions, use eval_config.get("backend", "vllm") to provide a default value if the backend key is missing.

    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",
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant