Skip to content
IJK

Model Integration Contracts: Why Scheduled GPU Runs Lag

By IJK ·

The gap the Transformers post describes in scheduled test runs, what a model integration contract checks and what a small fixture must preserve.

The gap in scheduled runs

The integration tests load real checkpoints and exercise the model's API on real hardware. [1]

Running all of that on every PR would mean keeping a lot of GPUs busy all day long, which isn't practical. [2]

By the time a scheduled run finds a regression, it may already be in main. [3]

laterPull request mergesfull GPU tests are not run on every PRChange is in mainScheduled run finds itit may already be in main
Why can a regression reach main before a scheduled run finds it?

What a contract checks

For example, the SmolLM contract generates from prompts such as "The capital of France is" and compares its token IDs with a recorded answer. [4]

It also compares training loss, checks that gradients are finite and verifies that an optimizer step changes the weights. [5]

A fleet dataset on the Hub pins each MIC to a frozen revision, along with the package versions used to record its baselines. [6]

What the fixture must preserve

One detail mattered: the contract used SDPA, the default attention path. [7]

Running only the eager attention variant missed the bug. [8]

A fixture only helps if it goes through the same code as the real checkpoint. [9]

Keeping two layers is no use if both use sliding attention and the full-attention layers disappear. [10]

Preserve vocabulary, special tokens and input dimensions, and copy tokenizer and processor files byte for byte. [11]

Sources

  1. The Hugging Face source says: The integration tests load real checkpoints and exercise the model's API on real hardware. Transformers Model Integration Contracts
  2. The Hugging Face source says: Running all of that on every PR would mean keeping a lot of GPUs busy all day long, which isn't practical. Transformers Model Integration Contracts
  3. The Hugging Face source says: By the time a scheduled run finds a regression, it may already be in main. Transformers Model Integration Contracts
  4. The Hugging Face source says: For example, the SmolLM contract generates from prompts such as "The capital of France is" and compares its token IDs with a recorded answer. Transformers Model Integration Contracts
  5. The Hugging Face source says: It also compares training loss, checks that gradients are finite and verifies that an optimizer step changes the weights. Transformers Model Integration Contracts
  6. The Hugging Face source says: A fleet dataset on the Hub pins each MIC to a frozen revision, along with the package versions used to record its baselines. Transformers Model Integration Contracts
  7. The Hugging Face source says: One detail mattered: the contract used SDPA, the default attention path. Transformers Model Integration Contracts
  8. The Hugging Face source says: Running only the eager attention variant missed the bug. Transformers Model Integration Contracts
  9. The Hugging Face source says: A fixture only helps if it goes through the same code as the real checkpoint. Transformers Model Integration Contracts
  10. The Hugging Face source says: Keeping two layers is no use if both use sliding attention and the full-attention layers disappear. Transformers Model Integration Contracts
  11. The Hugging Face source says: Preserve vocabulary, special tokens and input dimensions, and copy tokenizer and processor files byte for byte. Transformers Model Integration Contracts

Editorial (AI-assisted; automatically checked, not human-reviewed). Each statement is linked to its source; check the source before relying on a detail.

  • transformers
  • testing
  • ci
  • machine learning