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

Support processor_kwargs for hf-multimodal #2666

Open
nikg4 opened this issue Jan 30, 2025 · 1 comment · May be fixed by #2667
Open

Support processor_kwargs for hf-multimodal #2666

nikg4 opened this issue Jan 30, 2025 · 1 comment · May be fixed by #2667

Comments

@nikg4
Copy link

nikg4 commented Jan 30, 2025

We're using LM-Harness to evaluate Qwen/Qwen2-VL-2B-Instruct on task_name: mmmu_val using 4 A100 GPUs w/ 40GB VRAM.

The evaluation starts and progresses OK until the middle of the dataset where it fails with CUDA OOM (out-of-memory). It looks like it may be caused by a single example in the dataset which requires more GPU memory than usual, leading to OOM.

This Qwen2-VL OOM problem was resolved for training, by passing the following params as Qwen2-VL processor_kwargs:

{
  "min_pixels": 256 * 28 * 28,
  "max_pixels": 1280 * 28 * 28,
}

Context: https://huggingface.co/Qwen/Qwen2-VL-2B-Instruct#image-resolution-for-performance-boost

For LH-Harness evaluation, I haven't found a way to configure processor_kwargs for hf-multimodal (only model_args seem configurable):

self.processor = transformers.AutoProcessor.from_pretrained(

Could you please advise if setting processor_kwargs is supported? If not, would it be possible to add it for hf-multimodal ?

@baberabb baberabb linked a pull request Jan 31, 2025 that will close this issue
@baberabb
Copy link
Contributor

baberabb commented Jan 31, 2025

The PR should let you pass min_pixels, max_pixels to the model args, but just so I don't forget, need to think of a better way of passing sub-method kwargs

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 a pull request may close this issue.

2 participants