Skip to content

Update quantization tests for bitsandbytes 0.50.0 - #6538

Closed
DaoyuanLi2816 wants to merge 1 commit into
huggingface:mainfrom
DaoyuanLi2816:agent/remove-bitsandbytes-warning-filter
Closed

Update quantization tests for bitsandbytes 0.50.0#6538
DaoyuanLi2816 wants to merge 1 commit into
huggingface:mainfrom
DaoyuanLi2816:agent/remove-bitsandbytes-warning-filter

Conversation

@DaoyuanLi2816

@DaoyuanLi2816 DaoyuanLi2816 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

bitsandbytes 0.50.0 includes bitsandbytes-foundation/bitsandbytes#1940, which removes the deprecated _check_is_size calls. This removes the temporary warning filter now that the fixed release is available.

The release also casts every Linear4bit bias 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

  • bitsandbytes 0.50.0: DPO, KTO, and SFT test_peft_with_quantization (3 passed)
  • bitsandbytes 0.49.2: same tests (3 passed; expected upstream warnings)
  • pre-commit run --all-files

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline, Pull Request section?
  • Was this discussed/approved via a GitHub issue? Please add a link to it if that's the case.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

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.

  • No AI usage: the PR was written entirely by a human.
  • AI-assisted: some parts were suggested or improved by AI, but the PR was written and reviewed by a human.
  • AI-generated: the PR was mostly or fully generated by an AI tool.

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 filterwarnings entry for the upstream _check_is_size FutureWarning (fixed in that release), and fixes DPO, KTO, and SFT test_peft_with_quantization so frozen-base checks survive the new behavior where all Linear4bit biases 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 .bias parameter before assert_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.

@DaoyuanLi2816
DaoyuanLi2816 marked this pull request as ready for review July 26, 2026 17:48
@DaoyuanLi2816

Copy link
Copy Markdown
Contributor Author

Closing in favor of #6546, which covers the same bitsandbytes 0.50.0 compatibility update and also removes the temporary dependency pin.

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.

Remove bitsandbytes _check_is_size warning filter once the minimum required bitsandbytes is >= 0.50.0

1 participant