Vectorize MarkovCorpus.sample
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 76/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- performance
Research direction
Read src/bitsmith/eval/corpus.py and locate MarkovCorpus.sample; then review the determinism and entropy floor tests in tests/unit/test_eval.py. Benchmark sampling 100,000 tokens and confirm it takes well under a second while the tests still pass. If the token sequence changes for a seed, regenerate committed results with make reproduce in the same PR.
Written by the indexing model from the issue text.
Description
MarkovCorpus.sample draws one token at a time in a Python loop, which takes a few seconds
for the 60,000 tokens bitsmith sweep uses.
Task: make sampling faster, for example by drawing all uniform numbers up front and
doing the per-step lookup with precomputed cumulative tables, or by sampling in chunks.
Files
src/bitsmith/eval/corpus.pytests/unit/test_eval.py: the existing tests (determinism, entropy floor) must still pass
Note: if the token sequence changes for a given seed, regenerate the committed results
with make reproduce in the same PR.
Done when sampling 100,000 tokens takes well under a second on a laptop CPU.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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.
More from yashwanthdevavarapu/bitsmith
-
area: benchmarks good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area: benchmarks good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
area: cli area: formats good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
-
area: cli good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
area: benchmarks good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
All issues in yashwanthdevavarapu/bitsmith
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
aws-samples/sample-per-model-bedrock#857 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
521xueweihan/HelloGitHub#4328 ·
-
documentation maintainer-managed
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
awslabs/visual-asset-management-system#1418 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day