Skip to content

build(deps): support Transformers 5.20 - #6490

Open
kamran-nvidia wants to merge 6 commits into
mainfrom
kjafarisadeg/transformers-5.20
Open

kamran-nvidia wants to merge 6 commits into
mainfrom
kjafarisadeg/transformers-5.20

Conversation

@kamran-nvidia

@kamran-nvidia kamran-nvidia commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Widen the supported Transformers range to >=5.15,<5.21 and lock Transformers 5.20.0. The lock was regenerated with uv 0.7.2 (the Dockerfile.ci version), so it stays at lockfile revision 2.
  • Extend two exact-release gates from feat(nemotron): native HF 5.19 Super VL conversion support #6471 that would otherwise break under the 5.20.0 lock:
    • Nemotron 3.5 Super VL: HF 5.20.0 still cannot load the audio-free processor natively, exactly like 5.19.0: the legacy _downsample_factor field is read-only, and an audio feature extractor is required. Keep using the Bridge processor adapter on 5.20.0. The verified releases now live in _PROCESSOR_ADAPTER_RELEASES, so the adapter's real-load tests run on the locked version instead of skipping.
    • MiniMax M3: vision RoPE outputs are bitwise identical between 5.19.0 and 5.20.0 (FP32/BF16/FP16, head dims 8 and 80). The unit test's native buffer-rounding branch therefore now includes 5.20.0. Without this, test_hf_vision_rope_dtype_conversion_matches_version_contract fails on 5.20.0.
  • Support native Super VL on Transformers 5.18.0 as well. HF 5.18.0 ships the same nemotron_h_omni code as 5.19.0 (the module is byte-identical), and plain AutoProcessor fails there in the same way. The native floor drops from 5.19.0 to 5.18.0, and the adapter covers 5.18.0 through 5.20.0. The only HF nemotron_h change between 5.18.0 and 5.19.0 adds MoE router_logits outputs, which Bridge does not read.
  • Read partial_rotary_factor from rope_parameters on Transformers 5.20.0, which no longer exposes it as a config attribute (details under the compatibility review). The new partial_rotary_factor_from_hf helper in models/conversion/transformers_compat.py sits next to the existing rope_theta_from_hf. It reads the attribute on older releases and rope_parameters["partial_rotary_factor"] on 5.20.0. The generic HF-to-Megatron config mapping and the GLM-4.5V bridge use it. The vendored Bailing MoE V2 attention gets the same fallback inline, because that file has to stay standalone.
  • Remove the find_spec("transformers.models.muse_spark") skip guard from the Muse Spark Open conversion test. 5.20.0 ships the module, so a broken Muse Spark setup now fails CI instead of skipping silently.
  • Update the MiniMax M3 and Super VL docs and their nightly fern pages to match.

Lockfile delta

Updated transformers v5.19.0 -> v5.20.0

No other package moved. The locked tokenizers 0.23.3 and huggingface-hub 1.33.0 satisfy Transformers 5.20.0's requirements (tokenizers>=0.23.1,<0.24.0, huggingface-hub>=1.31.0,<3.0).

Compatibility review (5.19.0 to 5.20.0)

  • All 247 transformers imports in src/, tests/, examples/ and scripts/ resolve on 5.20.0 wherever they resolve on 5.19.0. 5.20.0 additionally provides transformers.models.muse_spark.
  • Bridge uses none of the APIs removed in 5.20.0. These include the deprecated Cache methods (get_max_cache_shape, max_cache_len, max_batch_size), the GLUE/SQuAD data helpers, DataCollatorForWholeWordMask/DataCollatorForSOP, and some modeling_utils/masking_utils internals.
  • The remaining Transformers version gates are minimum-version checks, or the MiniMax M3 correction that applies only to 5.17.0. None is affected by 5.20.0.
  • Config change: partial_rotary_factor. 5.20.0 drops the partial_rotary_factor attribute from nearly every HF config class that had one, and from Bridge's vendored BailingMoeV2Config. The value now lives only in config.rope_parameters["partial_rotary_factor"].
    • The first full CI run caught this. L1_Launch_models_glm_vl failed on H100 and GB200 with AttributeError: 'Glm4vMoeTextConfig' object has no attribute 'partial_rotary_factor'.
    • The generic config mapping failed silently. It checks hasattr(hf_config, "partial_rotary_factor"), which is false on 5.20.0. As a result, GLM-4.5, GLM-4.7-Flash, Qwen3-Next, MiMo-V2-Flash and Bailing fell back to full rotary (rotary_percent=1.0), and so did the vendored Bailing attention.
    • The existing unit tests used mocked configs, so they did not catch it.
  • A comparison of the serialized keys of every default HF config between 5.19.0 and 5.20.0, including text, vision and audio sub-configs, found no other removed field that Bridge reads. rope_scaling is unchanged, and rope_theta already lived only in rope_parameters on 5.19.0, where rope_theta_from_hf handles it.

