[ROCm] Conditionally enable 4bit on AMD CDNA GPUs for bitsandbytes >= v0.49.2#4161
[ROCm] Conditionally enable 4bit on AMD CDNA GPUs for bitsandbytes >= v0.49.2#4161danielhanchen merged 1 commit intounslothai:mainfrom
Conversation
Summary of ChangesHello, 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 enhances compatibility and expands 4-bit quantization support for AMD GPUs within the Highlights
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: dbdce096b8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if Version(bitsandbytes.__version__) >= Version("0.49.2"): | ||
| pass |
There was a problem hiding this comment.
Preserve HIP extension probe for bitsandbytes >=0.49.2
This branch now does pass for HIP when bitsandbytes>=0.49.2, which skips the guarded bitsandbytes.cextension import that previously caught broken ROCm installs (the same HSA failure mode noted in the comments). In that scenario, ALLOW_BITSANDBYTES remains True, so the loader still enables 4-bit paths and fails later at runtime instead of falling back safely. Please keep an explicit health check in this branch so invalid HIP/bitsandbytes setups are disabled early.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Code Review
This pull request correctly adds support for 4-bit quantization on CDNA Instinct GPUs for bitsandbytes version 0.49.2 and newer. The version checks are updated accordingly, and comments are refreshed to reflect new block size support. My review includes one suggestion to refactor duplicated code in unsloth/models/loader.py to improve maintainability.
|
Oh marvelous thanks! |
Version(bitsandbytes.__version__) > Version("0.49.0")toVersion(bitsandbytes.__version__) >= Version("0.49.0")since the PR #1748 that adds support for RDNA is included in v0.49.0