Skip to content

upgrade to support latest transformers release#2984

Merged
winglian merged 3 commits into
mainfrom
transformers-4540
Jul 27, 2025
Merged

upgrade to support latest transformers release#2984
winglian merged 3 commits into
mainfrom
transformers-4540

Conversation

@winglian
Copy link
Copy Markdown
Collaborator

@winglian winglian commented Jul 27, 2025

Summary by CodeRabbit

  • New Features

    • Added a configuration option to control averaging tokens across devices during training, set to disabled by default.
  • Bug Fixes

    • Improved compatibility handling for the "vllm" extra dependency with specific PyTorch versions.
  • Chores

    • Updated package versions for transformers, hf_xet, and mistral-common.
    • Enhanced CI script to only upload coverage data when a valid token is present.
    • Adjusted multi-GPU test matrix configuration in CI workflows.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 27, 2025

📝 Walkthrough

"""

Walkthrough

This update modifies dependency versions, workflow matrix entries, and dependency handling for compatibility between vllm and specific PyTorch versions. It adds a training argument, safeguards coverage upload in CI scripts, and adjusts imports for compatibility with transformers library changes. No exported/public API signatures are changed.

Changes

File(s) Change Summary
.github/workflows/multi-gpu-e2e.yml Swapped axolotl_extras values between PyTorch 2.7.0 and 2.7.1 entries in the workflow matrix.
cicd/multigpu.sh Added conditional check to only upload coverage if CODECOV_TOKEN environment variable is set.
requirements.txt Updated transformers (4.53.2→4.54.0), hf_xet (1.1.2→1.1.5), and mistral-common (1.7.0→1.8.3).
setup.py Adjusted vllm extra handling for PyTorch 2.4.x, 2.5.x, 2.7.0; updated vllm version to 0.10.0; updated flash-attn versions.
src/axolotl/core/builders/base.py Added "average_tokens_across_devices": False to training args dictionary in _set_base_training_args.
src/axolotl/monkeypatch/ring_attn/adapters/batch.py Changed import of _flash_supports_window_size to a conditional import to handle transformers version differences; updated usage accordingly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

ready to merge

Suggested reviewers

  • djsaunde
  • SalmanMohammadi
    """

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5db251 and 539515b.