Validation

These are CPU-only results on macOS, with GPU-only packages stubbed. Both runs used full megatron.bridge imports against the pinned MCore, the same code, and Transformers 5.19.0 and 5.20.0 respectively. Tests covered: tests/unit_tests/models/nemotron_omni, tests/unit_tests/models/minimax_m3, tests/unit_tests/models/muse_spark_open, and tests/unit_tests/utils/test_tokenizers_compat.py.

Transformers Passed Skipped (GPU / two-rank) Environment-only failures
5.19.0 247 10 2
5.20.0 247 10 2

The two environment-only failures are identical on both versions: librosa is not installed, and CUDA is unavailable. Before the gate fix, the MiniMax test failed on 5.20.0, and the Super VL adapter tests would have been skipped there.

After the 5.18.0 change, tests/unit_tests/models/nemotron_omni and tests/unit_tests/models/minimax_m3 give identical results on 5.18.0, 5.19.0 and 5.20.0: 227 passed, 10 skipped, and the same two environment-only failures. This includes the adapter's real-load tests on each version.

After merging main, which brings in #6492 and the MCore bump from #6484, the same set gives 250 passed and 10 skipped on 5.20.0, with the same two environment-only failures.

A standalone processor check used the synthetic Super VL processor files from test_native_processor.py. Plain AutoProcessor fails identically on 5.18.0, 5.19.0 and 5.20.0. The adapter loads the processor, handles image and video inputs, and saves and reloads with bitwise-identical outputs on all three versions.

For the partial_rotary_factor fix, the new regression tests build real HF config classes instead of mocks:

  • Qwen2Config, through the generic mapping;
  • Glm4MoeConfig (GLM-4.5);
  • Glm4vMoeTextConfig (GLM-4.5V);
  • the Bailing attention's rotary dimension.

On 5.20.0 none of these configs has a partial_rotary_factor attribute, so all four tests would fail against the old code. The suite below gives 202 passed and 10 skipped on each of 5.18.0, 5.19.0 and 5.20.0:

  • tests/unit_tests/models/test_model_bridge.py
  • tests/unit_tests/models/glm
  • tests/unit_tests/models/glm_vl
  • tests/unit_tests/models/bailing
  • tests/unit_tests/models/mimo_v2_flash
  • tests/unit_tests/models/qwen/test_qwen3_next_bridge.py

uv lock --check and pre-commit run --all-files pass.

CI

The run on 449f7b4 (38829381289) had 134 passing jobs. Its only failures were L1_Launch_models_glm_vl on H100 and GB200, caused by the partial_rotary_factor change above. e9e58a6 fixes it, and CI was re-triggered on that commit, superseding the earlier run before its last jobs finished.

Muse Spark Open

5.20.0 ships transformers.models.muse_spark. The text-only export fix for 5.20.0 landed separately in #6492, and this branch picks it up through the merge of main. With the skip guard removed, all four Muse Spark Open conversion tests run: the TP2, PP2 and EP2 round-trips and the text-only export logits check.

In the run on 449f7b4, L0_Launch_models_muse_spark_open reported 4 passed and 0 skipped on both H100 and GB200. Muse Spark Open has no L1 or L2 launchers. The 51 Muse Spark unit tests that CI collects also pass locally on 5.20.0, with none skipped.

Test plan

  • L0 CI green
  • L1 CI green (the full-test-suite label also runs L1)
  • L2 CI green (label full-test-suite applied)

Quarantined tests (this bump)

