Skip to content

enable deterministic in bnb 4 bit tests #11738

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jiqing-feng
Copy link
Contributor

The motivation is that I can pass all tests when running pytest -rA tests/quantization/bnb/test_4bit.py, but failed on pytest -rA tests/quantization/bnb/test_4bit.py::ExtendedSerializationTest. That's because running all tests will trigger torch.use_deterministic_algorithms(True), and it will have impact on all the following tests. So the correct way should be calling this function at the setup stage.

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
@jiqing-feng
Copy link
Contributor Author

Hi @sayakpaul , could you please review this PR? Thanks!

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it not be propagated to test_mixed_int8.py as well?

@jiqing-feng
Copy link
Contributor Author

Should it not be propagated to test_mixed_int8.py as well?

Right, fixed.

@jiqing-feng jiqing-feng requested a review from sayakpaul June 19, 2025 05:05
@jiqing-feng jiqing-feng marked this pull request as draft June 19, 2025 05:07
@jiqing-feng
Copy link
Contributor Author

Hold on for a while, need to recheck if it works.

@jiqing-feng jiqing-feng marked this pull request as ready for review June 19, 2025 05:20
@jiqing-feng
Copy link
Contributor Author

Hi @sayakpaul . I have verified this PR on both test_4bit.py and test_mixed_int8.py, and they work well. Please review the new changes. Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants