Skip to content

ROCM support#4272

Merged
danielhanchen merged 3 commits into
mainfrom
dh/recover-3279-rocm-install-matrix
Mar 13, 2026
Merged

ROCM support#4272
danielhanchen merged 3 commits into
mainfrom
dh/recover-3279-rocm-install-matrix

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Additional recovery for #3279 due to Studio rebasing

closes #37

This recovers the broader ROCm install-matrix work that was carried on top of @electron271's branch before the history rewrite closed the PR.

The original authored packaging commits from @sstamenk are preserved here. The narrower unsloth/device_type.py attribution-only recovery remains separate in #4271.

(cherry picked from commit ed6877f)
(cherry picked from commit d02aa7f)
@danielhanchen

Copy link
Copy Markdown
Member Author

@sstamenk I recovered your ROCm install-matrix commits from the original #3279 branch at #4272 so your authored packaging changes are preserved after the rebase.

@danielhanchen danielhanchen mentioned this pull request Mar 13, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 reintroduces and expands ROCm support, recovering previously lost work related to the ROCm installation matrix. It integrates specific dependency configurations for various ROCm and PyTorch versions, ensuring compatibility across different Python environments and operating systems. This change significantly broadens the platform's hardware compatibility by enabling robust support for AMD GPUs.

Highlights

  • ROCm Support: Added comprehensive ROCm support configurations by introducing new dependency groups for various ROCm and PyTorch versions.
  • Dependency Management: Introduced specific dependency sets like rocm702-torch280, rocm72-torch291, rocm711-torch291, rocm72-torch2100, and rocm711-torch2100 within pyproject.toml.
  • Radeon Repository Integration: Specified direct links to Radeon's ROCm repositories for triton, torch, and torchvision packages, ensuring correct versions are installed based on platform and Python version.
Changelog
  • pyproject.toml
    • Added new dependency groups for ROCm-enabled Triton, PyTorch, and TorchVision, covering multiple ROCm, PyTorch, and Python versions.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
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.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request adds several new optional dependency groups to pyproject.toml to support various ROCm and PyTorch version combinations. The changes are well-structured, but I've identified a few potential issues with the URLs for Windows wheels that could lead to installation failures. Specifically, some URLs contain what appear to be future dates, and there's a version inconsistency for torch in one of the groups. Please review the suggested comments.

Comment thread pyproject.toml
Comment on lines +1076 to +1082
"torch @ https://repo.radeon.com/rocm/windows/rocm-rel-7.2/torch-2.9.1%2Brocmsdk20260116-cp312-cp312-win_amd64.whl ; sys_platform == 'win32' and python_version == '3.12'",

"torchvision @ https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2/torchvision-0.24.0%2Brocm7.2.0.gitb919bd0c-cp310-cp310-linux_x86_64.whl ; platform_system == 'Linux' and python_version == '3.10' and platform_machine == 'x86_64'",
"torchvision @ https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2/torchvision-0.24.0%2Brocm7.2.0.gitb919bd0c-cp311-cp311-linux_x86_64.whl ; platform_system == 'Linux' and python_version == '3.11' and platform_machine == 'x86_64'",
"torchvision @ https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2/torchvision-0.24.0%2Brocm7.2.0.gitb919bd0c-cp312-cp312-linux_x86_64.whl ; platform_system == 'Linux' and python_version == '3.12' and platform_machine == 'x86_64'",
"torchvision @ https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2/torchvision-0.24.0%2Brocm7.2.0.gitb919bd0c-cp313-cp313-linux_x86_64.whl ; platform_system == 'Linux' and python_version == '3.13' and platform_machine == 'x86_64'",
"torchvision @ https://repo.radeon.com/rocm/windows/rocm-rel-7.2/torchvision-0.24.1%2Brocmsdk20260116-cp312-cp312-win_amd64.whl ; sys_platform == 'win32' and python_version == '3.12'",

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.

high

The URLs for the Windows wheels of torch and torchvision in the rocm72-torch291 group seem to contain a date in the future (20260116). This is likely a typo and could cause installation to fail with a "Not Found" error. Please verify the correct build identifier. It might be 20240116 or something similar.

Comment thread pyproject.toml Outdated
Comment on lines +1096 to +1102
"torch @ https://repo.radeon.com/rocm/windows/rocm-rel-7.1.1/torch-2.9.0%2Brocmsdk20251116-cp312-cp312-win_amd64.whl ; sys_platform == 'win32' and python_version == '3.12'",

