Skip to content

Bump diffusers to >=0.37 and other [hf] floors; drop older-version code paths - #3092

Merged
kevalmorabia97 merged 9 commits into
mainfrom
kmorabia/bump-diffusers-0.37
Oct 29, 2026
Merged

kevalmorabia97 merged 9 commits into
mainfrom
kmorabia/bump-diffusers-0.37

Conversation

@kevalmorabia97

@kevalmorabia97 kevalmorabia97 commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Type of change: Backward breaking change (dependency bump) + cleanup

Raises the [hf] extra's minimum versions and removes the compatibility code that only existed for older releases:

  • transformers stays at >=5.5: TensorRT-LLM 1.3.0 ships transformers 5.5 (pyproject.toml now says so), and a higher floor upgrades it in that container and breaks TensorRT-LLM's own Qwen3-VL loading. Drops the transformers 4.x leftovers, all dead at 5.5: the AutoModelForVision2Seq fallback, the conversion_mapping / Qwen3.5 / Mixtral-mapping test skips, and the lazy NemotronH / Qwen3.5 imports (nemotron_h/mtp.py now reads them from the modeling_nemotron_h module at call time).
  • nltk → >=3.9: always use punkt_tab (the llm_sparsity example and the RULER calibration dataset no longer download the old punkt).
  • diffusers>=0.32.2 → >=0.37.0 (released 2026-03-05). The Qwen-Image FastGen PDD plugin passes QwenEmbedRope(max_txt_seq_len=...), which 0.37 added, so it already crashed on older diffusers; 0.36 also added transformer_flux2. CHANGELOG entry (diffusers, peft, accelerate, nltk) under 0.49.0 Backward Breaking Changes.
    • plugins/diffusion/diffusers.py: drop the >= 0.35.0 version branch, its stand-in AttentionModuleMixin, the Flux2 ImportError fallback and the is not None registration guards.
    • unified_export_hf.py: reference diffusers.WanTransformer3DModel directly instead of through getattr(..., ()).
    • examples/diffusers/quantization/models_utils.py: import Flux2Pipeline and QwenImagePipeline directly. utils.py now imports AttentionModuleMixin from diffusers instead of through the ModelOpt plugin.
    • tests/_test_utils/torch/diffusers_models.py: import the DiT / Flux / Flux2 / Wan / Qwen-Image classes directly and drop the "not available in this diffusers version" skips, so those tests can no longer skip silently.
  • huggingface_hub>=0.24.0 → >=1.5.0: what transformers 5.5 itself requires.
  • accelerate>=1.0.0 → >=1.6.0: ModelOpt's HF trainers (distill, opt, QAT) read Accelerator.is_fsdp2 whenever FSDP is enabled, which accelerate added in 1.6.0.
  • peft>=0.17.0 → >=0.18.1: TensorRT-LLM 1.3.0's own floor (transformers 5.5's add_adapter, which the QAT trainer calls, needs >=0.18.0).
  • Example requirements the new floors cover: drop transformers>=5.3 (gpt-oss), transformers>=4.56 (torch_trt), and datasets, the transformers>=5.0 lower bound and the peft==0.18.1 pin (speculative_decoding); raise torch_trt's torch-tensorrt floor to 2.10 to match torch.
  • Remove the unused skip_if_onnx_version_above_1_18 test helper (no callers; ONNX is pinned to 1.21 / 1.23).

Qwen-Image PDD needs diffusers 0.39, which moved the joint text/image mask from the root forward into the attention processor; the PDD forward replaces the root forward, so on 0.37/0.38 padded text tokens leaked into attention. enable_qwen_image_pdd_forward now raises for diffusers<0.39 (the PDD example already pins diffusers==0.39.0), and the PDD tests skip below 0.39. The package floor stays at 0.37.

Usage

N/A

Testing

