Find answers from the community

Updated 3 months ago

When generating embeddings, is there a way to use the gpu instead of cpu?

When generating embeddings, is there a way to use the gpu instead of cpu?
k
m
6 comments
Please stand by @marian as I search the knowledge base. I normally take about 20 seconds or so. :wave:
----------------------
Yes, LlamaIndex allows you to use GPU for generating embeddings. Specifically, when using the LlamaCPP library with LlamaIndex, it is recommended to install the package so that it is compiled with GPU support for optimal performance.

Here are some general guidelines for GPU usage:

  • Use CuBLAS if you have CUDA and an NVidia GPU
  • Use METAL if you are running on an M1/M2 MacBook
  • Use CLBLAST if you are running on an AMD/Intel GPU
You can follow the installation guide here () to install LlamaCPP with GPU support.

Please note that the specific method to use GPU instead of CPU may vary depending on the specific embedding model or library you are using.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
how can i force 'VectorStoreIndex.from_documents()' to use gpu?
@kapa.ai how can i force 'VectorStoreIndex.from_documents()' to use gpu?
Let me check the knowledge base for you. One moment! :books:
----------------------
Hmm, I don't know enough to give you a confident answer yet. The provided extracts do not contain information on how to force VectorStoreIndex.from_documents() to use GPU. I recommend checking the official LlamaIndex documentation or the source code for more details.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Add a reply
Sign up and join the conversation on Discord