"torchvision @ https://repo.radeon.com/rocm/manylinux/rocm-rel-7.1.1/torchvision-0.24.0%2Brocm7.1.1.gitb919bd0c-cp310-cp310-linux_x86_64.whl ; platform_system == 'Linux' and python_version == '3.10' and platform_machine == 'x86_64'",
"torchvision @ https://repo.radeon.com/rocm/manylinux/rocm-rel-7.1.1/torchvision-0.24.0%2Brocm7.1.1.gitb919bd0c-cp311-cp311-linux_x86_64.whl ; platform_system == 'Linux' and python_version == '3.11' and platform_machine == 'x86_64'",
"torchvision @ https://repo.radeon.com/rocm/manylinux/rocm-rel-7.1.1/torchvision-0.24.0%2Brocm7.1.1.gitb919bd0c-cp312-cp312-linux_x86_64.whl ; platform_system == 'Linux' and python_version == '3.12' and platform_machine == 'x86_64'",
"torchvision @ https://repo.radeon.com/rocm/manylinux/rocm-rel-7.1.1/torchvision-0.24.0%2Brocm7.1.1.gitb919bd0c-cp313-cp313-linux_x86_64.whl ; platform_system == 'Linux' and python_version == '3.13' and platform_machine == 'x86_64'",
"torchvision @ https://repo.radeon.com/rocm/windows/rocm-rel-7.1.1/torchvision-0.24.0%2Brocmsdk20251116-cp312-cp312-win_amd64.whl ; sys_platform == 'win32' and python_version == '3.12'",

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.

high

The URLs for the Windows wheels of torch (line 1096) and torchvision (line 1102) in the rocm711-torch291 group seem to contain a date in the future (20251116). This is likely a typo and could cause installation to fail with a "Not Found" error. Please verify the correct build identifier. It might be 20241116 or something similar.

Comment thread pyproject.toml Outdated
"torch @ https://repo.radeon.com/rocm/manylinux/rocm-rel-7.1.1/torch-2.9.1%2Brocm7.1.1.lw.git351ff442-cp311-cp311-linux_x86_64.whl ; platform_system == 'Linux' and python_version == '3.11' and platform_machine == 'x86_64'",
"torch @ https://repo.radeon.com/rocm/manylinux/rocm-rel-7.1.1/torch-2.9.1%2Brocm7.1.1.lw.git351ff442-cp312-cp312-linux_x86_64.whl ; platform_system == 'Linux' and python_version == '3.12' and platform_machine == 'x86_64'",
"torch @ https://repo.radeon.com/rocm/manylinux/rocm-rel-7.1.1/torch-2.9.1%2Brocm7.1.1.lw.git351ff442-cp313-cp313-linux_x86_64.whl ; platform_system == 'Linux' and python_version == '3.13' and platform_machine == 'x86_64'",
"torch @ https://repo.radeon.com/rocm/windows/rocm-rel-7.1.1/torch-2.9.0%2Brocmsdk20251116-cp312-cp312-win_amd64.whl ; sys_platform == 'win32' and python_version == '3.12'",

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 dependency group is named rocm711-torch291, and the Linux dependencies use torch-2.9.1. However, the Windows dependency for torch points to version 2.9.0. This might be a typo. If torch-2.9.1 is available for Windows with ROCm 7.1.1, it should be used for consistency.

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

Copy link
Copy Markdown

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: 5bbf100765

ℹ️ 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 pyproject.toml
"bitsandbytes>=0.49.1 ; (sys_platform == 'win32') and (platform_machine == 'AMD64' or platform_machine == 'x86_64')",
]
rocm702-torch280 = [
"unsloth[amd]",

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 Add unsloth_zoo to ROCm extras

Each new rocm*-torch* extra starts from unsloth[amd], but amd only expands to unsloth[huggingfacenotorch] plus bitsandbytes and does not bring in unsloth_zoo. unsloth/__init__.py unconditionally checks/imports unsloth_zoo and raises if it is missing (lines 89-109), so a user installing these ROCm extras gets a successful install that still fails on import unsloth unless they manually install unsloth_zoo.

Useful? React with 👍 / 👎.

@danielhanchen danielhanchen merged commit 3e8f085 into main Mar 13, 2026
5 checks passed
@danielhanchen danielhanchen deleted the dh/recover-3279-rocm-install-matrix branch March 13, 2026 08:40
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.

[Feature Request] AMD GPU

2 participants