Skip to content
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

Add benchmark vs tiktoken #1582

Merged
merged 2 commits into from
Jul 31, 2024
Merged

Add benchmark vs tiktoken #1582

merged 2 commits into from
Jul 31, 2024

Conversation

Narsil
Copy link
Collaborator

@Narsil Narsil commented Jul 31, 2024

Before making all the optimizations it's better to start with a clear picture of where we stand.

Benchmarking code checks llama-3.1 (which uses a regex splitting macro) against XNLI in 3 scenarios.

Single sentence (inference use case very often).
Many sentences (dataset).
Many sentences fused into a large blob (advanced use case potentially showcasing different profile).

==============
num_threads: 1, data size: 24.59 KB, documents: 10
tiktoken 	4.25 MB  / s
huggingface 	1.93 MB / s
==============
num_threads: 1, data size: 24.04 MB, documents: 10000
tiktoken 	5.17 MB  / s
huggingface 	2.05 MB / s
==============
num_threads: 1, data size: 24.04 MB, documents: 1
tiktoken 	5.88 MB  / s
huggingface 	1.28 MB / s
==============
num_threads: 2, data size: 24.59 KB, documents: 10
tiktoken 	6.49 MB  / s
huggingface 	1.88 MB / s
==============
num_threads: 2, data size: 24.04 MB, documents: 10000
tiktoken 	9.69 MB  / s
huggingface 	2.12 MB / s
==============
num_threads: 2, data size: 24.04 MB, documents: 1
tiktoken 	5.90 MB  / s
huggingface 	1.35 MB / s
==============
num_threads: 4, data size: 24.59 KB, documents: 10
tiktoken 	9.26 MB  / s
huggingface 	1.88 MB / s
==============
num_threads: 4, data size: 24.04 MB, documents: 10000
tiktoken 	14.71 MB  / s
huggingface 	2.16 MB / s
==============
num_threads: 4, data size: 24.04 MB, documents: 1
tiktoken 	5.67 MB  / s
huggingface 	1.39 MB / s
==============
num_threads: 8, data size: 24.59 KB, documents: 10
tiktoken 	7.35 MB  / s
huggingface 	1.95 MB / s
==============
num_threads: 8, data size: 24.04 MB, documents: 10000
tiktoken 	18.52 MB  / s
huggingface 	2.16 MB / s
==============
num_threads: 8, data size: 24.04 MB, documents: 1
tiktoken 	5.73 MB  / s
huggingface 	1.36 MB / s

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Narsil Narsil merged commit 35f338a into main Jul 31, 2024
12 checks passed
@Narsil Narsil deleted the add_benchmark branch July 31, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants