Add PyTorch 2.10 and xformers 0.0.34 support#3985
Conversation
- 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
Summary of ChangesHello @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
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
💡 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".
| 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' |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
| `⚠️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. |
There was a problem hiding this comment.
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.
| 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. |
| 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]", | ||
| ] |
There was a problem hiding this comment.
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.
- 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>
Summary
Adds support for PyTorch 2.10 with xformers 0.0.34.
Changes
pyproject.toml:
cu126onlytorch2100,cu128onlytorch2100,cu130onlytorch2100xformers 0.0.34 wheel dependenciescu126-torch2100,cu128-torch2100,cu130-torch2100meta-dependenciescu126-ampere-torch2100,cu128-ampere-torch2100,cu130-ampere-torch2100ampere variantsunsloth/_auto_install.py:
elif v < V('2.10.1'): x = 'cu{}{}-torch2100'README.md:
torch2100xformers 0.0.34 Wheel Availability
Note: xformers 0.0.34 uses
cp39-abi3(Python stable ABI), which works with Python 3.9+.Test plan