None. The GLM-VL L1 failure was a real 5.20.0 regression, so it is fixed in this PR rather than quarantined.

kamran-nvidia and others added 2 commits October 15, 2026 14:10
Widen the supported range to transformers>=5.15,<5.21 and lock 5.20.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Kamran Jafari <kjafarisadeg@nvidia.com>
Two gates from #6471 list exact Transformers releases and would break
under the 5.20.0 lock:

- Super VL: HF 5.20.0 still fails to load the audio-free processor
  natively (read-only legacy _downsample_factor, required audio feature
  extractor), so keep using the Bridge adapter on 5.20.0. Track the
  verified releases in _PROCESSOR_ADAPTER_RELEASES so the adapter tests
  run, rather than skip, on the locked version.
- MiniMax M3: the vision RoPE output is bitwise identical to 5.19.0 in
  FP32/BF16/FP16, so 5.20.0 follows the native buffer-rounding contract
  in the unit test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Kamran Jafari <kjafarisadeg@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Comment thread src/megatron/bridge/models/nemotron_omni/hf_pretrained.py Outdated
Transformers 5.18.0 ships the same native nemotron_h_omni code as 5.19.0
(byte-identical module; nemotron_h only adds MoE router_logits outputs),
and plain AutoProcessor fails there in the same way. Lower the native
Super VL floor from 5.19.0 to 5.18.0 and add 5.18.0 to the processor
adapter releases.

Signed-off-by: Kamran Jafari <kjafarisadeg@nvidia.com>
cuichenx
cuichenx previously approved these changes Oct 15, 2026
@cuichenx cuichenx added ci CI, automation, test queue, or workflow infrastructure work area:build Dependencies, packaging, images, and environment setup full-test-suite labels Oct 15, 2026
@kamran-nvidia
kamran-nvidia marked this pull request as ready for review October 16, 2026 00:16
@kamran-nvidia
kamran-nvidia requested a review from a team as a code owner October 16, 2026 00:16
Signed-off-by: Kamran Jafari <kjafarisadeg@nvidia.com>
@kamran-nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 76d7af6

@github-actions

Copy link
Copy Markdown
Contributor

Automatic Claude reviews have been retired. To request a pull-request review, post a comment containing:

/review

Add model=claude to use a Claude reviewer (the default is model=codex). mode=light|strict selects the review depth; for example, /review model=claude mode=strict. Comment /review help for all options.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Transformers is now locked to 5.20.0, which ships
transformers.models.muse_spark. Drop the find_spec skip guard so a
missing module fails the L0 job instead of passing with every test
skipped.

Signed-off-by: Kamran Jafari <kjafarisadeg@nvidia.com>
@kamran-nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 449f7b4

@kamran-nvidia

Copy link
Copy Markdown
Contributor Author

/review

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No verified findings in this light review. The dependency range and lockfile agree, the Super VL compatibility gates consistently include 5.18–5.20, and the updated tests retain audio-config preservation and processor round-trip checks.

Static review only; tests were not executed.

Suggested test cases

Note: formal approval is not available for this request, so this review is posted as a comment only.

Review generated by codex

…ormers 5.20

Transformers 5.20 no longer exposes partial_rotary_factor as a config
attribute; it lives only in rope_parameters. This broke GLM-4.5V
conversion with an AttributeError, and made the generic HF config mapping
silently fall back to full rotary for partial-rotary models (GLM-4.5,
GLM-4.7-Flash, Qwen3-Next, MiMo-V2-Flash, Bailing). The vendored Bailing
attention also fell back to full rotary.

Add partial_rotary_factor_from_hf, which reads the attribute or
rope_parameters, and use it in the generic mapping, the GLM-4.5V bridge
and the Bailing attention. Regression tests use real HF config classes
instead of mocks.

Signed-off-by: Kamran Jafari <kjafarisadeg@nvidia.com>
@kamran-nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test e9e58a6

@cuichenx cuichenx added the needs-review PR is ready for code review and waiting on a reviewer label Oct 16, 2026

This branch was successfully deployed

1 active deployment
test — e9e58a67 Deployed Oct 16, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #22931
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:build Dependencies, packaging, images, and environment setup ci CI, automation, test queue, or workflow infrastructure work full-test-suite needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants