[Bug/Model Request]: Is slower than sentence transformer for all-minilm-l6-v2
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- machine-learning, performance
Research direction
Reproduce the comparison using FastEmbed 0.3.3, Python 3.9.16 on macOS, and the all-MiniLM-L6-v2 model. Start at TextEmbedding and its synchronous embed call, compare it with SentenceTransformer.encode, and verify whether the benchmark uses equivalent inputs and batching. Done means identifying the performance difference and documenting or implementing a justified improvement.
Written by the indexing model from the issue text.
Description
What happened?
On benchmarking synchronous computation times for generating embeddings for
- Using sentence transformers: ~1300 msgs per sec
from sentence_transformers import SentenceTransformer
model_standard = SentenceTransformer("all-MiniLM-L6-v2")
start_time = time.time()
for i in range(iter_count):
model_standard.encode(random.sample(sentences, 1)[0])
time_standard = time.time() - start_time
print("Standard requires: {}s".format(time_standard))
print("{} processed per sec".format(batch_size*iter_count/time_standard))
VS
- Using FastEmbed (Synchronously): 800 msgs per sec
fast_model = TextEmbedding(model_name="sentence-transformers/all-MiniLM-L6-v2")
start_time = time.time()
for i in range(iter_count):
list(fast_model.embed(random.sample(sentences, 1)[0]))
time_standard = time.time() - start_time
print("Fast requires: {}s".format(time_standard))
print("{} processed per sec".format(batch_size*iter_count/time_standard))
I am using fastembed 0.3.3
pip show fastembed
Name: fastembed
Version: 0.3.3
Summary: Fast, light, accurate library built for retrieval embedding generation
Home-page: https://github.com/qdrant/fastembed
Author: Qdrant Team
Author-email: [email protected]
License: Apache License
Location: /Users/<>/PycharmProjects/Voyager/venv/lib/python3.9/site-packages
Requires: tqdm, PyStemmer, numpy, mmh3, onnxruntime, pillow, onnx, loguru, tokenizers, huggingface-hub, snowballstemmer, requests
Required-by:
Why is this working so slow wrt original impl.? What can I do to improve performance ?
What Python version are you on? e.g. python --version
3.9.16
Version
0.2.7 (Latest)
What os are you seeing the problem on?
MacOS
Relevant stack traces and/or logs
No response
- Dominant language
- Python
- Stars
- 3.3k
- Forks
- 314
- Avg merge
- 5d 7h
- Merged PRs (30d)
- 23
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from qdrant/fastembed
-
[Bug]: Bm25 splits Tamil, Hindi, Sinhala and other words on their combining marksPossibly taken @Nipuna-Lakruwan claimed this 12 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 30/100
qdrant/fastembed#886 · 2 comments ·
Maintainers usually reply within 4 days
-
miniCOIL clean_words mutates input and loses counts when normalized words collidePossibly taken @pear1-pea claimed this 20 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 1/100
Maintainers usually reply within 4 days
-
[Bug]: Revision-pinned HF downloads can falsely report intact files as corruptedPossibly taken @N7766 claimed this 24 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 82/100
Maintainers usually reply within 4 days
-
[Bug]: URL-backed custom models with the same basename reuse the wrong cached modelPossibly taken @rtmalikian claimed this 24 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 25/100
Maintainers usually reply within 4 days
-
[Bug]: rerank_pairs raises TypeError when pairs are passed as a tuple of pairsPossibly taken @michaelkillgta claimed this 54 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 22/100
Maintainers usually reply within 4 days
All issues in qdrant/fastembed
Similar issues
-
DMB documentation good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ubuntu/ubuntu-project-docs#921 ·
Maintainers usually reply within 1 day
-
⏳ Pending feedback 🐛 Bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
jumpserver/jumpserver#18282 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 76/100
ClickHouse/loom#2014 ·
Maintainers usually reply within 1 day
-
accepted
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
future-agi/future-agi#5274 ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 2 days