-
Notifications
You must be signed in to change notification settings - Fork 776
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
GPU error #728
Comments
This is the error I get when trying to run the google colab version of the your package. I am trying to run the GPU enhanced version to increase my ability of running large datasets. |
!nvidia-smi |
This get the RAPIDS-Colab install files and test check your GPU. Run this and the next cell only.Please read the output of this cell. If your Colab Instance is not RAPIDS compatible, it will warn you and give you remediation steps.!pip install pynvml |
This will update the Colab environment and restart the kernel. Don't run the next cell until you see the session crash.!bash rapidsai-csp-utils/colab/update_gcc.sh |
This will install CondaColab. This will restart your kernel one last time. Run this cell by itself and only run the next cell once you see the session crash.import condacolab |
you can now run the rest of the cells as normalimport condacolab |
Installing RAPIDS is now 'python rapidsai-csp-utils/colab/install_rapids.py 'The options are 'stable' and 'nightly'. Leaving it blank or adding any other words will default to stable.!python rapidsai-csp-utils/colab/install_rapids.py stable |
from bertopic import BERTopic Create instances of GPU-accelerated UMAP and HDBSCANumap_model = UMAP(n_components=5, n_neighbors=15, min_dist=0.0) Pass the above models to be used in BERTopic#topic_model = BERTopic(umap_model=umap_model, hdbscan_model=hdbscan_model) |
I have pasted the code above. This is based on your recommendation on your FAQ page on how to use GPU to speed up the model. |
https://medium.com/rapids-ai/accelerating-topic-modeling-with-rapids-and-bert-models-be9909eeed2 |
Please let me know if I am doing something wrong or how to proceed. |
Based on your error message, the recent commit in the HDBSCAN repo, and that joblib was recently updated, it seems that the problem should be resolved by either installing HDBSCAN from its main branch or by installing a previous version of joblib after installing BERTopic:
Hopefully, this should fix your issue! Also, a small tip, whenever you post code in an issue on GitHub, it helps to put it into a code block for easier readability. |
Exception Traceback (most recent call last) 16 frames /usr/local/lib/python3.7/site-packages/bertopic/_bertopic.py in /usr/local/lib/python3.7/site-packages/umap/init.py in /usr/local/lib/python3.7/site-packages/umap/umap_.py in /usr/local/lib/python3.7/site-packages/umap/sparse.py in /usr/local/lib/python3.7/site-packages/umap/utils.py in /usr/local/lib/python3.7/site-packages/numba/core/decorators.py in wrapper(func) /usr/local/lib/python3.7/site-packages/numba/core/dispatcher.py in compile(self, sig) /usr/local/lib/python3.7/site-packages/numba/core/dispatcher.py in compile(self, args, return_type) /usr/local/lib/python3.7/site-packages/numba/core/dispatcher.py in _compile_cached(self, args, return_type) /usr/local/lib/python3.7/site-packages/numba/core/dispatcher.py in _compile_core(self, args, return_type) /usr/local/lib/python3.7/site-packages/numba/core/compiler.py in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class) /usr/local/lib/python3.7/site-packages/numba/core/compiler.py in init(self, typingctx, targetctx, library, args, return_type, flags, locals) /usr/local/lib/python3.7/site-packages/numba/core/typing/context.py in refresh(self) /usr/local/lib/python3.7/site-packages/numba/core/typing/context.py in load_additional_registries(self) /usr/local/lib/python3.7/site-packages/numba/core/typing/cffi_utils.py in /usr/local/lib/python3.7/dist-packages/cffi/api.py in init(self, backend) Exception: Version mismatch: this is the 'cffi' package version 1.15.1, located in '/usr/local/lib/python3.7/dist-packages/cffi/api.py'. When we import the top-level '_cffi_backend' extension module, we get version 1.15.0, located in '/usr/local/lib/python3.7/site-packages/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'. The two versions should be equal; check your installation.`` |
!pip install bertopic |
I did as you recommended and I obtained a version mismatch. |
Rather than use the RAPIDS Colab script, I recommend combining the suggestion above with this comment about SageMaker Studio Lab (perhaps using new versions as needed/useful) |
I used what beckernick suggested in combination with some of the recommendations MaartenGr recommended and it worked. I gained a considerable improvement in the processing power. I appreciate both of your help in this. I took a couple of tries but the code ended up working. |
TypeError Traceback (most recent call last)
in
----> 1 from bertopic import BERTopic
2 from cuml.cluster import HDBSCAN
3 from cuml.manifold import UMAP
4 # Create instances of GPU-accelerated UMAP and HDBSCAN
5 umap_model = UMAP(n_components=5, n_neighbors=15, min_dist=0.0)
3 frames
/usr/local/lib/python3.7/dist-packages/hdbscan/hdbscan_.py in
507 leaf_size=40,
508 algorithm="best",
--> 509 memory=Memory(cachedir=None, verbose=0),
510 approx_min_span_tree=True,
511 gen_min_span_tree=False,
TypeError: init() got an unexpected keyword argument 'cachedir'
The text was updated successfully, but these errors were encountered: