Transformers now runs Flash Attention with no extra install, and loads Amazon's Ergo

1 day ago

Transformers v5.24.1 to v5.25.0: kernels now ship with Transformers and switch on when a model loads, so Flash Attention works without installing flash-attn; Amazon's Ergo, Aleph Alpha's Kolibri 1.1, Physical Intelligence's PI0.5, LLaVA-OneVision-1.5, Ovis2.5, MiniCPM5 and Param2Moe arrive; assisted decoding reaches linear attention models; generate() compiles on Apple silicon; and transformers serve splits into two processes.

Ask about this presentation

Chapters

Show transcript
  1. Transformers now installs the kernels library and switches it on whenever you load a model. Layers like RMSNorm and RoPE get faster, most of all in linear attention models such as Qwen 3.5.

    Slide text
    Transformers
    01 02 03 04 Kernels
    huggingface/transformers · release v5.25.0 · PR #47773

    Transformers now speeds up models out of the box with Hub kernels

    RMSNorm RoPE Activations Mamba FLA

    Biggest gains on linear attention models such as Qwen3.5

  2. Ask for Flash Attention 2 and it now works even when the flash attention package is missing. Transformers fetches the matching kernel from the Hub instead.

    Slide text
    Transformers
    01 02 03 04 Kernels
    huggingface/transformers · release v5.25.0 · Kernels becomes a default dependency

    Flash Attention works without installing flash-attn

    You ask for flash_attention_2 when loading
    Transformers loads the matching kernel from the Hub on supported hardware
  3. It needs a compatible kernels release, and one loading option turns it off. On AMD ROCm, deformable attention now gets a Hub kernel too.

    Slide text
    Transformers
    01 02 03 04 Kernels
    huggingface/transformers · release v5.25.0 · PRs #47773, #51488

    Kernels by default still has limits

    Version needs a compatible kernels release
    Opt out one loading option keeps the old behaviour
    AMD ROCm gains the deformable attention kernel
  4. Part two. New models.

    Slide text
    Transformers
    01 02 03 04 New models
    02
  5. Amazon's Ergo now loads in Transformers. It has 1.1 trillion parameters, 55 billion active, and a million-token context, built for coding and agent work.

    Slide text
    Transformers
    01 02 03 04 New models
    huggingface/transformers · release v5.25.0 · PR #51575

    Amazon's Ergo loads in Transformers

    1.1T parameters 55B active 1M-token context

    Open weights, built for software engineering and long-running agent tasks

  6. Is that just luck? Ergo comes first on four of its five coding tests. On DeepSWE, though, Kimi K 3.1 Pro still solves more tasks, with Ergo a close second.

    Slide text
    Transformers
    01 02 03 04 New models
    huggingface/transformers · release v5.25.0 · Ergo benchmark chart

    Ergo tops four of five coding charts, but not DeepSWE

    Kimi K3.1 Pro
    77.9
    Ergo
    74.2
    GLM 5.3
    69.5

    DeepSWE, pass@1

  7. Aleph Alpha's Kolibri 1.1 arrives. Every fifth layer scans the whole context but keeps only the opening, latest and top-scoring tokens. It runs on eager or SDPA attention only.

    Slide text
    Transformers
    01 02 03 04 New models
    huggingface/transformers · release v5.25.0 · PR #51176

    Aleph Alpha's Kolibri 1.1 attends to the whole context, sparsely

    Every fifth layer the first 8 tokens, the latest 128, and the 2,048 top-scoring keys
    Reference build eager and SDPA attention only
  8. PI0.5, from Physical Intelligence, controls robot arms. A PaliGemma backbone takes in the camera images and the instruction, and a small Gemma expert predicts the next chunk of movements.

    Slide text
    Transformers
    01 02 03 04 New models
    huggingface/transformers · release v5.25.0 · PR #50161

    Physical Intelligence's PI0.5 turns camera views into robot actions

    PaliGemma backbone takes the camera images and the instruction
    Gemma action expert predicts a chunk of actions with flow matching
  9. LLaVA-OneVision-1.5 arrives in 4 and 8 billion parameter sizes. And Ovis2.5 reads images and video, with an optional mode that thinks before answering.

    Slide text
    Transformers
    01 02 03 04 New models
    huggingface/transformers · release v5.25.0 · PRs #41095, #47659

    Two more models that see

    LLaVA-OneVision-1.5 4B and 8B Instruct, on a Qwen3 backbone
    Ovis2.5 images and video, with an optional thinking mode
  10. MiniCPM5 runs only 2.5 billion of its 15 billion parameters per token. BharatGen's Param 2 speaks English, Hindi and 21 other Indian languages.

    Slide text
    Transformers
    01 02 03 04 New models
    huggingface/transformers · release v5.25.0 · PRs #51218, #46395

    Two light mixture-of-experts models

    MiniCPM5-15B-A2.5B 15B parameters, 2.5B active per token
    Param-2-17B-MoE English, Hindi and 21 Indian languages
  11. Part three. Faster generation.

    Slide text
    Transformers
    01 02 03 04 Generation
    03
  12. Caches holding recurrent states can now roll back a few tokens, so assisted decoding works on linear attention models like recent Qwens. Ernie 4.5 gains multi-token prediction too.

    Slide text
    Transformers
    01 02 03 04 Generation
    huggingface/transformers · release v5.25.0 · PRs #51180, #51518, #51126

    Assisted decoding now reaches linear attention models

    Recurrent caches roll back the few tokens a draft needs
    Ernie 4.5 MoE uses the multi-token prediction layer in its checkpoints
  13. On Apple silicon, generate now compiles itself, as it does on CUDA. Mixture of experts decoding stays on grouped matmuls, and the environment report names the Mac's GPU.

    Slide text
    Transformers
    01 02 03 04 Generation
    huggingface/transformers · release v5.25.0 · PRs #51499, #51486, #51549

    Apple silicon gets compiled generation

    generate() compiles itself on MPS with a static cache, as on CUDA
    MoE decode keeps grouped matmuls with torch 2.15 or newer
    transformers env reports the MPS accelerator
  14. Transformers serve now splits into an API server and a model process, so the GPU stops waiting on requests. More than one API server works only with a single model.

    Slide text
    Transformers
    01 02 03 04 Generation
    huggingface/transformers · release v5.25.0 · PR #50927

    transformers serve stops waiting on HTTP

    Two processes an API server for text, a model process for the GPU
    Several API servers only when serving a single model
  15. Part four. What changed, and what stopped breaking.

    Slide text
    Transformers
    01 02 03 04 Fixed
    04
  16. Speculative sampling no longer slips in a token the model ruled out. Falcon stops doubling its ALiBi bias. And batched image prompts get the same answer as single ones.

    Slide text
    Transformers
    01 02 03 04 Fixed
    huggingface/transformers · release v5.25.0 · PRs #51112, #51359, #51073

    Three silent wrong answers, fixed

    Speculative sampling never accepts a token the model gave zero probability
    Falcon eager attention adds the ALiBi bias once, not twice
    Image-text pipelines a batched prompt gets the same text as on its own
  17. A local checkpoint's index could point anywhere on disk and load weights from there. Transformers now rejects those shard paths.

    Slide text
    Transformers
    01 02 03 04 Fixed
    huggingface/transformers · release v5.25.0 · PR #51138

    A local checkpoint can't load weights from outside its folder

    Shard filenames with .. or an absolute path in model.safetensors.index.json are now rejected.

  18. The 5.25 release notes cover three more changes. Custom processors load their parts a new way, Molmo2 samples video frames differently, so regenerate cached results, and mixture of experts models move to expert parallelism.

    Slide text
    Transformers
    01 02 03 04 Fixed
    huggingface/transformers · release v5.25.0 · PRs #50428, #51325, #51309, #50897 · release v5.24.1 · PR #50996

    Before you upgrade, read the v5.25.0 release notes

    Custom processors sub-processor loading was reworked
    Molmo2 21 video frames where it took 19, and new pooling indices
    MoE models tensor parallelism is deprecated; expert parallelism now runs on its own

What happened in AI today, in your inbox

One short email each evening. Read it and you’re caught up.

Built with ❤️ in New York