Skip to content

Add PyTorch 2.10 and xformers 0.0.34 support#3985

Merged
danielhanchen merged 1 commit into
mainfrom
add-torch-2.10-xformers-0.0.34-support
Feb 5, 2026
Merged

Add PyTorch 2.10 and xformers 0.0.34 support#3985
danielhanchen merged 1 commit into
mainfrom
add-torch-2.10-xformers-0.0.34-support

Conversation

@danielhanchen
Copy link
Copy Markdown
Member

Summary

Adds support for PyTorch 2.10 with xformers 0.0.34.

Changes

pyproject.toml:

  • Added cu126onlytorch2100, cu128onlytorch2100, cu130onlytorch2100 xformers 0.0.34 wheel dependencies
  • Added cu126-torch2100, cu128-torch2100, cu130-torch2100 meta-dependencies
  • Added cu126-ampere-torch2100, cu128-ampere-torch2100, cu130-ampere-torch2100 ampere variants

unsloth/_auto_install.py:

  • Added version detection: elif v < V('2.10.1'): x = 'cu{}{}-torch2100'
  • Added CUDA check for torch 2.10 (only CUDA 12.6, 12.8, 13.0 have xformers 0.0.34 wheels)

README.md:

  • Updated supported torch versions list to include torch2100
  • Added installation example for torch 2.10 with CUDA 12.6
  • Updated Python REPL code block with torch 2.10 version detection

xformers 0.0.34 Wheel Availability

CUDA Version Linux Windows
cu126 xformers-0.0.34-cp39-abi3-manylinux_2_28_x86_64.whl xformers-0.0.34-cp39-abi3-win_amd64.whl
cu128 xformers-0.0.34-cp39-abi3-manylinux_2_28_x86_64.whl xformers-0.0.34-cp39-abi3-win_amd64.whl
cu130 xformers-0.0.34-cp39-abi3-manylinux_2_28_x86_64.whl xformers-0.0.34-cp39-abi3-win_amd64.whl

Note: xformers 0.0.34 uses cp39-abi3 (Python stable ABI), which works with Python 3.9+.

Test plan

  • Verify pyproject.toml syntax is valid
  • Test version detection with torch 2.9.1 (should select torch291)
  • Test version detection with torch 2.9.2/2.10.0 (should select torch2100)
  • Verify CUDA 11.8/12.1/12.4 are blocked for torch 2.10
  • Verify CUDA 12.6/12.8/13.0 work for torch 2.10
  • Confirm wheel URLs are accessible

- Add cu126/cu128/cu130 xformers 0.0.34 wheel dependencies for torch 2.10
- Add cu126-torch2100, cu128-torch2100, cu130-torch2100 meta-dependencies
- Add cu126-ampere-torch2100, cu128-ampere-torch2100, cu130-ampere-torch2100 variants
- Update _auto_install.py version detection for torch 2.10.x
- Add CUDA check for torch 2.10 (requires CUDA 12.6, 12.8, or 13.0)
- Update README.md with torch 2.10 installation instructions
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @danielhanchen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces comprehensive support for PyTorch 2.10, coupled with xformers 0.0.34, into the project. It involves updating core dependency configurations and installation scripts to ensure seamless integration and proper environment setup for users utilizing the latest PyTorch version, while also clarifying CUDA compatibility requirements.

Highlights

  • PyTorch 2.10 and xformers 0.0.34 Support: The core change is the integration of PyTorch 2.10, specifically with xformers version 0.0.34, expanding compatibility.
  • Dependency Updates: pyproject.toml has been updated to include new xformers wheel dependencies and meta-dependencies for PyTorch 2.10 across CUDA versions 12.6, 12.8, and 13.0, including Ampere variants.
  • Installation Logic Refinement: The _auto_install.py script now includes logic for detecting PyTorch 2.10 and enforces specific CUDA version compatibility (12.6, 12.8, 13.0) for this PyTorch version.
  • Documentation Updates: README.md has been revised to reflect the new PyTorch 2.10 support, update the list of supported versions, and provide an installation example.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • README.md
    • Updated the list of supported PyTorch versions to include "torch 2.10".
    • Added a crucial note specifying that "torch 2.10" is only compatible with CUDA versions "12.6", "12.8", and "13.0".
    • Introduced a new installation example demonstrating how to install for "torch 2.10" with "CUDA 12.6".
    • Modified the Python REPL code block to correctly detect and suggest installation for "torch 2.10".
  • pyproject.toml
    • Added new xformers 0.0.34 wheel dependencies for cu126onlytorch2100, cu128onlytorch2100, and cu130onlytorch2100.
    • Introduced new meta-dependencies: cu126-torch2100, cu128-torch2100, and cu130-torch2100.
    • Included Ampere-specific variants: cu126-ampere-torch2100, cu128-ampere-torch2100, and cu130-ampere-torch2100.
  • unsloth/_auto_install.py
    • Implemented a new elif condition for version detection to correctly identify "torch 2.10" and assign the "torch2100" identifier.
    • Added a new runtime error check to enforce that "torch 2.10" installations must use CUDA "12.6", "12.8", or "13.0", preventing unsupported configurations.
Activity
  • The author has outlined a detailed test plan to ensure the changes function as expected. This includes:
  • Validating the syntax of pyproject.toml.
  • Testing the version detection logic for various PyTorch versions, including 2.9.1, 2.9.2, and 2.10.0.
  • Verifying that unsupported CUDA versions (11.8, 12.1, 12.4) are correctly blocked when torch 2.10 is used.
  • Confirming that supported CUDA versions (12.6, 12.8, 13.0) work correctly with torch 2.10.
  • Checking the accessibility of all specified wheel URLs.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 90bfb1ee4e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread unsloth/_auto_install.py
