Import error with bitsandbytes

#3
by Tejasram - opened

When i try to use the model, with the same code as given, i get the following error:

Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py", line 1364, in _get_module
return importlib.import_module("." + module_name, self.name)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/usr/local/lib/python3.10/dist-packages/transformers/pipelines/init.py", line 49, in
from .audio_classification import AudioClassificationPipeline
File "/usr/local/lib/python3.10/dist-packages/transformers/pipelines/audio_classification.py", line 21, in
from .base import PIPELINE_INIT_ARGS, Pipeline
File "/usr/local/lib/python3.10/dist-packages/transformers/pipelines/base.py", line 34, in
from ..modelcard import ModelCard
File "/usr/local/lib/python3.10/dist-packages/transformers/modelcard.py", line 48, in
from .training_args import ParallelMode
File "/usr/local/lib/python3.10/dist-packages/transformers/training_args.py", line 70, in
from accelerate.state import AcceleratorState, PartialState
File "/usr/local/lib/python3.10/dist-packages/accelerate/init.py", line 16, in
from .accelerator import Accelerator
File "/usr/local/lib/python3.10/dist-packages/accelerate/accelerator.py", line 35, in
from .checkpointing import load_accelerator_state, load_custom_state, save_accelerator_state, save_custom_state
File "/usr/local/lib/python3.10/dist-packages/accelerate/checkpointing.py", line 24, in
from .utils import (
File "/usr/local/lib/python3.10/dist-packages/accelerate/utils/init.py", line 171, in
from .bnb import has_4bit_bnb_layers, load_and_quantize_model
File "/usr/local/lib/python3.10/dist-packages/accelerate/utils/bnb.py", line 29, in
from ..big_modeling import dispatch_model, init_empty_weights
File "/usr/local/lib/python3.10/dist-packages/accelerate/big_modeling.py", line 24, in
from .hooks import (
File "/usr/local/lib/python3.10/dist-packages/accelerate/hooks.py", line 30, in
from .utils.other import recursive_getattr
File "/usr/local/lib/python3.10/dist-packages/accelerate/utils/other.py", line 36, in
from .transformer_engine import convert_model
File "/usr/local/lib/python3.10/dist-packages/accelerate/utils/transformer_engine.py", line 21, in
import transformer_engine.pytorch as te
File "/usr/local/lib/python3.10/dist-packages/transformer_engine/pytorch/init.py", line 6, in
from .module import LayerNormLinear
File "/usr/local/lib/python3.10/dist-packages/transformer_engine/pytorch/module/init.py", line 6, in
from .layernorm_linear import LayerNormLinear
File "/usr/local/lib/python3.10/dist-packages/transformer_engine/pytorch/module/layernorm_linear.py", line 13, in
from .. import cpp_extensions as tex
File "/usr/local/lib/python3.10/dist-packages/transformer_engine/pytorch/cpp_extensions/init.py", line 6, in
from transformer_engine_extensions import *
ImportError: /usr/local/lib/python3.10/dist-packages/transformer_engine_extensions.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/jovyan/mixtral_22.py", line 2, in
from transformers import AutoTokenizer, AutoModelForCausalLM,pipeline
File "", line 1075, in _handle_fromlist
File "/usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py", line 1354, in getattr
module = self._get_module(self._class_to_module[name])
File "/usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py", line 1366, in _get_module
raise RuntimeError(
RuntimeError: Failed to import transformers.pipelines because of the following error (look up to see its traceback):
/usr/local/lib/python3.10/dist-packages/transformer_engine_extensions.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

This error persists with different cuda and torch versions. Kindly take a look at it

Sign up or log in to comment