LLaVA: latency issues#34460
Merged
zucchini-nlp merged 4 commits intohuggingface:mainfrom Oct 29, 2024
Merged
Conversation
|
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. |
ArthurZucker
approved these changes
Oct 28, 2024
Collaborator
ArthurZucker
left a comment
There was a problem hiding this comment.
Thanks, noting that this is needed in a patch 🤗
Comment on lines
-1113
to
-1122
| if input_ids is not None: | ||
| img_token_not_enough = (input_ids == self.config.image_token_index).sum( | ||
| 1 | ||
| ).max() < self.config.image_seq_length | ||
| video_token_not_enough = (input_ids == self.config.video_token_index).sum( | ||
| 1 | ||
| ).max() < self.config.video_seq_length | ||
| legacy_processing = (img_token_not_enough and pixel_values is not None) or ( | ||
| video_token_not_enough and pixel_values_videos is not None | ||
| ) |
Collaborator
There was a problem hiding this comment.
glad that this is removed, never saw this being added (was not pinged on the PR!)
ArthurZucker
pushed a commit
that referenced
this pull request
Oct 29, 2024
* fix llavas * code style * green ci
Contributor
|
Hi @zucchini-nlp @ArthurZucker . This PR could lead the issue #34696 . Do you mind take a look? Thanks. |
Member
Author
|
@jiqing-feng I'll be updating all model configs starting next week to enable the new logic for processing. So we stop seeing bugs related to the old logic maintenance. For the linked issue, will take a look soon , thanks |
BernardZach
pushed a commit
to BernardZach/transformers
that referenced
this pull request
Dec 5, 2024
* fix llavas * code style * green ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes latency issues in some llava models caused by the recent processing logic refactoring. It was reported by one of the users that the new release is twice slower than the prev release. The problem was in indentation where images were embedded in every run instead of only the pre-fill stage
I believe it is worth fixing and merging until #33424 is merged to unblock e from updating hub configs and enabling the new logic