[BUG]: bench_sizes.py leaks prefetch threads on early break and crashes on short streams or CPU
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- performance
Research direction
Start in simple/bench_sizes.py, lines 34-51, where the prefetch loop breaks early and calls torch.cuda functions. Compare with how ovl.py closes its prefetch iterator after #308. Done means the iterator is closed on break, short streams fail with a clear message, and CUDA calls are guarded by ovl.DEV. Pull request #382 is already open against this issue, so check it before starting.
Written by the indexing model from the issue text.
Description
Summary
simple/bench_sizes.py has two bugs when iterating over ovl.prefetch(...) across the 5 model sizes in SIZES:
- Leaked
prefetchproducer threads on earlybreak:for b, _ in ovl.prefetch(a.data, "wikipedia", [0, 0]):breaks out of the loop aftera.secondswithout closing theprefetchiterator (unlikeovl.py, which was fixed in #308). Becausebench_sizes.pyloops over 5 progressively larger models in one process, each timed break leaves a live producer thread blocked inq.put()holding queued batch tensors. - Crash on short streams (
<= 30updates): Ifovl.prefetch(...)yields 30 or fewer batches,t0remainsNone(orn - 30 == 0), soms = 1000 * (time.time() - t0) / (n - 30)crashes withTypeError: unsupported operand type(s) for -: 'float' and 'NoneType'orZeroDivisionError. - Unconditional CUDA calls:
torch.cuda.synchronize(),torch.cuda.max_memory_allocated(),torch.cuda.empty_cache(), andtorch.cuda.reset_peak_memory_stats()are called without checkingovl.DEV == "cuda".
Source
simple/bench_sizes.py(lines 34–51)
Expected Behavior
- Wrap the
ovl.prefetch(...)iterator incontextlib.closing(...)so the producer thread is cancelled and joined when the loop breaks or exits. - Fail cleanly with a clear error message if fewer than 31 updates are available in the stream.
- Guard
torch.cuda.*calls withovl.DEV == "cuda".
- Dominant language
- Python
- Stars
- 27
- Forks
- 72
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 45
Getting set up
- No Dockerfile or Docker Compose file
- No 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 AOSSIE-Org/OpenVerifiableLLM
-
[BUG]: ovl.py verify --weights crashes with AttributeError on checkpoint .pt filesPossibly taken @Anurag1428 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
AOSSIE-Org/OpenVerifiableLLM#387 · 1 comment ·
Maintainers usually reply within 1 day
-
[BUG]: verify_segment accepts empty, wrong-phase, or non-positive fork exclusions as MATCHPossibly taken @Arnav0107 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AOSSIE-Org/OpenVerifiableLLM#385 · 3 comments ·
Maintainers usually reply within 1 day
-
[BUG]: preparation.lock install fails on macOSPossibly taken @darshith2527-sketch claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AOSSIE-Org/OpenVerifiableLLM#357 · 3 comments ·
Maintainers usually reply within 1 day
-
[BUG]: Forked runs omit timestamps for inherited chain entriesPossibly taken @pavithra-r06 claimed this 9 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AOSSIE-Org/OpenVerifiableLLM#334 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
[BUG]: review_ckpt.py passes a run that has .pt files no chain entry coversPossibly taken @arshil42 claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
AOSSIE-Org/OpenVerifiableLLM#332 · 4 comments · 1 assignee ·
Maintainers usually reply within 1 day
All issues in AOSSIE-Org/OpenVerifiableLLM
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
bad-antics/lateralus-lang#1140 ·
Maintainers usually reply within 4 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 3 days
-
fixture good first issue help wanted vendor:cisco
Difficulty 1/5 1-3 hours Newbie friendliness 85/100