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

importing peft with an old version of bitsandbytes causes an exception #642

Closed
4 tasks
glerzing opened this issue Jun 27, 2023 · 4 comments · Fixed by #646
Closed
4 tasks

importing peft with an old version of bitsandbytes causes an exception #642

glerzing opened this issue Jun 27, 2023 · 4 comments · Fixed by #646

Comments

@glerzing
Copy link
Contributor

System Info

Importing peft with the bitsandbytes version "0.39.1" works. But when importing peft with the version "0.38.1", I get an exception : AttributeError: module 'bitsandbytes.nn' has no attribute 'Linear4bit'.

Indeed, the class SVDLinear4bit should be defined only if is_bnb_4bit_available(), not just if is_bnb_available().

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder
  • My own task or dataset (give details below)

Reproduction

in a notebook :
!pip install 'bitsandbytes==0.38.1'
import peft

Expected behavior

no exception

@glerzing
Copy link
Contributor Author

@younesbelkada This issue seems important if you plan a new release.

@younesbelkada
Copy link
Contributor

thanks for the ping @glerzing
Did #605 not fixed the issue? can you confirm you get that even with the main branch of PEFT?
That PR introduced a stronger check, and should be using the is_bnb_4bit_available method:

from ..import_utils import is_bnb_4bit_available, is_bnb_available

@glerzing
Copy link
Contributor Author

Yes, I confirm. And I made a PR here : #646

@younesbelkada
Copy link
Contributor

Thanks a lot @glerzing
Merged #646

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 a pull request may close this issue.

2 participants