Performance and Multithreading in YouTokenToMe
masterYouTokenToMe is designed for high-speed BPE training and tokenization, particularly for languages with large alphabets. It supports multithreading for both training and tokenization processes.
Threading Behavior
- Training: Performance scaling for training typically plateaus after 8 threads. The library effectively uses
min(8, n_threads)for training operations. - Tokenization: Scales more linearly with thread count compared to training.
Recommended Configuration
To allow the library to automatically determine the optimal number of threads for your hardware, use n_threads=-1.