Transformers runs Mistral Large 4 and trains LoRA on FP8 checkpoints

1 hour ago

Transformers v5.21.1 to v5.22.1: Mistral Large 4 and NVIDIA Nemotron 3.5 Transcribe, LoRA training on FP8 checkpoints with a tenth of the expert backward memory, remote-code models loading in vLLM again, token= reaching private repos, and expert parallelism in its own module. https://github.com/huggingface/transformers/releases/tag/v5.22.0 https://github.com/huggingface/transformers/releases/tag/v5.21.1 https://github.com/huggingface/transformers/releases/tag/v5.22.1 https://github.com/huggingface/transformers/compare/v5.20.2...v5.22.1

Ask about this presentation

Chapters

  1. 0:00Mistral Large 4
  2. 0:17One set of weights
  3. 0:29Hardware
  4. 0:47License
  5. 1:02Nemotron 3.5 Transcribe
  6. 1:19Training on FP8 checkpoints
  7. 1:22LoRA on FP8
  8. 1:37FP8 backward memory
  9. 1:50Fixed
  10. 1:52vLLM remote code
  11. 2:08Private repos
  12. 2:24Integer labels
  13. 2:37Pinned revisions
  14. 2:52Model fixes
  15. 3:09Changed
  16. 3:11Expert parallelism
  17. 3:26Release notes
