BERTopic icon indicating copy to clipboard operation
BERTopic copied to clipboard

cuda issue?

Open studentdave opened this issue 3 years ago • 2 comments

across multiple gcp, nividia t4 compute engines, in jupyterlab, we're getting this error (notably, we had to install with pip install --user bertopic)

system info: Machine type n1-highmem-64 (64 vCPUs, 416 GB RAM) GPU NVIDIA T4 x 4

TensorFlow Enterprise 2.8 (with LTS and Intel® MKL-DNN/MKL)

from bertopic import BERTopic

OSError Traceback (most recent call last) /opt/conda/lib/python3.7/site-packages/torch/init.py in _load_global_deps() 171 try: --> 172 ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL) 173 except OSError as err:

/opt/conda/lib/python3.7/ctypes/init.py in init(self, name, mode, handle, use_errno, use_last_error) 363 if handle is None: --> 364 self._handle = _dlopen(self._name, mode) 365 else:

OSError: /opt/conda/lib/python3.7/site-packages/torch/lib/../../nvidia/cublas/lib/libcublas.so.11: symbol cublasLtGetStatusString version libcublasLt.so.11 not defined in file libcublasLt.so.11 with link time reference

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last) /opt/conda/lib/python3.7/site-packages/transformers/utils/import_utils.py in _get_module(self, module_name) 1125 try: -> 1126 return importlib.import_module("." + module_name, self.name) 1127 except Exception as e:

/opt/conda/lib/python3.7/importlib/init.py in import_module(name, package) 126 level += 1 --> 127 return _bootstrap._gcd_import(name[level:], package, level) 128

/opt/conda/lib/python3.7/importlib/_bootstrap.py in _gcd_import(name, package, level)

/opt/conda/lib/python3.7/importlib/_bootstrap.py in find_and_load(name, import)

/opt/conda/lib/python3.7/importlib/_bootstrap.py in find_and_load_unlocked(name, import)

/opt/conda/lib/python3.7/importlib/_bootstrap.py in _load_unlocked(spec)

/opt/conda/lib/python3.7/importlib/_bootstrap_external.py in exec_module(self, module)

/opt/conda/lib/python3.7/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

/opt/conda/lib/python3.7/site-packages/transformers/pipelines/init.py in 44 ) ---> 45 from .audio_classification import AudioClassificationPipeline 46 from .automatic_speech_recognition import AutomaticSpeechRecognitionPipeline

/opt/conda/lib/python3.7/site-packages/transformers/pipelines/audio_classification.py in 20 from ..utils import add_end_docstrings, is_torch_available, logging ---> 21 from .base import PIPELINE_INIT_ARGS, Pipeline 22

/opt/conda/lib/python3.7/site-packages/transformers/pipelines/base.py in 35 from ..image_processing_utils import BaseImageProcessor ---> 36 from ..modelcard import ModelCard 37 from ..models.auto.configuration_auto import AutoConfig

/opt/conda/lib/python3.7/site-packages/transformers/modelcard.py in 47 ) ---> 48 from .training_args import ParallelMode 49 from .utils import (

/opt/conda/lib/python3.7/site-packages/transformers/training_args.py in 28 ---> 29 from .debug_utils import DebugOption 30 from .trainer_utils import (

/opt/conda/lib/python3.7/site-packages/transformers/debug_utils.py in 20 if is_torch_available(): ---> 21 import torch 22

/opt/conda/lib/python3.7/site-packages/torch/init.py in 216 if USE_GLOBAL_DEPS: --> 217 _load_global_deps() 218 from torch._C import * # noqa: F403

/opt/conda/lib/python3.7/site-packages/torch/init.py in _load_global_deps() 177 raise err --> 178 _preload_cuda_deps() 179 ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)

/opt/conda/lib/python3.7/site-packages/torch/init.py in _preload_cuda_deps() 157 --> 158 ctypes.CDLL(cublas_path) 159 ctypes.CDLL(cudnn_path)

/opt/conda/lib/python3.7/ctypes/init.py in init(self, name, mode, handle, use_errno, use_last_error) 363 if handle is None: --> 364 self._handle = _dlopen(self._name, mode) 365 else:

OSError: /opt/conda/lib/python3.7/site-packages/nvidia/cublas/lib/libcublas.so.11: symbol cublasLtGetStatusString version libcublasLt.so.11 not defined in file libcublasLt.so.11 with link time reference

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

RuntimeError Traceback (most recent call last) /var/tmp/ipykernel_10311/2624164442.py in ----> 1 from bertopic import BERTopic 2 from sklearn.datasets import fetch_20newsgroups 3

/opt/conda/lib/python3.7/site-packages/bertopic/init.py in ----> 1 from bertopic._bertopic import BERTopic 2 3 version = "0.14.1" 4 5 all = [

/opt/conda/lib/python3.7/site-packages/bertopic/_bertopic.py in 36 from bertopic.backend import BaseEmbedder 37 from bertopic.backend._utils import select_backend ---> 38 from bertopic.representation import BaseRepresentation 39 from bertopic.cluster._utils import hdbscan_delegator, is_supported_hdbscan 40 from bertopic._utils import MyLogger, check_documents_type, check_embeddings_shape, check_is_fitted

/opt/conda/lib/python3.7/site-packages/bertopic/representation/init.py in 7 # Text Generation using transformers 8 try: ----> 9 from bertopic.representation._textgeneration import TextGeneration 10 except ModuleNotFoundError: 11 msg = "pip install bertopic without --no-deps \n\n"

/opt/conda/lib/python3.7/site-packages/bertopic/representation/_textgeneration.py in 2 from tqdm import tqdm 3 from scipy.sparse import csr_matrix ----> 4 from transformers import pipeline, set_seed 5 from transformers.pipelines.base import Pipeline 6 from typing import Mapping, List, Tuple, Any, Union

/opt/conda/lib/python3.7/importlib/_bootstrap.py in handle_fromlist(module, fromlist, import, recursive)

/opt/conda/lib/python3.7/site-packages/transformers/utils/import_utils.py in getattr(self, name) 1114 value = self._get_module(name) 1115 elif name in self._class_to_module.keys(): -> 1116 module = self._get_module(self._class_to_module[name]) 1117 value = getattr(module, name) 1118 else:

/opt/conda/lib/python3.7/site-packages/transformers/utils/import_utils.py in _get_module(self, module_name) 1129 f"Failed to import {self.name}.{module_name} because of the following error (look up to see its" 1130 f" traceback):\n{e}" -> 1131 ) from e 1132 1133 def reduce(self):

RuntimeError: Failed to import transformers.pipelines because of the following error (look up to see its traceback): /opt/conda/lib/python3.7/site-packages/nvidia/cublas/lib/libcublas.so.11: symbol cublasLtGetStatusString version libcublasLt.so.11 not defined in file libcublasLt.so.11 with link time reference

haven't been able to resolve

studentdave avatar Mar 23 '23 10:03 studentdave

the way we "resolved" it:

pip install --user bertopic pip install --user tensorflow==2.11.* pip uninstall nvidia_cublas_cu11

not sure this is a correct solution.

studentdave avatar Mar 23 '23 11:03 studentdave

I believe this should be correct. Glad to hear that the issue was resolved!

MaartenGr avatar May 23 '23 08:05 MaartenGr