HF / diffusers-related unit tests (test_moe_a2a.py, tests/unit/torch/models, test_huggingface.py, test_peft.py, test_unified_export_hf.py, test_export_diffusers.py, tests/unit/torch/fastgen, tests/unit/torch/opt/plugins, test_diffusers_fp4.py, test_diffusers_wan_conv3d.py, test_import.py):

  • Floors (transformers 5.5.4, diffusers 0.37.0, huggingface_hub 1.5.0, accelerate 1.6.0, peft 0.18.1, nltk 3.9.4, torch 2.10), with tests/unit/torch/speculative, tests/unit/torch/quantization/plugins, tests/unit/torch/export, test_utils.py, test_qwen_vision_recipe.py and test_hf_checkpoint_utils.py added: 1580 passed, 43 skipped (incl. the PDD tests below diffusers 0.39 and the expert-parallel tests below transformers 5.6).
  • Latest (diffusers 0.42.1, transformers 5.18): diffusers and PDD tests pass.
  • The new PDD guard test (test_qwen_pdd_forward_binding_rejects_old_diffusers) fails with the guard removed.
  • uv pip install --dry-run -e ".[hf]" -r examples/speculative_decoding/requirements.txt resolves (peft 0.21.2, transformers 5.12.1, accelerate 1.15.0).

Before your PR is "Ready for review"

Make sure you read and follow Contributor guidelines and your commits are signed (git commit -s -S).

Make sure you read and follow the Security Best Practices (e.g. avoiding hardcoded trust_remote_code=True, torch.load(..., weights_only=False), pickle, etc.).

  • Is this change backward compatible?: ❌ Requires diffusers>=0.37, peft>=0.18.1, accelerate>=1.6 and nltk>=3.9 for the [hf] extra.
  • If you copied code from any other sources or added a new PIP dependency, did you follow guidance in CONTRIBUTING.md: N/A
  • Did you write any new necessary tests?: ✅ test_qwen_pdd_forward_binding_rejects_old_diffusers for the new Qwen-Image PDD diffusers check.
  • Did you update Changelog?: ✅
  • Did you get Claude approval on this PR?: ❌

Additional Information

Follow-up to #3091 (torch 2.10 floor). Both add a CHANGELOG line in the same spot and touch neighboring lines of plugins/diffusion/diffusers.py, so whichever merges second needs a trivial rebase.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Breaking Changes
    • The Hugging Face extra now requires newer minimum versions of Diffusers, PEFT, Accelerate, Hugging Face Hub, and NLTK.
    • Qwen image PDD support requires Diffusers 0.39 or newer.
  • Compatibility
    • Diffusers-based Flux2 and Qwen Image features now require their pipeline classes to be available in the installed Diffusers version.
    • VLM loading uses the Transformers image-text-to-text model interface; compatible Transformers versions must provide it.

@kevalmorabia97
kevalmorabia97 requested review from a team as code owners October 28, 2026 20:58
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between bdc4536 and c6b6356.

Files selected for processing: 26
  • CHANGELOG.rst
  • examples/diffusers/quantization/models_utils.py
  • examples/diffusers/quantization/utils.py
  • examples/gpt-oss/requirements.txt
  • examples/llm_sparsity/weight_sparsity/eval.py
  • examples/speculative_decoding/requirements.txt
  • examples/torch_trt/requirements.txt
  • modelopt/torch/export/unified_export_hf.py
  • modelopt/torch/fastgen/plugins/qwen_image_pdd.py
  • modelopt/torch/models/nemotron_h/mtp.py
  • modelopt/torch/quantization/plugins/diffusion/diffusers.py
  • modelopt/torch/sparsity/attention_sparsity/calibration/ruler_dataset.py
  • modelopt/torch/speculative/utils.py
  • modelopt/torch/utils/moe.py
  • pyproject.toml
  • tests/_test_utils/import_helper.py
  • tests/_test_utils/torch/diffusers_models.py
  • tests/_test_utils/torch/transformers_models.py
  • tests/gpu/torch/export/test_quant_aware_conversion_gpu.py
  • tests/gpu/torch/export/test_qwen_vision_recipe_export.py
  • tests/unit/recipe/test_qwen_vision_recipe.py
  • tests/unit/torch/export/test_hf_spec_rope_export.py
  • tests/unit/torch/export/test_quant_aware_conversion.py
  • tests/unit/torch/export/test_unified_export_hf.py
  • tests/unit/torch/fastgen/test_qwen_image_pdd_plugin.py
  • tests/unit/torch/utils/test_hf_checkpoint_utils.py