elif v < V('2.8.9'): x = 'cu{}{}-torch280'
elif v < V('2.9.1'): x = 'cu{}{}-torch290'
elif v < V('2.9.2'): x = 'cu{}{}-torch291'
elif v < V('2.10.1'): x = 'cu{}{}-torch2100'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restrict torch2100 mapping to torch 2.10 only

The new elif v < V('2.10.1') branch also matches torch 2.9.2+, so _auto_install.py now emits extras like cu118-torch2100 for those versions. That breaks installation for valid 2.9.2 users on CUDA 11.8 because pyproject.toml only defines torch2100 extras for cu126/cu128/cu130 (no cu118-torch2100 entry), causing pip to fail on an unknown extra. In practice this makes some previously-installable combinations fail after this commit.

Useful? React with 👍 / 👎.

@danielhanchen danielhanchen merged commit ff4ec54 into main Feb 5, 2026
4 checks passed
@danielhanchen danielhanchen deleted the add-torch-2.10-xformers-0.0.34-support branch February 5, 2026 13:56
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for PyTorch 2.10 with xformers 0.0.34. The changes across pyproject.toml, README.md, and unsloth/_auto_install.py are generally correct and align with the goal of the PR. I have two suggestions for improvement: one to clarify the supported CUDA versions in the documentation, and another to address potentially redundant dependency groups in pyproject.toml.

Comment thread README.md
`⚠️Do **NOT** use this if you have Conda.` Pip is a bit more complex since there are dependency issues. The pip command is different for `torch 2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,2.10` and CUDA versions.

For other torch versions, we support `torch211`, `torch212`, `torch220`, `torch230`, `torch240`, `torch250`, `torch260`, `torch270`, `torch280`, `torch290` and for CUDA versions, we support `cu118` and `cu121` and `cu124`. For Ampere devices (A100, H100, RTX3090) and above, use `cu118-ampere` or `cu121-ampere` or `cu124-ampere`.
For other torch versions, we support `torch211`, `torch212`, `torch220`, `torch230`, `torch240`, `torch250`, `torch260`, `torch270`, `torch280`, `torch290`, `torch2100` and for CUDA versions, we support `cu118` and `cu121` and `cu124`. For Ampere devices (A100, H100, RTX3090) and above, use `cu118-ampere` or `cu121-ampere` or `cu124-ampere`. Note: torch 2.10 only supports CUDA 12.6, 12.8, and 13.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.

medium

The list of supported CUDA versions in this sentence is incomplete. Based on the auto-install script and other parts of the project, cu126, cu128, and cu130 are also supported for various PyTorch versions. To avoid confusion for users, please update the list to include all supported CUDA versions.

Suggested change
For other torch versions, we support `torch211`, `torch212`, `torch220`, `torch230`, `torch240`, `torch250`, `torch260`, `torch270`, `torch280`, `torch290`, `torch2100` and for CUDA versions, we support `cu118` and `cu121` and `cu124`. For Ampere devices (A100, H100, RTX3090) and above, use `cu118-ampere` or `cu121-ampere` or `cu124-ampere`. Note: torch 2.10 only supports CUDA 12.6, 12.8, and 13.0.
For other torch versions, we support `torch211`, `torch212`, `torch220`, `torch230`, `torch240`, `torch250`, `torch260`, `torch270`, `torch280`, `torch290`, `torch2100` and for CUDA versions, we support `cu118`, `cu121`, `cu124`, `cu126`, `cu128`, and `cu130`. For Ampere devices (A100, H100, RTX3090) and above, use `cu118-ampere` or `cu121-ampere` or `cu124-ampere`. Note: torch 2.10 only supports CUDA 12.6, 12.8, and 13.0.

Comment thread pyproject.toml
Comment on lines +801 to +815
cu126-ampere-torch2100 = [
"unsloth[huggingface]",
"bitsandbytes>=0.45.5,!=0.46.0,!=0.48.0",
"unsloth[cu126onlytorch2100]",
]
cu128-ampere-torch2100 = [
"unsloth[huggingface]",
"bitsandbytes>=0.45.5,!=0.46.0,!=0.48.0",
"unsloth[cu128onlytorch2100]",
]
cu130-ampere-torch2100 = [
"unsloth[huggingface]",
"bitsandbytes>=0.45.5,!=0.46.0,!=0.48.0",
"unsloth[cu130onlytorch2100]",
]
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.

medium

The ampere variants for torch2100 (e.g., cu126-ampere-torch2100) are identical to their non-ampere counterparts. This pattern is also present for torch290 and torch291 variants. In contrast, older ampere variants included the unsloth[flashattention] dependency. If this omission is intentional due to compatibility issues, these new ampere extras are redundant and could be removed to simplify the configuration. If it's an oversight, unsloth[flashattention] should be added for consistency with other ampere-specific configurations.

abiswas-realadvice pushed a commit to abiswas-realadvice/unsloth that referenced this pull request May 14, 2026
- Add cu126/cu128/cu130 xformers 0.0.34 wheel dependencies for torch 2.10
- Add cu126-torch2100, cu128-torch2100, cu130-torch2100 meta-dependencies
- Add cu126-ampere-torch2100, cu128-ampere-torch2100, cu130-ampere-torch2100 variants
- Update _auto_install.py version detection for torch 2.10.x
- Add CUDA check for torch 2.10 (requires CUDA 12.6, 12.8, or 13.0)
- Update README.md with torch 2.10 installation instructions

Co-authored-by: Daniel Hanchen <danielhanchen@users.noreply.github.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.

1 participant