📒 Files selected for processing (2)
  • setup.py (4 hunks)
  • src/axolotl/monkeypatch/ring_attn/adapters/batch.py (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/axolotl/monkeypatch/ring_attn/adapters/batch.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • setup.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: docker-e2e-tests-1st (126, 12.6.3, 3.11, 2.6.0, 1, Dockerfile-uv.jinja)
  • GitHub Check: test-axolotl-multigpu (126, 12.6.3, 3.11, 2.7.0, 2, true)
  • GitHub Check: test-axolotl-multigpu (126, 12.6.3, 3.11, 2.6.0, 2, true)
  • GitHub Check: test-axolotl-multigpu (126, 12.6.3, 3.11, 2.7.1, vllm, 2, true)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch transformers-4540

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 27, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...rc/axolotl/monkeypatch/ring_attn/adapters/batch.py 60.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f7ea140 and b5db251.

📒 Files selected for processing (5)
  • .github/workflows/multi-gpu-e2e.yml (1 hunks)
  • cicd/multigpu.sh (1 hunks)
  • requirements.txt (2 hunks)
  • setup.py (3 hunks)
  • src/axolotl/core/builders/base.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
.github/workflows/multi-gpu-e2e.yml (1)

Learnt from: NanoCode012
PR: #2854
File: README.md:73-77
Timestamp: 2025-07-02T02:56:20.788Z
Learning: For Axolotl Docker commands, the --ipc=host flag should be included by default to prevent shared memory failures that commonly occur with PyTorch DataLoaders and multiprocessing during machine learning training workflows.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: test-axolotl-multigpu (126, 12.6.3, 3.11, 2.7.0, 2, true)
  • GitHub Check: test-axolotl-multigpu (126, 12.6.3, 3.11, 2.6.0, 2, true)
  • GitHub Check: PyTest (3.11, 2.7.0)
  • GitHub Check: PyTest (3.11, 2.7.1)
  • GitHub Check: PyTest (3.11, 2.6.0)
  • GitHub Check: PyTest from Source Dist (3.11, 2.7.1)
  • GitHub Check: PyTest from Source Dist (3.11, 2.7.0)
  • GitHub Check: PyTest from Source Dist (3.11, 2.6.0)
🔇 Additional comments (8)
requirements.txt (3)

22-22: hf_xet 1.1.5 is backward-compatible and safe to upgrade

Based on the official release notes, the hf_xet 1.1.5 bump:

  • Introduces performance optimizations for faster Xet file downloads
  • Remains compatible with Python 3.8+
  • Maintains backward compatibility—no breaking changes or workflow updates required

You can proceed with the upgrade as specified in your requirements.txt.


71-71: mistral-common 1.8.3 upgrade is backward-compatible with existing text-only workflows

The jump from 1.7.0 → 1.8.3 adds robust image/multimodal support (encoding images via PIL or URLs, token & image counting, Pixtral model compatibility) but retains all prior text-only tokenization APIs. No breaking changes are documented for existing text pipelines.

• File requiring review:
– requirements.txt (line 71: mistral-common==1.8.3)

Recommendation:

  • If you’re not leveraging any new image/multimodal features, no code changes are needed.
  • Otherwise, verify any multimodal pipelines against the updated tokenizer API examples in the Mistral-Common 1.8.x docs.

16-16: Review transformers 4.54.0 upgrade for breaking changes

The bump from 4.53.2→4.54.0 introduces several silent breaking changes and emergent bugs. Please verify that your code and pipelines remain compatible:

  • Hidden-state indexing has shifted by +1 for Llama (and some other) models when using return_hidden_states=True (PR #39120). If you rely on a specific ordering of hidden states, update your post-processing accordingly.
  • ImportError: deterministic_g is no longer available in modeling_flash_attention_utils. Audit any flash-attention or custom attention integrations for this missing symbol.
  • Runtime errors in exaone4 models if sliding_window_pattern remains None (“LLLG”): add guards or update your model-setup code.
  • No CVEs or major security advisories reported for 4.54.0, but several user-filed issues have appeared within 24 hours of release—run your full test suite against 4.54.0 before deploying.

If you do not use Llama hidden states, flash-attention utils or exaone4 models, the risk may be minimal. Otherwise, ensure you’ve run integration tests and adjusted any affected code paths.

cicd/multigpu.sh (1)

22-25: Excellent defensive programming for CI robustness.

The conditional check for CODECOV_TOKEN before attempting coverage upload is a good practice that prevents CI failures when the token is unavailable. The || true fallback ensures the script continues even if upload fails.

src/axolotl/core/builders/base.py (1)

503-503: Confirm distributed training stability with per‐device token averaging

Setting average_tokens_across_devices=False disables global loss/gradient averaging across GPUs, causing each device to backpropagate based solely on its local token batch. This can lead to uneven gradient scales and may require tailored learning rates or batch sizes.

• File: src/axolotl/core/builders/base.py (line 503)
• Verify this matches your intended distributed setup
• Ensure LR and batch sizes are tuned for local‐only scaling
• Confirm model convergence and training stability in multi‐GPU runs

.github/workflows/multi-gpu-e2e.yml (1)

40-40: Matrix changes align with vllm compatibility updates.

The swap of axolotl_extras values between PyTorch 2.7.0 and 2.7.1 correctly reflects the updated vllm compatibility handling in setup.py. This ensures the CI tests match the actual dependency constraints.

Also applies to: 47-47

setup.py (2)

71-72: Confirm intentional removal of vllm extras due to incompatibility

We’ve verified that vllm 0.9.x exhibits multiple breaking changes with Transformers 4.54.0—renamed internals, model‐loading failures (VLLM-001), and missing architecture support—making it incompatible out of the box. Removing the "vllm" extras from setup.py for PyTorch 2.7.0 patch is therefore the correct approach. If continued vllm support is required, you’ll need to either:

  • Pin Hugging Face Transformers to a known-compatible version (e.g. ≤ 4.47.1), or
  • Upgrade to a newer vllm release with updated Transformers integration once available.

88-90: vllm extras removal safe for PyTorch ≥2.4
All references to vllm in the codebase are either:

  • Deferred via runtime imports in the CLI (do_vllm_serve),
  • Wrapped in test‐level guards (is_vllm_installed / require_vllm), or
  • Limited to schema definitions that don’t import the vllm package at load time.

Removing the “vllm” extra for PyTorch 2.4.x and 2.5.x will not break existing functionality for users on those versions.

Comment thread setup.py
],
"vllm": [
"vllm==0.7.2",
"vllm==0.10.0",
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.

💡 Verification agent

🧩 Analysis chain

Verify vllm 0.10.0 compatibility and breaking changes.

The significant version bump from vllm 0.7.2 to 0.10.0 may introduce breaking changes. Please verify compatibility with the current codebase.


🌐 Web query:

What are the major changes and breaking changes in vllm 0.10.0 compared to 0.7.2?

💡 Result:

vLLM 0.10.0 introduces major engine codebase cleanups and numerous breaking changes compared to v0.7.2, particularly the removal of legacy V0 backends and features. Several model and backend supports have been dropped, and new model families and architectural expansions have been added. Users upgrading from 0.7.2 should expect required changes to their deployments and code.

Major Breaking Changes from 0.7.2 to 0.10.0

1. Removal of V0 Backends and Features
The v0.10.0 release initiates a significant "cleanup of V0 engine codebase." The following components are removed from vLLM[1][4]:

  • V0 CPU, XPU, TPU, and HPU backends ([#20412])
  • Long context LoRA ([#21169])
  • Prompt Adapters ([#20588])
  • Phi3-Small & BlockSparse Attention ([#21217])
  • Spec Decode workers ([#21152])

vLLM maintainers indicate ongoing plans to remove further unused/legacy code related to V0. This means users must migrate to the newer V1 backends and workflows. Code, scripts, or container setups relying on V0-specific backends will break and must be updated[1][4].

2. Model Format and Loader Changes
Some older model families (especially those dependent on dropped V0 features) may no longer be supported. Expanded support is added for new models (e.g., Llama 4 with EAGLE, EXAONE 4.0, additional transformers, etc.), but legacy models using V0-only features will require migration[1][4].

3. Dependency and Backend Compatibility

  • Changed default backends for several architectures (e.g., ROCm is now V1 by default)[4].
  • GGUF Format Dependency Issues: Users report that vLLM 0.10.0's required version of the gguf library is not compatible with numpy 2.x out of the box, leading to loading failures for some model types unless a newer gguf version is manually installed—altering this may break some models loading via vLLM[2]. This type of change was less significant in 0.7.x.

4. Architectural and API Expansions

  • Support for new architectures (attention-free models, Mamba2 layers, hybrid SSM/attention, etc.)[1][4].
  • Expanded model and task support, such as LlamaForSequenceClassification and VLM (Vision Language Model) improvements.

Additional Changes and Considerations

  • Bug Fixes and Performance: Numerous bug fixes, performance improvements, and upgraded handling for certain models and architectures[4].
  • Backward Compatibility: Some plugins and downstream tools (such as vLLM Ascend) introduce version logic to support both new and up to two recent vLLM versions, but expect plugin authors to note and flag breaking changes[3].

Upgrade Caveats

  • If you use custom deployment scripts, Dockerfiles, or automation around V0-specific features, you will need substantial updates to move to 0.10.0.
  • Plugins and projects wrapping vLLM (such as vLLM Ascend) are expected to adapt to these breakages, but users should check respective documentation for transition recommendations.
  • You may need to pin or update dependencies like gguf and numpy due to compatibility changes in the 0.10.x line[2].
  • Some features present in 0.7.2 may not have direct replacements (notably, Prompt Adapters and long-context LoRA for V0 have no official migration documented with this release).

In summary:
vLLM 0.10.0 is a major step forward, streamlining the codebase and dropping legacy backends and features. Most of the breaking changes result from the removal of the V0 engine and associated model support, necessitating a migration to newer workflows. Users upgrading from 0.7.2 will need to review all deployment scripts, dependencies, and model types to ensure continued support and should expect non-trivial migration work[1][4][2].

Citations:


Action Required: Migrate to vLLM 0.10.0 Breaking Changes

Upgrading from vLLM 0.7.2 → 0.10.0 drops all V0 backends (CPU, XPU, TPU, HPU), long-context LoRA, Prompt Adapters, Phi3-Small/BlockSparse attention, Spec Decode workers, and more. You must:

• Migrate any V0-specific code, scripts or deployment containers to the new V1 backends.
• Review all models you load—legacy V0-only formats may no longer be supported.
• Pin or upgrade gguf to a version compatible with numpy 2.x (0.10.0’s default may fail otherwise).
• Update default backend settings (e.g. ROCm is now V1).
• Remove or replace any Prompt Adapter or long-context LoRA usage.
• Run integration tests against your target model families and workflows to confirm nothing breaks.

File: setup.py (line 157) – bumping to “vllm==0.10.0” is correct, but ensure the above migration steps are completed.

🤖 Prompt for AI Agents
In setup.py at line 157, you have updated the vLLM version to 0.10.0, which
introduces breaking changes. To fix this, migrate all V0-specific code, scripts,
and deployment containers to use the new V1 backends; review and update all
model loading code to ensure compatibility with supported formats; pin or
upgrade the gguf dependency to a version compatible with numpy 2.x; update
default backend settings to reflect changes like ROCm now being V1; remove or
replace any usage of Prompt Adapters or long-context LoRA; and run thorough
integration tests on your target models and workflows to verify nothing breaks
after the upgrade.

@winglian winglian merged commit 1d2aa1e into main Jul 27, 2025
17 checks passed
@winglian winglian deleted the transformers-4540 branch July 27, 2025 21:05
@coderabbitai coderabbitai Bot mentioned this pull request Jan 6, 2026
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.

1 participant