Walkthrough

The [hf] dependency constraints and example requirements change. Diffusers imports, attention registrations, and version checks now use direct class and version access in several paths. NLTK setup uses punkt_tab. Transformers model helpers and tests remove several compatibility fallbacks and availability skips.

Changes: Hugging Face compatibility

Layer / File(s) Summary
Dependency requirements and version policy
pyproject.toml, CHANGELOG.rst, examples/gpt-oss/requirements.txt, examples/speculative_decoding/requirements.txt, examples/torch_trt/requirements.txt
The [hf] extra raises minimum versions for accelerate, diffusers, huggingface_hub, and peft, and adds an nltk minimum. Example requirements also change. The changelog records selected minimum versions.
Diffusers imports, registrations, and version checks
modelopt/torch/quantization/plugins/diffusion/diffusers.py, examples/diffusers/quantization/*, modelopt/torch/export/unified_export_hf.py, modelopt/torch/fastgen/plugins/qwen_image_pdd.py, tests/_test_utils/torch/diffusers_models.py, tests/unit/torch/fastgen/test_qwen_image_pdd_plugin.py
Diffusers classes are imported directly, and attention registrations are unconditional. The Wan export check accesses WanTransformer3DModel directly. Qwen PDD raises RuntimeError below Diffusers 0.39. Diffusers test helpers construct models without availability skips.
Transformers and Nemotron API usage
modelopt/torch/speculative/utils.py, modelopt/torch/models/nemotron_h/mtp.py, modelopt/torch/utils/moe.py, tests/_test_utils/torch/transformers_models.py
VLM loading uses AutoModelForImageTextToText directly. Nemotron-H code and model helpers use module-level imports. Qwen3-VL config construction assigns rope_parameters directly.
Transformers compatibility tests and helpers
tests/_test_utils/import_helper.py, tests/gpu/torch/export/*, tests/unit/recipe/test_qwen_vision_recipe.py, tests/unit/torch/export/*, tests/unit/torch/utils/test_hf_checkpoint_utils.py
Export and recipe tests remove several version- and symbol-availability skips. Conversion-mapping helpers are imported directly, and the ONNX version skip helper is removed.
NLTK tokenizer resources
examples/llm_sparsity/weight_sparsity/eval.py, modelopt/torch/sparsity/attention_sparsity/calibration/ruler_dataset.py
NLTK evaluation and calibration setup use punkt_tab instead of selecting or checking for punkt.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Priority: Normal

Change: Other

Possibly related PRs

Merge Risk: Minimal · previous review 5dc11

No merge-blocking issue was established in the selected change. Merge after normal checks.

Pre-merge checks: Passed 4 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 61.54% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check Warning The title says the PR bumps transformers to >=5.9, but the changeset sets the transformers floor to 5.8 (pyproject.toml, noxfile.py, modelopt/torch/init.py). The objectives also state transformers… Correct the title so it matches the changeset. Use transformers >=5.8 instead of >=5.9. Remove or verify the peft floor claim, since no peft change appears in the file summaries. Shorten the title to the main change, such as: Raise [hf] min…
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Security Anti-Patterns Passed No listed security anti-pattern was introduced. The changed Python files add no hardcoded unsafe torch.load, numpy.load(..., allow_pickle=True), trust_remote_code=True, eval, exec, or `# nos…
Full details: Security Anti-Patterns

Explanation

No listed security anti-pattern was introduced. The changed Python files add no hardcoded unsafe torch.load, numpy.load(..., allow_pickle=True), trust_remote_code=True, eval, exec, or # nosec usage. The pyproject.toml changes only raise versions of existing dependencies; they add no new PIP dependency.

Full details: Docstring Coverage

Explanation

Docstring coverage is 61.54% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 13 functions across 21 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Full details: Title check

Explanation

The title says the PR bumps transformers to >=5.9, but the changeset sets the transformers floor to 5.8 (pyproject.toml, noxfile.py, modelopt/torch/init.py). The objectives also state transformers>=5.8. The title does not match the actual minimum version. The other parts of the title (diffusers >=0.37, peft/accelerate floors, dropping older-version code paths) are only partly reflected: the diffusers and accelerate floors are raised, but no peft floor change appears in the summaries, and the title is also long at 14 words.

Resolution

Correct the title so it matches the changeset. Use transformers >=5.8 instead of >=5.9. Remove or verify the peft floor claim, since no peft change appears in the file summaries. Shorten the title to the main change, such as: Raise [hf] minimum dependency versions and remove older-version code paths.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@kevalmorabia97

Copy link
Copy Markdown
Collaborator Author

/claude review

Comment thread pyproject.toml Resolved
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-29 09:15 UTC

@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.76%. Comparing base (bdc4536) to head (c6b6356).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3092      +/-   ##
==========================================
+ Coverage   78.09%   79.76%   +1.67%     
==========================================
  Files         662      662              
  Lines       76122    76302     +180     
==========================================
+ Hits        59445    60860    +1415     
+ Misses      16677    15442    -1235     
Flag Coverage Δ
examples-diffusers 19.94% <60.00%> (-0.01%) ⬇️
examples-gpt-oss 13.48% <48.00%> (-0.01%) ⬇️
examples-hf_ptq 23.48% <72.00%> (-0.04%) ⬇️
examples-llm_distill 13.56% <48.00%> (-0.02%) ⬇️
examples-llm_eval 17.25% <48.00%> (-0.01%) ⬇️
examples-llm_qat 17.41% <48.00%> (-0.05%) ⬇️
examples-llm_sparsity 16.76% <52.00%> (-0.02%) ⬇️
examples-megatron_bridge 26.52% <48.00%> (-0.25%) ⬇️
examples-specdec_bench 13.27% <48.00%> (-0.01%) ⬇️
examples-speculative_decoding 17.49% <48.00%> (-0.07%) ⬇️
examples-torch_onnx 21.21% <48.00%> (-0.03%) ⬇️
examples-torch_trt 15.22% <48.00%> (-0.01%) ⬇️
examples-vllm_serve 17.47% <0.00%> (+<0.01%) ⬆️
gpu 59.23% <64.00%> (+6.31%) ⬆️
regression 15.05% <48.00%> (-0.02%) ⬇️
unit 61.95% <96.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@meenchen meenchen 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.

Bot review (gpt-6.1-sol) — DM the bot to share feedback.

Nudge: the new minimum still needs Qwen PDD compatibility evidence, despite the example’s separate 0.39 pin.

Needs action:

  • Resolve the 0.37 padded-mask failure in test_qwen_image_pdd_plugin.py: check the adapter separately from the canonical assertion, enforce a feature-specific 0.39 requirement if necessary, and report the result.
  • Correct the PR description: use 0.37 in the compatibility checklist, and justify the Accelerate bump without assuming transformers[torch]; pyproject.toml requests plain transformers.

No action needed:

  • The test-helper edits are justified: removing old-version availability skips strengthens coverage, and no callers were found for the deleted ONNX helper.

@claude claude Bot 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.

Claude review — dependency-floor bump + compat-shim removal

Scope: full review (trigger was a bare /claude review). All 8 changed files reviewed: pyproject.toml, modelopt/torch/quantization/plugins/diffusion/diffusers.py, modelopt/torch/export/unified_export_hf.py, both examples/diffusers/quantization/ files, both tests/_test_utils/ files, CHANGELOG.rst. (Note: a two-dot diff against the shallow base also surfaces unrelated core_utils.py/test_utils.py reversals because the base tip is ahead of this branch — I excluded those per the PR's authoritative file list.)

Findings

Severity Count
CRITICAL 0
IMPORTANT 1
SUGGESTION 1

[IMPORTANT Compatibility] — the 0.37.0 floor admits a range where Qwen-Image PDD is silently wrong (inline)

This is the one finding I'd ask you to act on before merge. Your description already identifies that the padded-token mask is "only correct from diffusers 0.39", and your floor-install run confirms the test fails at 0.37.0 — but the stated mitigation (the PDD example pins diffusers==0.39.0) doesn't cover the affected code, which is library code: modelopt/torch/fastgen/plugins/qwen_image_pdd.py. It validates the mask contract thoroughly and then hands encoder_hidden_states_mask to diffusers to apply, with no version check. A user installing modelopt[hf] and resolving the floor to 0.37/0.38 therefore distills Qwen-Image PDD against padding garbage in the text conditioning, with nothing raised — which also sits oddly against that file's own fail-loud style elsewhere. Either raise the floor to >=0.39.0 (smaller diff, and lets the example drop its pin), or add an explicit version guard plus a matching test skip so the supported range and the passing range coincide.

[SUGGESTION] — plugin imports are now all-or-nothing (inline)

import_plugin catches bare Exception and only warns, so any future rename of the now-unguarded internal paths (transformer_flux2, attention_dispatch) silently disables all diffusion quantization rather than just Flux2. Not a problem at the declared floor — your 0.37.0 run is good evidence the symbols resolve — purely forward-looking, and non-blocking.

Verified clean

The cleanup itself is careful and I found no correctness problems in it:

  • unified_export_hf.py — isinstance(component, diffusers.WanTransformer3DModel) is safe: import diffusers sits inside the same try that sets HAS_DIFFUSERS (lines 48-65), and the HAS_DIFFUSERS and ... short-circuit means no NameError when diffusers is absent. Replacing getattr(..., ()) with direct access doesn't change behavior at the new floor (Wan predates 0.37).
  • plugins/diffusion/diffusers.py — removing the AttentionModuleMixin stand-in is clean: after this change the name is no longer referenced anywhere in the plugin (its only remaining use is examples/.../utils.py, correctly repointed to diffusers.models.attention). No leftover parse_version / diffusers.__version__ references, every remaining import is used, and the unconditional registrations are equivalent to the old guarded ones at the new floor.
  • examples/.../models_utils.py — no now-dead is not None guards left behind; both pipelines are consumed directly in the ModelType dict (lines 109, 114).
  • import_helper.py — skip_if_onnx_version_above_1_18 has zero remaining callers repo-wide; removal is safe, and the importlib.metadata / packaging imports were correctly dropped with it.
  • diffusers_models.py — converting the fallbacks to hard imports after pytest.importorskip("diffusers") behaves as intended: these tests now error loudly instead of skipping silently. Good change.
  • No stale older-diffusers guards remain anywhere in modelopt/, examples/, or tests/ — the cleanup is complete.
  • huggingface_hub>=1.5.0 / accelerate>=1.1.0 are metadata-only as described; transformers>=5.5,<5.19 (pyproject:89) already transitively enforces both floors.

Minor, no action needed: the PR checklist says "Requires diffusers>=0.36" while the title, CHANGELOG, and pyproject.toml all say 0.37 — worth aligning that line.

Risk assessment

Low risk overall. This is a well-scoped, mostly-deletion change (+36/-123) that removes genuinely dead compatibility branches, and the floor is justified by real API requirements (QwenEmbedRope(max_txt_seq_len=...), transformer_flux2). The two-version test matrix (floor and latest) is exactly the right way to validate a floor bump, and I'd note that it already caught the issue above — the finding is really about where the fix belongs, since the example pin doesn't reach library users. Backward-breaking status is correctly declared and changelogged under 0.49.0.

@kevalmorabia97
kevalmorabia97 requested review from a team as code owners October 28, 2026 21:18
@kevalmorabia97 kevalmorabia97 changed the title Bump diffusers to >=0.37 and drop older-diffusers code paths Bump transformers to >=5.8, diffusers to >=0.37 and drop older-version code paths Oct 28, 2026
@kevalmorabia97
kevalmorabia97 force-pushed the kmorabia/bump-diffusers-0.37 branch from 79f41b6 to 6fd18d8 Compare October 28, 2026 21:26

@rohansjoshi rohansjoshi 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.

LGTM for sparsity

@kevalmorabia97
kevalmorabia97 requested a review from a team as a code owner October 28, 2026 21:48
@kaix-nv
kaix-nv self-requested a review October 28, 2026 21:57
kevalmorabia97 and others added 6 commits October 28, 2026 23:47
0.37 is the first release with QwenEmbedRope's max_txt_seq_len, which the Qwen-Image
FastGen plugin passes. Also raise huggingface_hub to >=1.5 and accelerate to >=1.1,
which transformers>=5.5 already requires, and remove the unused
skip_if_onnx_version_above_1_18 helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
diffusers 0.39 moved the joint text/image mask from the root forward into the
attention processor. The PDD forward replaces the root forward, so on older
diffusers padded text tokens leak into attention; fail loudly instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
Drop the transformers<5.6 expert-parallel test skips and the pre-punkt_tab nltk path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
Use AutoModelForImageTextToText directly, import native NemotronH, Qwen3.5 and
conversion_mapping at module top, and remove test skips for APIs and models every
transformers>=5.8 has.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
A module-level MIXER_TYPES import kept a stale mapping once a test patched it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
transformers 5.8.0 and 5.8.1 skip their own weight init for models built from a
config, leaving every nn.Linear at PyTorch's default init.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
@kevalmorabia97
kevalmorabia97 force-pushed the kmorabia/bump-diffusers-0.37 branch from 5dc11c4 to 1c5f591 Compare October 29, 2026 06:50
@kevalmorabia97 kevalmorabia97 changed the title Bump transformers to >=5.8, diffusers to >=0.37 and drop older-version code paths Bump transformers to >=5.9, diffusers to >=0.37 and drop older-version code paths Oct 29, 2026
@kevalmorabia97
kevalmorabia97 enabled auto-merge (squash) October 29, 2026 06:54
transformers>=5.6 refuses peft<0.18.2 in add_adapter/enable_adapters, which the QAT
trainer calls, and ModelOpt's HF trainers read Accelerator.is_fsdp2 (accelerate 1.6+).
Drop example pins the new floors already cover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
@kevalmorabia97 kevalmorabia97 changed the title Bump transformers to >=5.9, diffusers to >=0.37 and drop older-version code paths Bump transformers to >=5.9, diffusers to >=0.37, peft/accelerate floors and drop older-version code paths Oct 29, 2026

@kevalmorabia97 kevalmorabia97 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Pensieve lgtm review using kmorabia's profile (revision 4).

LGTM: the floor bump and compat cleanup look correct and earlier concerns are fixed, but pyproject.toml and noxfile.py are setup-owned and need human sign-off.

Needs action:

  • Get @NVIDIA/modelopt-setup-codeowners sign-off on the dependency floors in pyproject.toml and the tf_min pin in noxfile.py (transformers 5.9, diffusers 0.37, peft 0.19, accelerate 1.6, huggingface_hub 1.5, nltk 3.9).

No action needed:

  • ✔️ Resolved since the last review: the Qwen-Image PDD refusal below diffusers 0.39 (guard plus test), and the Nemotron-H stale MIXER_TYPES binding (now read from modeling_nemotron_h at call time).
  • The deleted skips and test edits are justified by the raised floors, with assertions intact. The removed ONNX helper has no callers.
  • The floors in pyproject.toml, modelopt/torch/__init__.py and noxfile.py agree at 5.9. The CodeRabbit summary and title check still say 5.8 and are stale.
  • Not run here: the reported test passes were not independently executed. The commit after the last reviewed one (5dc11c4) was inspected only through the diff, and history checking covers the supplied excerpts only.

Review run: 27109a155bfa4692abdec1962494d5b5

@meenchen meenchen 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.

Bot review (gpt-6.1-sol) — DM the bot to share feedback.

Comment: the earlier correctness fixes are present, but the PEFT floor now conflicts with the speculative-decoding example’s pinned requirements.

Needs action:

  • Align examples/speculative_decoding/requirements.txt with peft>=0.19 and validate installation alongside [hf]; see the inline comment.
  • Refresh the PR body’s autogenerated release notes to state Transformers 5.9, Accelerate 1.6, and PEFT 0.19, matching pyproject.toml.

No action needed:

  • ✔️ Resolved since the last review: the Nemotron-H stale binding, the Qwen PDD compatibility refusal, and the handwritten dependency rationale/checklist corrections.
  • Obsolete availability-skip removals and the PDD-specific version gating are justified by the declared support changes.

It downgraded peft below the [hf] extra's new >=0.19 floor; the EAGLE LoRA tests pass on
peft 0.18.1 through 0.21.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
@kevalmorabia97

Copy link
Copy Markdown
Collaborator Author

@coderabbitai summary

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Summary regenerated.

@meenchen meenchen 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.

Bot review (gpt-6.1-sol) — DM the bot to share feedback.

Nudge: the previous code fixes are present, but the requested combined-install validation is still unreported.

Needs action:

  • 💬 Author removed the PEFT pin and reported PEFT test runs — still record combined installation or resolver validation of .[hf] with examples/speculative_decoding/requirements.txt.
  • Update the PR’s testing checklist to cite test_qwen_pdd_forward_binding_rejects_old_diffusers instead of marking new tests N/A.

No action needed:

  • ✔️ Resolved since the last review: the PEFT pin conflict, stale release notes, Nemotron-H registry binding, and Qwen-PDD compatibility refusal.
  • Availability-skip removals and PDD-specific gating are justified by the declared support changes; numerical assertions remain intact.

@kevalmorabia97

Copy link
Copy Markdown
Collaborator Author

@meenchen re the bot review: the combined install resolves. uv pip install --dry-run -e ".[hf]" -r examples/speculative_decoding/requirements.txt picks peft 0.21.2, transformers 5.12.1 and accelerate 1.15.0. The PR description's Testing section and checklist now record it and cite test_qwen_pdd_forward_binding_rejects_old_diffusers.

@meenchen meenchen 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.

Bot review (gpt-6.1-sol) — DM the bot to share feedback.

LGTM: the new discussion resolves both remaining requests; human sign-off is required for the justified existing-test edits.

Needs action:

  • Obtain human sign-off on the test-skip removals, justified by the raised dependency floors with numerical assertions preserved.

No action needed:

  • ✔️ Combined resolver validation is now reported, and the testing checklist correctly cites test_qwen_pdd_forward_binding_rejects_old_diffusers.

TensorRT-LLM 1.3.0 pins transformers==5.5.4 and peft<0.19, so higher floors upgrade them
in its container and break TensorRT-LLM's own Qwen3-VL loading. Restore the
transformers<5.6 expert-parallel test skips.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
@kevalmorabia97 kevalmorabia97 changed the title Bump transformers to >=5.9, diffusers to >=0.37, peft/accelerate floors and drop older-version code paths Bump diffusers to >=0.37 and other [hf] floors; drop older-version code paths Oct 29, 2026
@kevalmorabia97

Copy link
Copy Markdown
Collaborator Author

@coderabbitai summary

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Summary regenerated.

@meenchen meenchen 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.

Bot review (gpt-6.1-sol) — DM the bot to share feedback.

LGTM: prior correctness concerns are resolved; a human must sign off on the justified existing-test edits.

Needs action:

  • Obtain human sign-off on the dependency-related test-skip removals, justified by the supported-version floors with numerical assertions preserved.

No action needed:

  • ✔️ Resolved since earlier reviews: Qwen PDD compatibility refusal, Nemotron-H registry lookup, and example-install/testing documentation.

@kevalmorabia97
kevalmorabia97 merged commit 4bf3d00 into main Oct 29, 2026
49 checks passed
@kevalmorabia97
kevalmorabia97 deleted the kmorabia/bump-diffusers-0.37 branch October 29, 2026 09:15
kevalmorabia97 added a commit that referenced this pull request Oct 29, 2026
### What does this PR do?

Type of change: Cleanup (drops Transformer Engine 1.x support)

Removes version checks for dependency releases that no supported install
or CI container can have anymore. No install metadata changes.

| Dependency | Removed | Why it is dead |
|---|---|---|
| onnxruntime | 4 `onnxruntime<1.21` test skips in
`test_nodeclassifier.py`; the `>=1.21` DDS-op check in
`ort_utils.update_trt_ep_support` | Every platform pin in the `[onnx]`
extra is >= 1.22 |
| Transformer Engine | `<2.0` branches in `_QuantLayerNormLinearFunc`,
and the two helpers that only dispatched on it | TE 2.0 shipped in early
2025; `nemo:26.08` has TE 2.17 |
| megatron-core | `mcore_version_higher_than("0.9.0")` around
`packed_seq_params` in EAGLE | megatron-core 0.9 is from 2024;
`nemo:26.08` has 0.19 |
| vLLM | `<=0.11` `FlexibleArgumentParser` import branches in
`examples/vllm_serve` | vLLM 0.11 is from Oct 2025; CI uses 0.30 |

The vLLM >= 0.15 check in the sparse-attention plugin and the
`lm_eval>=0.4.12` checks in `examples/llm_eval` stay: they are real
errors that match their requirement floors. So does the TensorRT-LLM
`<1.1.0rc2` context-logits / stop-words gate in
`modelopt/deploy/llm/generate.py`: TensorRT-LLM 1.0 (the install guide's
floor) still imports that module.

TE and megatron-core are not in `pyproject.toml`; ModelOpt's
Megatron-Bridge / Megatron-LM features require `nemo:26.08` (CHANGELOG),
which ships TE 2.17 and megatron-core 0.19. For standalone TE
quantization, the install guide now lists Transformer Engine >=2.0 and
`CHANGELOG.rst` notes that TE 1.x is no longer supported (its last
release, 1.13, is from Dec 2024).

### Usage

N/A

### Testing

- `tests/unit/onnx` (incl. the previously gated `test_nodeclassifier.py`
tests): 498 passed.
- In `nvcr.io/nvidia/nemo:26.08` (TE 2.17.1, megatron-core 0.19):
`tests/gpu_megatron/torch/quantization/plugins/test_transformer_engine.py`
passes (21 passed, 4 skipped), `RotaryEmbedding.get_rotary_seq_len`
accepts `packed_seq_params`, and the EAGLE Megatron plugin imports.

### Before your PR is "*Ready for review*"

Make sure you read and follow [Contributor
guidelines](https://github.com/NVIDIA/Model-Optimizer/blob/main/CONTRIBUTING.md)
and your commits are signed (`git commit -s -S`).

Make sure you read and follow the [Security Best
Practices](https://github.com/NVIDIA/Model-Optimizer/blob/main/SECURITY.md#security-coding-practices-for-contributors)
(e.g. avoiding hardcoded `trust_remote_code=True`, `torch.load(...,
weights_only=False)`, `pickle`, etc.).

- Is this change backward compatible?: ❌ Transformer Engine 1.x is no
longer supported; the other removed paths are for releases that cannot
be installed alongside ModelOpt's supported stack.
- If you copied code from any other sources or added a new PIP
dependency, did you follow guidance in `CONTRIBUTING.md`: N/A
- Did you write any new necessary tests?: N/A
- Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?:
✅
- Did you get Claude approval on this PR?: ❌

### Additional Information

Companion to #3091 (torch 2.10 floor) and #3092 (transformers /
diffusers floors).

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Refactor**
* Simplified compatibility handling for model serving, quantization, and
speculative decoding integrations.
* ONNX operations and tests are no longer conditionally excluded based
on the ONNX Runtime version.
* **Breaking Changes**
* Transformer Engine 2.0 or later is required for module quantization;
Transformer Engine 1.x is no longer supported.
* **Documentation**
* Updated Linux installation requirements to list Transformer Engine 2.0
or later as an optional dependency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants