<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>PyO3 on Matt Suiche</title><link>https://www.msuiche.com/tags/pyo3/</link><description>Recent content in PyO3 on Matt Suiche</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 15 Oct 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://www.msuiche.com/tags/pyo3/index.xml" rel="self" type="application/rss+xml"/><item><title>RustBPE: High-Performance BPE Tokenizer Training in Rust</title><link>https://www.msuiche.com/posts/rustbpe-high-performance-bpe-tokenizer-training-in-rust/</link><pubDate>Wed, 15 Oct 2025 00:00:00 +0000</pubDate><guid>https://www.msuiche.com/posts/rustbpe-high-performance-bpe-tokenizer-training-in-rust/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;a href="#introduction" class="anchor" aria-label="Link to Introduction"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Byte Pair Encoding (BPE) tokenization is used in modern language models, but efficient training implementations are limited. OpenAI&amp;rsquo;s &lt;code&gt;tiktoken&lt;/code&gt; handles inference well, while HuggingFace&amp;rsquo;s &lt;code&gt;tokenizers&lt;/code&gt; supports training but has complexity and overhead. &lt;strong&gt;RustBPE&lt;/strong&gt; is a Rust implementation that provides training capabilities with better performance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;RustBPE was developed by Andrej Karpathy&lt;/strong&gt; as part of the &lt;a href="https://github.com/karpathy/nanochat/tree/master/rustbpe" target="_blank" rel="noopener"&gt;nanochat project&lt;/a&gt;. This analysis covers the RustBPE implementation, including its architecture, performance characteristics, and Python integration.&lt;/p&gt;</description></item></channel></rss>