Skip to content

[Deps] Bump transformers to 5.17.0 - #39012

Merged
Fridge003 merged 17 commits into
mainfrom
mmangkad/bump-transformers-5.17.0
Sep 30, 2026
Merged

Fridge003 merged 17 commits into
mainfrom
mmangkad/bump-transformers-5.17.0

Conversation

@mmangkad

@mmangkad mmangkad commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Bump transformers 5.12.1 -> 5.17.0 (tokenizers 0.22.2 -> 0.23.2, required by it), drop the compat patches upstream has made dead, and port the 5.17.0 vision rotary refactor.

The tokenizers<0.23 note goes away: CLIPTokenizer round-trips identically on slow and fast backends at 0.23.2.

Patches removed

Patch Why it is dead
_patch_nemotron_h_pattern Upstream maps M/* -> linear_attention/full_attention and handles -. Forcing the legacy names now makes the config's own validator reject it.
_ensure_clean_up_tokenization_compat clean_up_tokenization is back on PreTrainedTokenizerBase.
is_flash_attn_greater_or_equal_2_10 half of _patch_removed_symbols Back on transformers.utils.
ROCm dynamic_module_utils symlink hot-patch Fixed upstream in 5.13.0 (transformers#46618).

is_torch_fx_available is still absent, so that patch stays.

Changes that are not mechanical

Config registration. transformers now ships native configs for types SGLang defines its own classes for, and AutoConfig.register without exist_ok silently lost to them. Register with exist_ok=True only where no _CONFIG_REGISTRY re-parse backs the entry up (zaya, cosmos3_edge). _LazyAutoMapping keys on the config class __name__, so a differently-named shadow would drop out of PROCESSOR/TOKENIZER/MODEL_MAPPING. cosmos3_omni keeps losing to the native Cosmos3OmniConfig for that reason.

Gemma4 attention shapes. transformers now states Gemma4's global/SWA split as a heterogeneous per_layer_config -- the base attributes are the sliding-window values and the full-attention layers override head_dim (plus num_key_value_heads where the checkpoint sets it) -- and consumes global_head_dim / num_global_key_value_heads building it. A plain text_config.head_dim read raises AmbiguousGlobalPerLayerAttributeError, so every Gemma4 launch died in get_config. The parser takes both shapes off concrete layer indices, then drops the spec once it has flattened them onto SGLang's base / swa_* pair. A spec declaring anything beyond those two attributes, or a layer type carrying more than one shape, is rejected rather than silently flattened: SGLang carries one shape per layer type, and dropping the spec would revert the rest to the global value with the weights still loading.

embedding_rowwise. transformers appends embed_tokens: embedding_rowwise to base_model_tp_plan for every tied-embedding config. The style targets an nn.Embedding, which the Transformers backend shards itself in replace_vocab_embed_class, but _normalize_tp_plan rejected the unknown name up front and those models stopped loading.

layer_types length. Step-3.5-Flash lists an entry per main and next-n-predict layer (45 + 3), which the strict validate_layer_type in 5.17 rejects. The new patch re-runs the original validator against the wider count, so every other rule it applies -- per-list vocabularies, legacy remapping -- still holds.

_patch_rope_parameters_validation. Narrowed to swallow the missing max_position_embeddings rather than skip standardize_rope_params outright. The call also resolves default_rope_type, so the blanket early return left every config without max_position_embeddings on "default". Pixtral's vision config is exactly that, and its tower refuses to build unless it sees "axial".

Pixtral's rope table is unchanged: the axial PixtralVisionRotaryEmbedding indexes the (h, w) grid pairs that this file's own position_meshgrid already produces, instead of the flattened h * max_width + w offsets. TestPixtralVisionRope pins it to the closed form so an upstream change to the recomposition cannot silently rotate every patch by the wrong angle.

Verification

4x GB300. Unit suites for configs, utils, tokenizer, parser, multimodal, managers, models, model_executor, server_args and entrypoints pass (3021 cases).

Check Result
GSM8K 200q greedy, Nemotron-Nano-9B-v2 0.880 (5.12.1 baseline: 0.875)
GSM8K 200q greedy, granite-4.0-h-tiny 0.815 (5.12.1 baseline: 0.815)
Qwen2.5-VL-3B Answers image prompts
gemma-4-E2B-it Answers chat prompts; head_dim 512 full / 256 SWA
Pixtral-12B Byte-identical greedy output before and after, including a two-image request whose grids differ in aspect ratio

CI States

Latest PR Test (Base): ✅ Run #36317514667
Latest PR Test (Extra): ⚠️ Not run on latest push -- push again to dispatch.
Latest PR Test (AMD ROCm 10): ❌ Run #36317514605

@mmangkad mmangkad added run-ci CI: run the baseline test suite on this PR bypass-fastfail run-ci-extra CI: also run the extra suite (requires run-ci) labels Sep 11, 2026
@mmangkad
mmangkad requested a review from adarshxs as a code owner September 11, 2026 14:46
@Jiminator Jiminator closed this Sep 14, 2026
@Jiminator
Jiminator deleted the mmangkad/bump-transformers-5.17.0 branch September 14, 2026 04:42
@mmangkad
mmangkad force-pushed the mmangkad/bump-transformers-5.17.0 branch from eb5e341 to df35f7d Compare September 21, 2026 10:51
krisztian-gajdar added a commit to superlinked/sie that referenced this pull request Sep 22, 2026
GLM-5.3-Flash's chat template always opens a thinking block and never
reads enable_thinking. The queued worker hides reasoning only when a model
declares chat_template_kwargs.enable_thinking, so a queued response carried
the reasoning and its closing </think> tag in front of the answer.
Declaring it true marks that reasoning private there. On the direct route
the glm45 reasoning parser splits it off in the engine, and the proxy
already drops the split field.

The image comment named the wrong cause. The pinned engine resolves
transformers 5.12.1, which has no glm5_next processor, so SGLang falls back
to a bare tokenizer and never expands an image (sgl-project/sglang#39831).
The engine's transformers bump (sgl-project/sglang#39012) is the fix to wait
for.

A cold start on eight H100s exceeded the 1800 s startup budget when reading
the 306 GiB checkpoint took 25 minutes. The budget is now 3600 s.

Grammar and tool calling stay unclaimed, and the comment now says why.
krisztian-gajdar added a commit to superlinked/sie that referenced this pull request Sep 22, 2026
* fix(config): keep GLM-5.3-Flash reasoning private on every route

GLM-5.3-Flash's chat template always opens a thinking block and never
reads enable_thinking. The queued worker hides reasoning only when a model
declares chat_template_kwargs.enable_thinking, so a queued response carried
the reasoning and its closing </think> tag in front of the answer.
Declaring it true marks that reasoning private there. On the direct route
the glm45 reasoning parser splits it off in the engine, and the proxy
already drops the split field.

The image comment named the wrong cause. The pinned engine resolves
transformers 5.12.1, which has no glm5_next processor, so SGLang falls back
to a bare tokenizer and never expands an image (sgl-project/sglang#39831).
The engine's transformers bump (sgl-project/sglang#39012) is the fix to wait
for.

A cold start on eight H100s exceeded the 1800 s startup budget when reading
the 306 GiB checkpoint took 25 minutes. The budget is now 3600 s.

Grammar and tool calling stay unclaimed, and the comment now says why.

* fix(config): size the GLM-5.3-Flash startup budget to the slowest measured cold start

Two cold starts on slow hosts took about 32 and 36 minutes, most of it
reading the checkpoint. 2400 s covers both without doubling the budget.

@JustinTong0323 JustinTong0323 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yury-tokpanov

Copy link
Copy Markdown

looking forward this change, it's needed to GLM-5.3-Flash, without it image processor is not working

@JustinTong0323

Copy link
Copy Markdown
Collaborator

/rerun-failed-ci

@JustinTong0323

Copy link
Copy Markdown
Collaborator

/rerun-failed-ci

1 similar comment
@JustinTong0323

Copy link
Copy Markdown
Collaborator

/rerun-failed-ci

@HaiShaw

HaiShaw commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

@bingxche @michaelzhang-ai can you run a check on ROCm?

@mmangkad mmangkad added bypass-fail-fast CI: a failing job no longer aborts its siblings (lint still gates) parallel-stages CI: stages dispatch together instead of waiting on each other max-concurrency CI: a suite fans out to every shard; apply before triggering the run and removed high priority bypass-fastfail labels Sep 27, 2026
@Fridge003
Fridge003 merged commit 547286b into main Sep 30, 2026
478 of 523 checks passed
@Fridge003
Fridge003 deleted the mmangkad/bump-transformers-5.17.0 branch September 30, 2026 19:52
adarshxs added a commit to adarshxs/sglang that referenced this pull request Oct 26, 2026
Resolve conflicts and port the transformers backend to current main:

- pyproject: keep main's transformers==5.19.0 and uvicorn>=0.51 pins
  (drop this branch's 5.15.0 bump).
- model_config: keep main's EmbeddingGemma2 context clamp and apply the
  transformers embedding-plan clamp on top of it.
- lora_manager.set_lora_module: keep main's **kwargs passthrough together
  with the transformers LoRA adapter wrap.
- Delete the old models/transformers.py and port main's two changes to it:
  the embedding_rowwise TP-style alias (sgl-project#39012) into layers.py, and the
  pad_mm_tokens helper (sgl-project#44845) into MultiModalMixin.pad_input_ids. Export
  _normalize_tp_style from the package for test_hf_transformers.
- trtllm_mha_backend: drop this branch's causal= kwarg; main added the
  identical line, and the auto-merge produced a repeated keyword.
- Parallel linear layers take parallel_group instead of tp_rank/tp_size
  (sgl-project#42588): the fused QKV projection partitions on "attn_tp" and unfused
  K/V shards use ReplicatedParallelGroup("attn_tp", tp_size // kv_heads).
  TP unit tests build group stubs via sglang.test.parallel_groups.
- test_transformers_graph: drop the TCPCG fullgraph compile test, since
  the backend is retired and its custom attention op removed
  (sgl-project#42287, sgl-project#42288); give the hand-built PrefillCudaGraphRunner the
  attributes main's replay path now reads.
- test_embedding_model_spec: the support matrix has 10 rows (ModernBert
  and Roberta from this branch plus main's EmbeddingGemma2).
- test_transformers_fallback: follow main's removal of the skip-substrs
  test (sgl-project#43503).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

amd bypass-fail-fast CI: a failing job no longer aborts its siblings (lint still gates) dependencies Pull requests that update a dependency file max-concurrency CI: a suite fans out to every shard; apply before triggering the run npu parallel-stages CI: stages dispatch together instead of waiting on each other release-highlight Candidate PR for release note highlight run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants