Skip to content

Commit

Permalink
Mllama fsdp (#36000)
Browse files Browse the repository at this point in the history
* pixel input assignment revoked

* double send

* Update src/transformers/models/mllama/modeling_mllama.py

Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com>

---------

Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com>
  • Loading branch information
blbadger and qubvel authored Feb 13, 2025
1 parent 847854b commit 1614d19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/transformers/models/mllama/modeling_mllama.py
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,9 @@ def forward(
aspect_ratio_ids = aspect_ratio_ids.reshape(batch_size * num_concurrent_media, -1)

# Patch embedding
patch_embeds = self.patch_embedding(pixel_values.to(self.dtype).to(self.device))
target_dtype = self.patch_embedding.weight.dtype
target_device = self.patch_embedding.weight.device
patch_embeds = self.patch_embedding(pixel_values.to(target_device, target_dtype))
hidden_state = patch_embeds.flatten(2).transpose(1, 2)

# Tile embeddings
Expand Down

0 comments on commit 1614d19

Please sign in to comment.