Show transcript
  1. Transformers now runs Mistral Large 4, the largest model Mistral has made. It's a mixture of experts with about a trillion parameters, 49 billion of them active per token, and it takes text and images as input.

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

    Transformers now runs Mistral Large 4

    About 1T parameters 49B active per token Text and image in
    Mistral Large 4 (Le Chonk), the image from the v5.22.0 release notes
  2. Mistral Large 4 reads up to a million tokens of context, works in more than 160 languages, and takes a reasoning effort on each request, from a quick reply to a long agent run.

    Slide text
    Transformers
    01 02 03 04 New models
    huggingface/transformers · release v5.22.0

    One set of weights for chat, reasoning, code and agents

    Context 1M tokens
    Languages 160+, including every official EU language
    Reasoning effort set on each request
  3. The checkpoint ships in FP8 and needs about a terabyte of GPU memory, spread across several GPUs. Its sparse attention runs as a mask over dense attention: the outputs match, but long sequences don't get faster.

    Slide text
    Transformers
    01 02 03 04 New models
    Transformers docs · Mistral Large 4 model page · PR #50121

    Mistral Large 4 needs about 1 TB of GPU memory

    Checkpoint FP8, loaded as is
    Placement device_map="auto" spreads it across GPUs
    Sparse attention runs as a mask: same outputs, no long-sequence speed-up
  4. The weights come under the Mistral Ecosystem Open-Weight License, a modified MIT license for commercial and non-commercial use. Running it as a hosted model service needs a separate license from Mistral.

    Slide text
    Transformers
    01 02 03 04 New models
    huggingface/transformers · release v5.22.0

    Commercial use is allowed, except running it as a service

    Mistral Ecosystem Open-Weight License, a modified MIT license

  5. NVIDIA's Nemotron 3.5 Transcribe also lands. It transcribes many languages, tags who is speaking, translates speech, answers questions about audio, and times every word. Word timestamps need torchaudio and SciPy installed.

    Slide text
    Transformers
    01 02 03 04 New models
    huggingface/transformers · release v5.22.0 · PR #50084 · model page

    Nemotron 3.5 Transcribe turns audio into text, speakers and word times

    Multilingual transcription Speaker tags Speech translation Audio questions Word timestamps

    Word timestamps need torchaudio and scipy

  6. Part two: training on FP8 checkpoints.

    Slide text
    Transformers
    01 02 03 04 FP8 training
    02
  7. You can now train LoRA adapters with PEFT on top of an FP8 checkpoint. Before, the FP8 layers silently dropped gradients to earlier layers, and grouped experts crashed in backward. FP4 weights still can't train.

    Slide text
    Transformers
    01 02 03 04 FP8 training
    huggingface/transformers · release v5.22.0 · PR #50031

    LoRA adapters now train on FP8 checkpoints

    Before gradients to earlier layers were silently dropped, and grouped experts crashed in backward
    Still waiting FP4 weights, and the batched_mm and DeepGEMM experts
  8. Training those experts got cheaper too. The backward pass now dequantizes experts in small chunks, so a DeepSeek V3 sized expert layer peaks under 3 gigabytes instead of nearly 29.

    Slide text
    Transformers
    01 02 03 04 FP8 training
    huggingface/transformers · release v5.22.0 · PR #50117

    The expert backward pass needs a tenth of the memory

    Before
    28.9 GiB
    Now
    2.8 GiB

    Peak memory, one mixture-of-experts layer backward, DeepSeek-V3 shapes, 8k tokens

  9. Part three: what stopped breaking.

    Slide text
    Transformers
    01 02 03 04 Fixed
    03
  10. The last release changed how configs set rope scaling, and that broke remote-code models in vLLM. Phi 3.5 vision, InternVL2, EAGLE3 speculators and others load again in the patch release.

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

    Remote-code models load in vLLM again

    Phi-3.5-vision InternVL2 ERNIE-4.5-VL EAGLE3 speculators Step-3.7-Flash
  11. Passing a token to from_pretrained now opens private and gated repos. The config step dropped it, so loading failed with a 401 error unless the HF_TOKEN environment variable was also set, which hit clean CI machines.

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

    token= now opens private and gated repos

    Before: a 401 error unless HF_TOKEN was also set

  12. The default data collator turned NumPy integer labels into floats, which can break a cross-entropy loss. Labels typed as int32 or int64 now stay integers.

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

    NumPy integer labels stay integers

    np.int64 label → float32 in default_data_collator

    Integer labels feed CrossEntropyLoss as integers again

  13. Pin a remote-code revision in a pipeline, and before, only the config honored it. Now the model, tokenizer and processor load that revision too, and saved tokenizers stop writing the pin into their config file.

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

    code_revision now pins every part of a pipeline

    Before only the config loaded the pinned code
    Now the model, tokenizer and processor do too
    Saved tokenizers stop writing the pin into their config
  14. Janus stops splitting a string prompt into one character per row. ESMFold2 Fast stops running a randomly initialized MSA encoder, so its structures no longer change between loads. And TimesFM runs in half precision without overflowing.

    Slide text
    Transformers
    01 02 03 04 Fixed
    huggingface/transformers · release v5.22.0 · PRs #50044, #49890, #50021

    Fixes for Janus, ESMFold2 and TimesFM

    Janus a string prompt is no longer split into one-character rows
    ESMFold2-Fast no random MSA encoder, so each load folds the same
    TimesFM fp16 runs stop overflowing on the padding value
  15. Part four: one breaking change.

    Slide text
    Transformers
    01 02 03 04 Changed
    04
  16. Expert-parallel code moved into its own file, with no change in behavior. Custom expert-parallel styles are affected. Old imports keep working, with a warning, until version 5.23.

    Slide text
    Transformers
    01 02 03 04 Changed
    huggingface/transformers · release v5.22.0 · PR #49679

    Expert parallelism moves into its own module

    Who it affects code that subclasses the expert-parallel styles
    Old imports keep working with a FutureWarning until v5.23
  17. If you fine-tune mixture-of-experts models, I'd take this release today for FP8 adapter training alone. Everything else is in the Transformers release notes on GitHub.

    Slide text
    Transformers
    01 02 03 04 Changed
    huggingface/transformers · release v5.22.0 · v5.22.1

    Fine-tuning MoE models from FP8? Upgrade now.

    Full list: the Transformers v5.22.0 release notes on GitHub

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