Bitsandbytes installation for qlora tests#1951
Merged
Merged
Conversation
Contributor
Author
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
astachowiczhabana
added a commit
to HabanaAI/optimum-habana-fork
that referenced
this pull request
Jul 8, 2025
astachowiczhabana
added a commit
to HabanaAI/optimum-habana-fork
that referenced
this pull request
Jul 8, 2025
astachowiczhabana
added a commit
that referenced
this pull request
Jul 8, 2025
astachowiczhabana
added a commit
to HabanaAI/optimum-habana-fork
that referenced
this pull request
Jul 10, 2025
astachowiczhabana
added a commit
to HabanaAI/optimum-habana-fork
that referenced
this pull request
Jul 11, 2025
astachowiczhabana
added a commit
that referenced
this pull request
Aug 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move bitsandbytes installation (required for qlora tests: tests/test_bnb_qlora.py, tests/test_bnb_inference.py) to conftest.py
Details:
pytest runs the pytest_configure function before executing the test itself (https://github.com/huggingface/optimum-habana/blob/main/conftest.py#L118)
Now, this function imports optimum.habana, which imports transformers.utils, which checks whether specific packages (for example: torch, peft, bitsandbytes) are installed (and transformers saves this state).
Bitsandbytes is installed later (during the test execution) because the transformer has not updated its state, and the QLORA tests fail for the above reason.
This issue does not occur in internal (OH-fork) repo because of the absence of the pytest_configure function from conftest.py file
Currently, we cannot add bitsandbytes to the requirements of tests in setup.py as discussed earlier.(Pad the examples for QLoRa finetuning test #1941 (comment)). Once we upstream the a proper fix to bitsandbytes repo, we'll revert this change in conftest.py