fastembed
fastembed copied to clipboard
[Bug]: warning about nodes not assigned to the preferred execution providers when running on GPU
What happened?
Not really a bug, more of a warning when generating embeddings with fastembed-gpu following this docs:
I am getting these warnings:
[W:onnxruntime:, session_state.cc:1168 VerifyEachNodeIsAssignedToAnEp]
Some nodes were not assigned to the preferred execution providers which may or may not have an negative impact on performance. e.g. ORT explicitly assigns shape related ops to CPU to improve perf.
[W:onnxruntime:, session_state.cc:1170 VerifyEachNodeIsAssignedToAnEp]
Rerunning with verbose output on a non-minimal build will show node assignments.
When I print embedding_model_gpu.model.model.get_providers() I can see these available providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'] (cf. below for reproducible example)
Can this warning be dealt with elegantly? What is this really about? Thanks a lot
What is the expected behaviour?
No response
A minimal reproducible example
To be run with uv run scriptname.py:
# /// script
# dependencies = [
# "fastembed-gpu",
# ]
# ///
from fastembed import TextEmbedding
embedding_model_gpu = TextEmbedding(
model_name="BAAI/bge-small-en-v1.5", providers=["CUDAExecutionProvider"]
)
print(embedding_model_gpu.model.model.get_providers())
documents: list[str] = [
"Demonstrating GPU acceleration in fastembed 1",
"Demonstrating GPU acceleration in fastembed 2",
"Demonstrating GPU acceleration in fastembed 3",
]
embedded = list(embedding_model_gpu.embed(documents))
print(embedded)
Running on CUDA Version: 12.4
What Python version are you on? e.g. python --version
Python 3.12.8
FastEmbed version
v0.5.1
What os are you seeing the problem on?
Linux
Relevant stack traces and/or logs