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

[0.39.0][Bug] bitsandbytes introduced scipy but not claimed as dependencies #426

Closed
lanking520 opened this issue May 24, 2023 · 2 comments
Closed

Comments

@lanking520
Copy link

lanking520 commented May 24, 2023

Using HuggingFace with bitsandbytes having the following issues. This seemed to be a bug in the setup. Using 0.38.1 all works fine

[INFO ] 2023-05-24 15:17:10 PyProcess -   File "/tmp/.djl.ai/python/0.23.0-SNAPSHOT/djl_python/huggingface.py", line 183, in get_pipeline
[INFO ] 2023-05-24 15:17:10 PyProcess -     model = AutoModelForCausalLM.from_pretrained(
[INFO ] 2023-05-24 15:17:10 PyProcess -   File "/usr/local/lib/python3.9/dist-packages/transformers/models/auto/auto_factory.py", line 471, in from_pretrained
[INFO ] 2023-05-24 15:17:10 PyProcess -     return model_class.from_pretrained(
[INFO ] 2023-05-24 15:17:10 PyProcess -   File "/usr/local/lib/python3.9/dist-packages/transformers/modeling_utils.py", line 2508, in from_pretrained
[INFO ] 2023-05-24 15:17:10 PyProcess -     from .utils.bitsandbytes import get_keys_to_not_convert, replace_8bit_linear
[INFO ] 2023-05-24 15:17:10 PyProcess -   File "/usr/local/lib/python3.9/dist-packages/transformers/utils/bitsandbytes.py", line 7, in <module>
[INFO ] 2023-05-24 15:17:10 PyProcess -     import bitsandbytes as bnb
[INFO ] 2023-05-24 15:17:10 PyProcess -   File "/usr/local/lib/python3.9/dist-packages/bitsandbytes/__init__.py", line 6, in <module>
[INFO ] 2023-05-24 15:17:10 PyProcess -     from . import cuda_setup, utils, research
[INFO ] 2023-05-24 15:17:10 PyProcess -   File "/usr/local/lib/python3.9/dist-packages/bitsandbytes/research/__init__.py", line 1, in <module>
[INFO ] 2023-05-24 15:17:10 PyProcess -     from . import nn
[INFO ] 2023-05-24 15:17:10 PyProcess -   File "/usr/local/lib/python3.9/dist-packages/bitsandbytes/research/nn/__init__.py", line 1, in <module>
[INFO ] 2023-05-24 15:17:10 PyProcess -     from .modules import LinearFP8Mixed, LinearFP8Global
[INFO ] 2023-05-24 15:17:10 PyProcess -   File "/usr/local/lib/python3.9/dist-packages/bitsandbytes/research/nn/modules.py", line 8, in <module>
[INFO ] 2023-05-24 15:17:10 PyProcess -     from bitsandbytes.optim import GlobalOptimManager
[INFO ] 2023-05-24 15:17:10 PyProcess -   File "/usr/local/lib/python3.9/dist-packages/bitsandbytes/optim/__init__.py", line 8, in <module>
[INFO ] 2023-05-24 15:17:10 PyProcess -     from .adagrad import Adagrad, Adagrad8bit, Adagrad32bit
[INFO ] 2023-05-24 15:17:10 PyProcess -   File "/usr/local/lib/python3.9/dist-packages/bitsandbytes/optim/adagrad.py", line 5, in <module>
[INFO ] 2023-05-24 15:17:10 PyProcess -     from bitsandbytes.optim.optimizer import Optimizer1State
[INFO ] 2023-05-24 15:17:10 PyProcess -   File "/usr/local/lib/python3.9/dist-packages/bitsandbytes/optim/optimizer.py", line 12, in <module>
[INFO ] 2023-05-24 15:17:10 PyProcess -     import bitsandbytes.functional as F
[INFO ] 2023-05-24 15:17:10 PyProcess -   File "/usr/local/lib/python3.9/dist-packages/bitsandbytes/functional.py", line 12, in <module>
[INFO ] 2023-05-24 15:17:10 PyProcess -     from scipy.stats import norm
[INFO ] 2023-05-24 15:17:10 PyProcess - ModuleNotFoundError: No module named 'scipy'
@lanking520
Copy link
Author

@TimDettmers should be an easy fix. Or we could find a way to make a workaround if scipy is not found to use numpy norm function

Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

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

No branches or pull requests

1 participant