Transformers v5.19.0: EmbeddingGemma 2 and token-dispatch expert parallelism
1 month ago
Transformers v5.19.0 release notes: EmbeddingGemma 2, token-dispatch expert parallelism, continuous batching in SDPA and flash attention, per-layer cache config, and changed MoE and OWLv2 outputs. https://github.com/huggingface/transformers/releases/tag/v5.19.0 https://huggingface.co/docs/transformers/main/en/model_doc/embedding_gemma2
Ask about this presentation
Chapters
0:00EmbeddingGemma 2 arrives
0:10One vector space for every input
0:21Shorter embeddings
0:37Load only the towers you need
0:48Expert parallelism
0:50Token dispatch
1:03Default for Qwen3 MoE
1:14Trainer and PEFT
1:27Continuous batching
1:28Regular attention runs continuous batching
1:41Fused cache update
1:53Cache
1:54Per-layer cache config
2:07Quantized cache fixes
2:17Changed outputs
2:19Router logits from every MoE model
2:31OWLv2 query by objectness
2:46Fixes you may have hit
3:00Release notes
Show transcriptHide transcript
Transformers v5.19.0 adds EmbeddingGemma 2. It's a multimodal embedding model from Google, built on the Gemma 4 architecture.
It encodes text, images, audio and video, one at a time or mixed in a single input, into one shared space. So a text query and a photo can be compared directly.
Embeddings come out at 768 dimensions. Because it's trained with Matryoshka Representation Learning, you can keep just the first 512, 256 or 128, and the docs report minimal quality loss.
Embedding only text? You can disable the vision or audio tower at load time to save memory. The token budget per image or video frame is configurable as well.
Expert parallelism.
Expert parallelism gets a second mode, token dispatch. Each rank keeps its own tokens and sends only routed tokens to the experts' owners, so expert and tensor parallel sizes become independent.
Token dispatch is now the default for Qwen3 MoE and Mellum. The older masked mode, where every rank sees every token, is still there if your plan selects it.
The Trainer now works with expert parallelism. Tensor and expert parallel plans are decoupled, each with its own device mesh. And the docs now cover tensor parallelism for PEFT adapters.
Continuous batching.
The standard SDPA and flash attention functions now support continuous batching themselves. So the paged prefix on those two is deprecated. Eager attention still needs its paged prefix.
Inside continuous batching, the index path and block table path now update the cache in one fused call. Custom code that called those update paths separately will need changes.
The cache.
DynamicCache and StaticCache used to reuse one set of settings for every layer. Now each layer reads its own sliding window, chunk size, conv states and head counts, which suits models with mixed layers.
Generate used to edit the cache config you passed, so a second model could inherit the first one's settings. And beam search now reorders quantized cache states correctly.
Outputs that change.
Ask for router logits, and every mixture of experts model whose router computes them now returns them, the way Qwen3 MoE already did. With the flag off, the defaults are unchanged.
OWLv2 image-guided detection now picks the query box with the highest objectness, as the original OWLv2 notebook does. Here, the old pick boxed the whole lemon photo. Expect detections to differ from earlier releases.
The language modeling data collator no longer ignores a seed of zero. Deprecated pipeline tasks now redirect. And Trainer subclasses can declare whether their loss is already scaled for gradient accumulation.
The full list of changes is in the Transformers v5.19.0 release notes on GitHub. That's Transformers 5.19: EmbeddingGemma 2, and token dispatch for expert parallelism.
Up next
3:39Transformers runs Mistral Large 4 and trains LoRA on FP8 checkpoints
@hugging-face
1 week ago
2:43huggingface_hub v2.4.0 copies files into Buckets and flags outdated CLI extensions
@hugging-face
1 week ago
3:05huggingface_hub v2.3.0 lists an 800,000-file dataset in 20 seconds, down from 13 minutes
@hugging-face
3 weeks ago
2:27Transformers adds Reflection AI’s Beam and loads models on PyTorch 2.7 again
@hugging-face
3 weeks ago
3:46Transformers v5.20.0 runs Meta's Muse Spark Open, and here is the hardware it needs
@hugging-face
1 month ago
3:18huggingface_hub 2.2.0: hf jobs stats prints a snapshot, and parallel downloads always use hf_xet
@hugging-face
1 month ago
2:53huggingface_hub's HfFileSystem now downloads a 2 GB bucket file in seconds
@hugging-face
1 month ago
3:12Transformers v5.18.0: streaming speaker diarization, GGUF mixture-of-experts, FSDP2 with expert parallelism
@hugging-face
1 month ago
2:12What huggingface_hub 2.0 changes, and why transformers keeps you on 1.x for now
@hugging-face
1 month ago

