[BUG]: `verify --segment` checks a repeated segment again and counts it twice
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 88/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- cli, machine-learning, testing
Direzione di ricerca
Inizia in simple/ovl.py, nella logica di selezione dei segmenti intorno alle righe 667–672, poi segui l’elaborazione dell’argomento verify e la generazione del riepilogo. Aggiungi un rapido test di regressione che esegue il monkeypatch di verify_segment, passi un valore duplicato di --segment e verifichi che il segmento venga verificato una sola volta. Fatto significa che i valori duplicati vengono deduplicati prima del replay, il riepilogo nella console conta i segmenti distinti e local-verifications.jsonl contiene un solo record per quel segmento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug Description
ovl.py verify does not remove duplicate values from --segment. Each repeat is replayed from its checkpoint and counted as a separate segment. The console summary and local-verifications.jsonl both overstate how much was checked.
Code (simple/ovl.py#L667-L672):
segments = range(len(chain) - 1) if a.all else list(a.segment or [])
if a.random:
pool = [k for k in range(len(chain) - 1) if k not in segments]
...
for k in sorted(segments): # duplicates are kept
report["checks"].append({"segment": [k, k + 1], "match": verify_segment(a.data, run, chain, k)})
Why it matters
- The count is wrong.
verify --segment 0 0 0printsverify PASS: 4 checks; 3 of 7 segments, but only one distinct segment was checked. The README asks people to post their result line in Discord ("every independent check counts"), so an overstated count goes into the project's public tally. - It wastes GPU time and money. On an RTX 5090, one segment takes about 20 minutes (about US$0.50 at the README's ~US$1.50 per hour). Every repeat costs that again.
- The JSON record is wrong too.
local-verifications.jsonlstores[[0, 1], [0, 1], [0, 1]].
A typo such as SEGMENTS="7 7" (verify_segment.sh passes --segment $PICK), or a script that merges segment lists, is enough to trigger this.
Steps to Reproduce
Commit 913dd5a, CPU only. This trains a tiny run with one update per phase, then replays a real segment. Nothing is mocked. It takes about 10 minutes on a laptop CPU, because each replay of the 23M-parameter model takes about 90 seconds.
import json, os, subprocess, sys, tempfile
from pathlib import Path
import numpy as np
with tempfile.TemporaryDirectory() as tmp:
data, run = Path(tmp) / "prep", Path(tmp) / "run"
for phase in ("wikipedia", "conversation"):
d = data / phase; d.mkdir(parents=True)
np.full(100, 7, dtype="<u2").tofile(d / "tokens.u16")
np.ones(100, dtype=np.uint8).tofile(d / "mask.u8")
(d / "documents.jsonl").write_text(json.dumps({"tokens": 100, "offset": 0, "target_start": 0, "targets": 100}) + "\n")
(d / "stream.json").write_text(json.dumps({"phase": phase, "targets": 100}))
env = {**os.environ, "OVL_DEVICE": "cpu", "OVL_TIMESTAMP": "0", "OVL_BOUNDARY_EVERY": "1"}
ovl = [sys.executable, "simple/ovl.py"]
subprocess.run(ovl + ["train", "--data", str(data), "--out", str(run)], env=env, check=True, capture_output=True)
r = subprocess.run(ovl + ["verify", "--run", str(run), "--data", str(data), "--no-anchor",
"--segment", "0", "0", "0"], env=env, capture_output=True, text=True)
print(r.stdout)
print(json.loads((run / "local-verifications.jsonl").read_text().splitlines()[-1])["checks"])
Actual output:
initialization: MATCH
segment 0->1 (base): MATCH in 88 s
segment 0->1 (base): MATCH in 83 s
segment 0->1 (base): MATCH in 96 s
verify PASS: 4 checks; 3 of 7 segments
[{'initialization': True}, {'match': True, 'segment': [0, 1]}, {'match': True, 'segment': [0, 1]}, {'match': True, 'segment': [0, 1]}]
With --segment 0, the same run prints verify PASS: 2 checks; 1 of 7 segments, which is correct.
Expected Behavior
Each distinct segment is replayed once, and the summary counts distinct segments. --segment 0 0 0 should print 1 of 7 segments.
Proposed Fix
Build the selection as a set:
segments = set(range(len(chain) - 1)) if a.all else set(a.segment or [])
if a.random:
pool = [k for k in range(len(chain) - 1) if k not in segments]
segments |= {pool.pop(secrets.randbelow(len(pool))) for _ in range(min(a.random, len(pool)))}
for k in sorted(segments):
...
Optionally, print a note such as segment 0 given 3 times; checking it once, so the user can see that the input was changed.
Add a regression test that --segment 0 0 calls verify_segment once and the summary says 1 of N. The test can monkeypatch verify_segment, so it runs in milliseconds.
The fix does not change the bits. Only the segment selection changes.
Logs and Screenshots
No response
Environment Details
No response
Impact
Critical - Application is unusable
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- Lingua principale
- Python
- Stelle
- 27
- Fork
- 72
- Merge medio
- 3g 15h
- PR unite (30g)
- 32
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AOSSIE-Org/OpenVerifiableLLM
-
[BUG]: simple/ovl.py read_chain raises raw tracebacks when a chain.jsonl line is valid JSON but not a chain entryForse già presa @Arnav0107 l’ha presa 1 giorno fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
AOSSIE-Org/OpenVerifiableLLM#395 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
[BUG]: ovl.py verify --weights crashes with AttributeError on checkpoint .pt filesForse già presa @panshularora l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
AOSSIE-Org/OpenVerifiableLLM#387 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
[BUG]: verify_segment accepts empty, wrong-phase, or non-positive fork exclusions as MATCHForse già presa @panshularora l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
AOSSIE-Org/OpenVerifiableLLM#385 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
[BUG]: preparation.lock install fails on macOSForse già presa @darshith2527-sketch l’ha presa 7 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
AOSSIE-Org/OpenVerifiableLLM#357 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
[BUG]: Forked runs omit timestamps for inherited chain entriesForse già presa @pavithra-r06 l’ha presa 12 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
AOSSIE-Org/OpenVerifiableLLM#334 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di AOSSIE-Org/OpenVerifiableLLM
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 89/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
smk762/argus-atlas#97 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
xdslproject/xdsl#6842 ·
I maintainer di solito rispondono entro 1 giorno