Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

non_sign_bits miscalculation in the function 'create_dynamic_map' in bitsandbytes/functional.py #1541

Open
Talel-bm opened this issue Feb 26, 2025 · 1 comment
Labels
high priority (first issues that will be worked on) Low Risk Risk of bugs in transformers and other libraries

Comments

@Talel-bm
Copy link

Talel-bm commented Feb 26, 2025

I found a potential bug in the following line of code:

non_sign_bits = total_bits - (1 if signed else 1)

in create_dynamic_map in bitsandbytes/functional.py

@Talel-bm Talel-bm changed the title non_sign_bits miscalculation in the function 'create_dynamic_map' in triton/functional.py non_sign_bits miscalculation in the function 'create_dynamic_map' in bitsandbytes/functional.py Feb 26, 2025
@TimDettmers TimDettmers added high priority (first issues that will be worked on) Low Risk Risk of bugs in transformers and other libraries labels Feb 28, 2025
@TimDettmers
Copy link
Collaborator

Thank you! Yes, that looks wrong to me. I am surprised that the tests pass. I think it is because the non-signed data types are not used. They are usually only used for the Adam denominator. We need to check that this behavior is correct. The Adam optimizer is used frequently in software like Unsloth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high priority (first issues that will be worked on) Low Risk Risk of bugs in transformers and other libraries
Projects
None yet
Development

No branches or pull requests

4 participants
@TimDettmers @matthewdouglas @Talel-bm and others