Interest in porting any of the implementation from TokenDagger? (With Possible PR)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 19.3k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
I saw, tokendagger, a drop-in replacement for tiktokken that appears to have some different performance characteristics.
Would there be any interest in porting over those changes to tiktokken? I see two big differences -- one is how it handles special tokens and the other are regex-related modifications -- IE using PCRE2 JIT, but hyperscan might be even faster.
Happy to give it a shot and run a few benchmarks!
Here's a rough implementation of how tokendagger handles special tokens, which would be more performant when there's a large special token library, but the user is only working with a small subset of those tokens. Not so useful for GPT's tokenization, which is the focus of tiktokken, but it could speed up when it's being used for other implementations.
IE: we iterate through the tokens with a simple find and cache the locations of those tokens instead of building out a special regex.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing TokenDagger and the rough implementation linked in Jeffrharr/tiktoken#1, then compare its special-token handling and regex-related changes with tiktoken. Run benchmarks for the proposed approaches, including PCRE2 JIT or Hyperscan if relevant. Done would be a scoped port with benchmark results and a clear decision about which changes to include.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100