Recursive AI

Tokenizer speed: x64

All onenlp docs

See speed-x64.md for machine, input hashes, versions and method. Speedup is comparator time divided by ours. Load is information, not gated.

Inputs: short 59 chars, medium 513 chars, long 990287 bytes (UTF-8).

familyoperationsizeourscomparatorspeedupalloc oursalloc comparatorpeak extra RSS ourspeak extra RSS comparatornote
WordPiece (bert-base-uncased)load-37.15 ms22.89 ms0.62x----load time; ours from tokenizer.json
WordPiece (bert-base-uncased)encode-to-idsshort289 ns899 ns3.11x0 B456 B8.0 KB4.0 KB
WordPiece (bert-base-uncased)countshort287 ns821 ns2.86x0 B240 B4.0 KB0 B
WordPiece (bert-base-uncased)decodeshort71 ns167 ns2.35x144 B176 B4.0 KB4.0 KB
WordPiece (bert-base-uncased)encode-to-idsmedium2.85 µs7.63 µs2.68x0 B2.3 KB36.0 KB4.0 KB
WordPiece (bert-base-uncased)countmedium2.92 µs7.59 µs2.60x0 B1.1 KB0 B64.0 KB
WordPiece (bert-base-uncased)decodemedium-------decoded text differs at char 74 (lengths 525 vs 519)
WordPiece (bert-base-uncased)encode-to-idslong-------ids differ: 357483 vs 356166 tokens, first difference at 159 (ours 1456, comparator 100)
WordPiece (bert-base-uncased)countlong-------ids differ: 357483 vs 356166 tokens, first difference at 159 (ours 1456, comparator 100)
WordPiece (bert-base-uncased)decodelong-------ids differ: 357483 vs 356166 tokens, first difference at 159 (ours 1456, comparator 100)
Unigram (xlm-roberta-base)load-260.55 ms766.93 ms2.94x----load time; ours from tokenizer.json
Unigram (xlm-roberta-base)encode-to-idsshort206 ns1.40 µs6.80x0 B216 B0 B15.3 MB
Unigram (xlm-roberta-base)countshort203 ns1.42 µs7.01x0 B0 B0 B0 B
Unigram (xlm-roberta-base)decodeshort73 ns140 ns1.92x144 B176 B0 B56.0 KB
Unigram (xlm-roberta-base)encode-to-idsmedium1.66 µs11.47 µs6.93x0 B2.2 KB0 B32.0 KB
Unigram (xlm-roberta-base)countmedium1.70 µs12.32 µs7.24x0 B0 B0 B440.0 KB
Unigram (xlm-roberta-base)decodemedium658 ns1.50 µs2.28x1.0 KB1.1 KB4.0 MB0 B
Unigram (xlm-roberta-base)encode-to-idslong-------ids differ: 250378 vs 251115 tokens, first difference at 30076 (ours 49729, comparator 1759)
Unigram (xlm-roberta-base)countlong-------ids differ: 250378 vs 251115 tokens, first difference at 30076 (ours 49729, comparator 1759)
Unigram (xlm-roberta-base)decodelong-------ids differ: 250378 vs 251115 tokens, first difference at 30076 (ours 49729, comparator 1759)
SentencePiece BPE, byte fallback (TinyLlama)load-60.91 ms11.69 ms0.19x----load time; ours from tokenizer.json
SentencePiece BPE, byte fallback (TinyLlama)encode-to-idsshort92 ns4.08 µs44.59x0 B1.6 KB0 B0 B
SentencePiece BPE, byte fallback (TinyLlama)countshort87 ns4.21 µs48.55x0 B1.4 KB0 B0 B
SentencePiece BPE, byte fallback (TinyLlama)decodeshort79 ns148 ns1.88x144 B176 B0 B0 B
SentencePiece BPE, byte fallback (TinyLlama)encode-to-idsmedium12.26 µs43.60 µs3.56x0 B12.3 KB0 B12.0 KB
SentencePiece BPE, byte fallback (TinyLlama)countmedium12.24 µs43.22 µs3.53x0 B11.1 KB12.0 KB0 B
SentencePiece BPE, byte fallback (TinyLlama)decodemedium707 ns1.56 µs2.21x1.0 KB1.1 KB0 B0 B
SentencePiece BPE, byte fallback (TinyLlama)encode-to-idslong89.74 ms262.47 ms2.92x1.8 MB21.5 MB0 B55.9 MB
SentencePiece BPE, byte fallback (TinyLlama)countlong87.95 ms252.61 ms2.87x1.8 MB17.5 MB0 B26.3 MB
SentencePiece BPE, byte fallback (TinyLlama)decodelong4.50 ms6.54 ms1.45x1.6 MB1.6 MB87.6 MB56.6 MB
Byte-level BPE (gpt2)load-31.46 ms24.78 ms0.79x----load time; ours from tokenizer.json
Byte-level BPE (gpt2)encode-to-idsshort454 ns722 ns1.59x0 B312 B0 B0 B
Byte-level BPE (gpt2)countshort442 ns650 ns1.47x0 B96 B0 B0 B
Byte-level BPE (gpt2)decodeshort62 ns120 ns1.93x144 B176 B0 B0 B
Byte-level BPE (gpt2)encode-to-idsmedium3.96 µs6.53 µs1.65x0 B1.2 KB0 B0 B
Byte-level BPE (gpt2)countmedium4.11 µs5.97 µs1.45x0 B96 B0 B0 B
Byte-level BPE (gpt2)decodemedium444 ns990 ns2.23x1.0 KB1.1 KB4.0 KB0 B
Byte-level BPE (gpt2)encode-to-idslong28.81 ms63.16 ms2.19x0 B14.0 MB12.0 KB65.8 MB
Byte-level BPE (gpt2)countlong28.69 ms63.88 ms2.23x0 B10.0 MB0 B0 B
Byte-level BPE (gpt2)decodelong4.71 ms7.23 ms1.54x1.6 MB1.6 MB124.0 MB60.5 MB
Tiktoken cl100k_baseload-30.39 ms23.48 ms0.77x----load time; ours from cl100k_base.tiktoken
Tiktoken cl100k_baseencode-to-idsshort510 ns711 ns1.39x408 B312 B0 B0 B
Tiktoken cl100k_basecountshort510 ns664 ns1.30x408 B96 B0 B0 B
Tiktoken cl100k_basedecodeshort71 ns108 ns1.51x144 B176 B0 B0 B
Tiktoken cl100k_baseencode-to-idsmedium5.16 µs6.68 µs1.30x1.3 KB1.2 KB0 B0 B
Tiktoken cl100k_basecountmedium5.21 µs5.90 µs1.13x1.3 KB96 B0 B96.0 KB
Tiktoken cl100k_basedecodemedium522 ns1.03 µs1.97x1.0 KB1.1 KB0 B0 B
Tiktoken cl100k_baseencode-to-idslong47.19 ms72.39 ms1.53x8.8 MB12.5 MB53.2 MB20.4 MB
Tiktoken cl100k_basecountlong47.82 ms63.87 ms1.34x8.8 MB8.5 MB36.5 MB3.8 MB
Tiktoken cl100k_basedecodelong4.41 ms6.22 ms1.41x1.6 MB1.6 MB38.6 MB72.3 MB
Tiktoken o200k_baseload-33.55 ms50.85 ms1.52x----load time; ours from o200k_base.tiktoken
Tiktoken o200k_baseencode-to-idsshort576 ns772 ns1.34x408 B312 B0 B0 B
Tiktoken o200k_basecountshort592 ns741 ns1.25x408 B96 B0 B0 B
Tiktoken o200k_basedecodeshort70 ns110 ns1.58x144 B176 B0 B0 B
Tiktoken o200k_baseencode-to-idsmedium5.46 µs6.84 µs1.25x1.3 KB1.2 KB0 B0 B
Tiktoken o200k_basecountmedium5.24 µs6.59 µs1.26x1.3 KB96 B8.0 KB0 B
Tiktoken o200k_basedecodemedium553 ns948 ns1.71x1.0 KB1.1 KB0 B0 B
Tiktoken o200k_baseencode-to-idslong46.13 ms71.88 ms1.56x8.8 MB10.2 MB130.9 MB7.8 MB
Tiktoken o200k_basecountlong43.73 ms64.85 ms1.48x8.8 MB6.2 MB62.3 MB0 B
Tiktoken o200k_basedecodelong4.24 ms5.85 ms1.38x1.6 MB1.6 MB66.4 MB65.1 MB