[emu3] 🦮 Black Labrador is back! Fix image generation broken since #37033 (#47948)
* [emu3] Fix image generation broken since #37033
`Emu3ForConditionalGeneration.forward()` received `pixel_values` and
`image_sizes` but never forwarded them to `self.model()`, so images
were silently ignored and generation produced garbage output.
Two fixes:
- Pass `pixel_values` and `image_sizes` to `self.model()` in
`Emu3ForConditionalGeneration.forward()` (modular + modeling files)
- Cast `pixel_values` to the VQVAE's dtype in `Emu3VQVAE.encode()`
to handle float16 inputs with float32 conv weights (PyTorch 2.13+
is stricter about dtype mismatches than earlier versions)
Also update the expected integration test string to match current
model output (minor generation difference due to PyTorch version).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [emu3] Add dtype cast to modular file to match modeling file
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [emu3] Fix expected strings for test_model_generation_batched on A10G (cuda:8)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [emu3] Fix OOM in test_model_generation_multi_image and update expected strings for A10G
- Reduce image processor resolution to 32x32 tokens (256x256 pixels) in
test_model_generation_multi_image to avoid SDPA OOM on A10G (two 64x64
images produce ~8192 tokens, requiring 8+ GiB for attention alongside
the 4-bit quantized model)
- Update ("cuda", 8) expected strings for both test_model_generation_batched
and test_model_generation_multi_image to match actual A10G outputs
- Use 200x200 image downloads consistently across all integration tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [emu3] Expose vocabulary_mapping as property on Emu3ForConditionalGeneration
After #37033 split the monolithic class into Emu3Model + head, vocabulary_mapping
moved into Emu3Model. Add a property on Emu3ForConditionalGeneration to delegate
to self.model.vocabulary_mapping, restoring the public API.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [emu3] Add setUp/tearDown cleanup to Emu3IntegrationTest to free GPU memory between tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com> Y
Yih-Dar committed
60eefbc8141a028609875951f5170086631d9605
Parent: 7acb594
Committed by GitHub <noreply@github.com>
on 8/14/2026, 12:54:23 PM