Update quantization tests for bitsandbytes 0.50.0 - #6538
Closed
DaoyuanLi2816 wants to merge 1 commit into
Closed
Conversation
DaoyuanLi2816
marked this pull request as ready for review
July 26, 2026 17:48
Contributor
Author
|
Closing in favor of #6546, which covers the same bitsandbytes 0.50.0 compatibility update and also removes the temporary dependency pin. |
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.
What does this PR do?
bitsandbytes 0.50.0 includes bitsandbytes-foundation/bitsandbytes#1940, which removes the deprecated
_check_is_sizecalls. This removes the temporary warning filter now that the fixed release is available.The release also casts every
Linear4bitbias to the compute dtype on the first forward pass. The existing DPO, KTO, and SFT quantization tests only accounted for three model-specific biases, so they fail with 0.50.0 even though the values are unchanged. The assertions now align changed bias dtypes before comparing values while leaving every non-bias parameter check unchanged.Fixes #6447
Tests
test_peft_with_quantization(3 passed)pre-commit run --all-filesBefore submitting
AI writing disclosure
We welcome the use of AI tools to help with contributions. For transparency and to help us improve our review process, please indicate the level of AI involvement in this PR.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.
Note
Low Risk
Test-only and pytest config changes; no production trainer or library behavior is modified.
Overview
Updates TRL’s bitsandbytes 0.50.0 compatibility: drops the pytest
filterwarningsentry for the upstream_check_is_sizeFutureWarning(fixed in that release), and fixes DPO, KTO, and SFTtest_peft_with_quantizationso frozen-base checks survive the new behavior where allLinear4bitbiases are cast to the compute dtype on the first forward.Instead of hard-coding three layer-specific bias names and forcing
float32, the tests now match dtypes for any.biasparameter beforeassert_close, without changing how LoRA vs base parameters are validated.Reviewed by Cursor Bugbot for commit 881c5bc. Bugbot is set up for automated code reviews on this repo. Configure here.