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

Reproducing Benchmark Results #21

Closed
mert-kurttutan opened this issue Jan 22, 2023 · 3 comments
Closed

Reproducing Benchmark Results #21

mert-kurttutan opened this issue Jan 22, 2023 · 3 comments

Comments

@mert-kurttutan
Copy link

Hi,

I want to reproduce the result in presented in README.md, to the extent my hardware would allow. I am aware of the scripts/benchmark.py file and could run tiktoken with different number of threads. But when it comes to setting number of thread for huggingface tokenizers, I could not set it. I tried using environment variable RAYON_RS_NUM_CPUS, but the number of threads did not change.

Any help is appreciated!

@mert-kurttutan mert-kurttutan changed the title Reproducing Results Reproducing Benchmark Results Jan 22, 2023
@mert-kurttutan
Copy link
Author

It turns out the environment used for this setting change into RAYON_RS_NUM_THREADS. Now, it is working.

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Jan 22, 2023

Yeah, I was using the environment variable RAYON_NUM_THREADS to control how many threads huggingface tokenizers used. For convenience in the benchmark, I also use the value of that environment variable to set num_threads

num_threads = int(os.environ["RAYON_NUM_THREADS"])

enc.encode_ordinary_batch(documents, num_threads=num_threads)

(Note that there is no environment variable that affects thread counts used in tiktoken proper / tiktoken does not use rayon)

@hauntsaninja
Copy link
Collaborator

Please let me know if you have any further difficulty reproducing benchmark numbers!

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

No branches or pull requests

2 participants