Vectorize MarkovCorpus.sample

Aperta
#9 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
76/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
performance

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: benchmarks good first issue performance

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.py
  • tests/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.

Lingua principale
Python
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di yashwanthdevavarapu/bitsmith

Tutte le issue di yashwanthdevavarapu/bitsmith

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.