Skip to content

[generation] Encode multimodal data only once - #45783

Open
zucchini-nlp wants to merge 44 commits into
huggingface:mainfrom
zucchini-nlp:multimodal-encode-generation
Open

[generation] Encode multimodal data only once#45783
zucchini-nlp wants to merge 44 commits into
huggingface:mainfrom
zucchini-nlp:multimodal-encode-generation

Conversation

@zucchini-nlp

@zucchini-nlp zucchini-nlp commented May 5, 2026

Copy link
Copy Markdown
Member

CI

What does this PR do?

As per title, moves multimodal encoding out of the loop so it happens only once and on un-expanded pixels. For example, in assisted generation we used to encode twice (once in assistant and once in target model), or in beam search we used to expand all pixel by x num_beams times. This is very inefficient, especially in models where vision encoder requires huge memory like qwen-series (usually extremely long sequence lengths)

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@zucchini-nlp

Copy link
Copy Markdown
Member Author

run-slow: aria, aya_vision, blip_2, chameleon, cohere2_vision, deepseek_vl, deepseek_vl_hybrid, emu3, ernie4_5_vl_moe, fast_vlm, florence2, fuyu, gemma3, gemma3n, gemma4, glm46v

@huggingface huggingface deleted a comment from github-actions Bot May 6, 2026
@huggingface huggingface deleted a comment from github-actions Bot May 6, 2026
@huggingface huggingface deleted a comment from github-actions Bot May 6, 2026
@zucchini-nlp

Copy link
Copy Markdown
Member Author

run-slow: aria, aya_vision, blip_2, chameleon, cohere2_vision, deepseek_vl, deepseek_vl_hybrid, emu3, ernie4_5_vl_moe, fast_vlm, florence2, fuyu, gemma3, gemma3n, gemma4, glm46v, qwen2_vl, mllama, llava, llava_next_video

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Workflow Run ⚙️

This comment contains run-slow, running the specified jobs:

models: ["models/aria", "models/aya_vision", "models/blip_2", "models/chameleon", "models/cohere2_vision", "models/deepseek_vl", "models/deepseek_vl_hybrid", "models/emu3", "models/ernie4_5_vl_moe", "models/fast_vlm", "models/florence2", "models/fuyu", "models/gemma3", "models/gemma3n", "models/gemma4", "models/glm46v", "models/llava", "models/llava_next_video", "models/mllama", "models/qwen2_vl"]
quantizations: []

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=45783&sha=5c9599

@huggingface huggingface deleted a comment from github-actions Bot Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 30365250841:1
Result: failure | Jobs: 2 | Tests: 3 | Failures: 2 | Duration: 19s

Code quality check failed: test jobs were skipped. Fix the code quality issues and push again to run tests.

@github-actions

Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: aria, aya_vision, blip_2, chameleon, cohere2_vision, cosmos3_edge, cosmos3_omni, deepseek_vl, deepseek_vl_hybrid, emu3, ernie4_5_vl_moe, exaone4_5, fast_vlm, florence2, fuyu, gemma3

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.

3 participants