Skip to content
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

Added support for Multimodal eval #1498

Closed
wants to merge 6 commits into from

Conversation

anirudhs001
Copy link

PR for #1334

Used VLMEvalWrapper from torchtune to support evaluation for multimodal models (llama3.2 11b only for now)

A sample run for mmmu_val_art:

(venv) anirudhsingh@Anirudhs-MacBook-Pro-4 torchchat % python torchchat.py eval Llama-3.2-mm --device cpu --dtype bf16 --task mmmu_val_art --modality text-image --max-seq-length 2048 
NumExpr defaulting to 12 threads.
PyTorch version 2.7.0.dev20250124 available.
Looking for libcustom_ops_aot_lib.so in /Users/anirudhsingh/MISC/playground/torchchat/venv/lib/python3.10/site-packages/executorch
Loading custom ops library: /Users/anirudhsingh/MISC/playground/torchchat/venv/lib/python3.10/site-packages/executorch/extension/llm/custom_ops/libcustom_ops_aot_lib.dylib
Unable to import torchao experimental quant_api with error:  [Errno 2] No such file or directory: '/Users/anirudhsingh/MISC/playground/torchchat/torchao-build/src/ao/torchao/experimental/quant_api.py'
Modality of model=text-image
Using device=cpu
Loading model...
Time to load model: 0.25 seconds
-----------------------------------------------------------
Building contexts for mmmu_val_art on rank 0...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 30/30 [00:00<00:00, 20148.78it/s]
Running generate_until requests
Running generate_until requests with text+image input: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 30/30 [7:49:19<00:00, 938.65s/it]
Time to run eval: 28171.31s.
Time in model.forward: 28154.47s, over 30 model evaluations
forward run time stats - Median: 360.38s Min: 355.40s Max: 8932.57s
For model /Users/anirudhsingh/.torchchat/model-cache/meta-llama/Llama-3.2-11B-Vision-Instruct/model.pth
mmmu_val_art:
 alias: Art
 acc,none: 0.2333
 acc_stderr,none: 0.0785

And with a limit of 1 sample:

(venv) anirudhsingh@Anirudhs-MacBook-Pro-4 torchchat % python torchchat.py eval Llama-3.2-mm --device cpu --dtype bf16 --task mmmu_val_art --limit 1 --modality text-image --max-seq-length 720
NumExpr defaulting to 12 threads.
PyTorch version 2.7.0.dev20250124 available.
Looking for libcustom_ops_aot_lib.so in /Users/anirudhsingh/MISC/playground/torchchat/venv/lib/python3.10/site-packages/executorch
Loading custom ops library: /Users/anirudhsingh/MISC/playground/torchchat/venv/lib/python3.10/site-packages/executorch/extension/llm/custom_ops/libcustom_ops_aot_lib.dylib
Unable to import torchao experimental quant_api with error:  [Errno 2] No such file or directory: '/Users/anirudhsingh/MISC/playground/torchchat/torchao-build/src/ao/torchao/experimental/quant_api.py'
Modality of model=text-image
Using device=cpu
Loading model...
Time to load model: 0.25 seconds
-----------------------------------------------------------
Building contexts for mmmu_val_art on rank 0...
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 5159.05it/s]
Running generate_until requests
Running generate_until requests with text+image input: 100%|██████████████████████████████████████████████████████████████| 1/1 [08:38<00:00, 518.97s/it]
Time to run eval: 531.16s.
Time in model.forward: 518.80s, over 1 model evaluations
forward run time stats - Median: 518.80s Min: 518.80s Max: 518.80s
For model /Users/anirudhsingh/.torchchat/model-cache/meta-llama/Llama-3.2-11B-Vision-Instruct/model.pth
mmmu_val_art:
 alias: Art
 acc,none: 0.0000

Copy link

pytorch-bot bot commented Feb 23, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchchat/1498

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link

Hi @anirudhs001!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@anirudhs001
Copy link
Author

Closed this since it was behind main. Rebased my branch and created #1499

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

Successfully merging this pull request may close these issues.

2 participants