-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[Bugfix][Core] Fix use audio in video bug #32994
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2346,7 +2346,7 @@ def _gather_mm_embeddings( | |
| self, | ||
| scheduler_output: "SchedulerOutput", | ||
| shift_computed_tokens: int = 0, | ||
| ) -> tuple[list[torch.Tensor], torch.Tensor]: | ||
| ) -> tuple[list[torch.Tensor], list[torch.Tensor]]: | ||
| total_num_scheduled_tokens = scheduler_output.total_num_scheduled_tokens | ||
|
|
||
| # Swap to the other buffer to avoid race condition with previous | ||
|
|
@@ -2355,6 +2355,7 @@ def _gather_mm_embeddings( | |
| is_mm_embed_buf = self.is_mm_embed_buffers[self.is_mm_embed_idx] | ||
|
|
||
| mm_embeds = list[torch.Tensor]() | ||
| is_mm_embeds = list[torch.Tensor]() | ||
| is_mm_embed = is_mm_embed_buf.cpu | ||
| is_mm_embed[:total_num_scheduled_tokens] = False | ||
|
|
||
|
|
@@ -2415,6 +2416,10 @@ def _gather_mm_embeddings( | |
| True if is_embed is None else is_embed | ||
| ) | ||
| mm_embeds_req.append(mm_embeds_item) | ||
| is_mm_embeds.append( | ||
| is_mm_embed[:total_num_scheduled_tokens].to(self.device) | ||
| ) | ||
| is_mm_embed[:total_num_scheduled_tokens] = False | ||
|
|
||
| if self.is_multimodal_pruning_enabled and self.uses_mrope: | ||
| assert req_state.mrope_positions is not None | ||
|
|
@@ -2433,7 +2438,13 @@ def _gather_mm_embeddings( | |
| mm_embeds.extend(mm_embeds_req) | ||
| req_start_idx += num_scheduled_tokens | ||
|
|
||
| is_mm_embed = is_mm_embed_buf.copy_to_gpu(total_num_scheduled_tokens) | ||
| if not mm_embeds_req: | ||
| is_mm_embeds.append( | ||
| torch.tensor( | ||
| [False] * total_num_scheduled_tokens, device=self.device | ||
| ) | ||
| ) | ||
| mm_embeds.append(torch.empty((0, 0), device=self.device)) | ||
|
|
||
| if should_sync_mrope_positions: | ||
| self._calc_mrope_positions(scheduler_output) | ||
|
|
@@ -2443,7 +2454,7 @@ def _gather_mm_embeddings( | |
| self._calc_xdrope_positions(scheduler_output) | ||
| self.xdrope_positions.copy_to_gpu(total_num_scheduled_tokens) | ||
|
|
||
| return mm_embeds, is_mm_embed | ||
| return mm_embeds, is_mm_embeds | ||
|
|
||
| def get_model(self) -> nn.Module: | ||
| # get raw model out of the cudagraph wrapper. | ||
|
|
@@ -2645,15 +2656,15 @@ def _preprocess( | |
| encoder_cache=self.encoder_cache, | ||
| ) as ec_connector_output: | ||
| self._execute_mm_encoder(scheduler_output) | ||
| mm_embeds, is_mm_embed = self._gather_mm_embeddings(scheduler_output) | ||
| mm_embeds, is_mm_embeds = self._gather_mm_embeddings(scheduler_output) | ||
|
|
||
| # NOTE(woosuk): To unify token ids and soft tokens (vision | ||
| # embeddings), we always use embeddings (rather than token ids) | ||
| # as input to the multimodal model, even when the input is text. | ||
| inputs_embeds_scheduled = self.model.embed_input_ids( | ||
| self.input_ids.gpu[:num_scheduled_tokens], | ||
| multimodal_embeddings=mm_embeds, | ||
| is_multimodal=is_mm_embed, | ||
| is_multimodals=is_mm_embeds, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interface change breaks other multimodal modelsHigh Severity The parameter name in Additional Locations (1) |
||
| ) | ||
|
Comment on lines
2664
to
2668
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change, which passes To address this, you could either:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As the critical message, this commit should modify the interface |
||
|
|
||
| # TODO(woosuk): Avoid the copy. Optimize. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.