gpu-device-evidence · 20a582ee2af1
Browse filesFiles changed (14)
- docs/assets/study.json+15
- docs/usage.md+2
- reports/experiments/new-judges/q25-1p5b/experiment.md+1-1
- reports/experiments/new-judges/q35-4b-ollama/experiment.md+1-1
- reports/experiments/new-judges/q35-9b-ollama/experiment.md+1-1
- reports/newer-frozen-judges.md+2
- src/study/frozen_audit.py+6-2
- src/study/frozen_device.ps1Added+24
- src/study/frozen_device.pyAdded+43
- src/study/frozen_gpu.py+14-1
- src/study/frozen_report.py+7-1
- src/study/frozen_suite.py+3-1
- src/study/publish.py+5-1
- tests/test_frozen_screen.py+11
240435 unmodified lines24043624043724043824043924044024044124044224044324044424044533 unmodified lines240479240480240481240482240483240484240485100 unmodified lines24058624058724058824058924059024059124059224059324059424059533 unmodified lines240629240630240631240632240633240634240635100 unmodified lines24073624073724073824073924074024074124074224074324074424074515 unmodified lines240761240762240763240764240765240766240767240435 unmodified lines "audit": { "calls": 416, "matched_masked_outputs": 32, "error_positions": { "nonfinal": 16, "final": 16 }, "examples": { "failed": { "key": "0360e34dc98fec16268444b3951abf4b5a78f76c98630b472a6a26b8406c9539",33 unmodified lines } } }, "devices": [], "gpu": { "peak_dedicated_mib": 5627.578125, "engines": [100 unmodified lines "audit": { "calls": 416, "matched_masked_outputs": 32, "error_positions": { "nonfinal": 16, "final": 16 }, "examples": { "failed": { "key": "0360e34dc98fec16268444b3951abf4b5a78f76c98630b472a6a26b8406c9539",33 unmodified lines } } }, "devices": [], "gpu": { "peak_dedicated_mib": 2783.65234375, "engines": [100 unmodified lines "audit": { "calls": 416, "matched_masked_outputs": 32, "error_positions": { "nonfinal": 16, "final": 16 }, "examples": { "failed": { "key": "0360e34dc98fec16268444b3951abf4b5a78f76c98630b472a6a26b8406c9539",15 unmodified lines } } }, "devices": [], "gpu": { "peak_dedicated_mib": 1261.5390625, "engines": [60 unmodified lines616263646560 unmodified lines```
The command downloads and checks each artifact, verifies full GPU placement, runs fixed-answer and evidence-twin probes, and confirms the selected judge on independent development IDs. Restart the same command after interruption. It checks prompt and configuration identity before reusing completed calls. Keep the archived calibrated base replay under `results/calibrated/base/`. Use the default local mode for independent replications. The research repository owner uses `--publish` to release every completed milestone. All optimizer work remains deferred. [Study protocol](../reports/newer-frozen-judges.md)
On Windows the device sampler records the llama.cpp process's dedicated and shared allocations and cumulative GPU engine running time. Each recorded native graph assignment is checked against CUDA0 when releasing the results. The Hugging Face dataset contains compressed server and prompt logs. These counters and the separate prompt-processing and decoding durations measure different parts of execution. [Windows GPU accounting](https://devblogs.microsoft.com/directx/gpus-in-the-task-manager/) · [Raw public archive](https://huggingface.co/datasets/BurnyCoder/recursive-judge-grpo-study)8 unmodified lines91011121213148 unmodified lines| Qwen2.5-1.5B-Instruct · screen · balanced | 32/64 | 28/64 | 28/64 | 0/32 | 0/32 || Qwen2.5-1.5B-Instruct · screen · natural | 23/32 | 19/32 | 13/32 | — | — |
The release checked 416 scored calls against the original prompts, raw generated text and independent arithmetic values. The masked twins returned identical token sequences on 32/32 pairs.The release checked 416 scored calls against the original prompts, raw generated text and independent arithmetic values. The masked twins returned identical token sequences on 32/32 pairs. The balanced invalid traces contained 16 first errors before the final step and 16 at the final step.
Windows sampled the dedicated allocation of the llama.cpp process at up to 1,262 MiB. At its last sample, per-process engine running time was Copy 0.4 s, 3D 39.2 s. Engine counters include model loading. Sampling can end before the final kernel completes. [Windows GPU accounting](https://devblogs.microsoft.com/directx/gpus-in-the-task-manager/).8 unmodified lines91011121213148 unmodified lines| Qwen3.5-4B · deployment replicate · balanced | 32/64 | 32/64 | 32/64 | 1/32 | 0/32 || Qwen3.5-4B · deployment replicate · natural | 26/32 | 26/32 | 26/32 | — | — |
The release checked 416 scored calls against the original prompts, raw generated text and independent arithmetic values. The masked twins returned identical token sequences on 32/32 pairs.The release checked 416 scored calls against the original prompts, raw generated text and independent arithmetic values. The masked twins returned identical token sequences on 32/32 pairs. The balanced invalid traces contained 16 first errors before the final step and 16 at the final step.
Windows sampled the dedicated allocation of the llama.cpp process at up to 2,784 MiB. At its last sample, per-process engine running time was Copy 4.1 s, 3D 1844674407025.2 s. Engine counters include model loading. Sampling can end before the final kernel completes. [Windows GPU accounting](https://devblogs.microsoft.com/directx/gpus-in-the-task-manager/).8 unmodified lines91011121213148 unmodified lines| Qwen3.5-9B · deployment replicate · balanced | 37/64 | 44/64 | 43/64 | 1/32 | 0/32 || Qwen3.5-9B · deployment replicate · natural | 23/32 | 24/32 | 24/32 | — | — |
The release checked 416 scored calls against the original prompts, raw generated text and independent arithmetic values. The masked twins returned identical token sequences on 32/32 pairs.The release checked 416 scored calls against the original prompts, raw generated text and independent arithmetic values. The masked twins returned identical token sequences on 32/32 pairs. The balanced invalid traces contained 16 first errors before the final step and 16 at the final step.
Windows sampled the dedicated allocation of the llama.cpp process at up to 5,628 MiB. At its last sample, per-process engine running time was Copy 4.4 s, 3D 195.5 s. Engine counters include model loading. Sampling can end before the final kernel completes. [Windows GPU accounting](https://devblogs.microsoft.com/directx/gpus-in-the-task-manager/).27 unmodified lines28293031323327 unmodified lines
## Runtime correction before comparing scores
The balanced replay changes one numbered value. On the two-step family, its fixed error index alternates between the first and final step. The per-model audit reports both counts. This implementation detail narrows the interpretation of the protocol's phrase “one incorrect intermediate step.”
The initial 9B deployment pilot revealed that the chat endpoint returned an empty reasoning wrapper from the prompt template as part of the assistant message. The strict grader treated the wrapper as output, and successor prompts included the wrapper. The archive retains all delivered messages. This pilot supplies no accuracy estimate. For every scored run, explicitly render the native non-thinking template and request its raw completion. Store the rendered prompt, actual generated token IDs and generated text separately. Forward and strictly score only the generated text. Rerun every affected chain from its first judge. The checker, problem assignments, generation budget and model-selection rule stay fixed. [Archived pilot](../results/new-judges/runtime-format-pilot/result.json) · [llama.cpp completion and template endpoints](https://github.com/ggml-org/llama.cpp/blob/b12807/tools/server/README.md)14 unmodified lines1516171819202129 unmodified lines51525353545556575859606 unmodified lines676869667014 unmodified lines example = {} counter = 0 identical_masked = 0 error_positions = {"nonfinal":0,"final":0}
def checked(call_id,level,p,trace,history): nonlocal counter29 unmodified lines example.setdefault(outcome,dict(key=p.key,expression=p.expression,trace=r["trace"],first=r["first"], reviews=r["reviews"],outputs=r["visible"]["outputs"],expected=[render(v) for v in r["labels"]])) else: verdict = solver_truth(p,r["trace"])[0] solution = solver_truth(p,r["trace"]) verdict = solution[0] if r["kind"]=="balanced-invalid": error_positions["final" if solution[1]==len(p.values) else "nonfinal"]+=1 history = [] for level in (1,2,3): c = checked(f"{r['id']}/j{level}",level,p,r["trace"],history)6 unmodified lines history.append(c["text"]) if metrics(data)!=receipt["metrics"] or counter!=receipt["cost"]["calls"] or len(calls)!=counter+4: raise ValueError("Published summary disagrees with complete raw observations") return dict(calls=counter,matched_masked_outputs=identical_masked,examples=example) return dict(calls=counter,matched_masked_outputs=identical_masked,error_positions=error_positions,examples=example)123456789101112131415161718192021222324param([Parameter(Mandatory=$true)][int]$ServerId, [Parameter(Mandatory=$true)][string]$Destination)# Windows exposes per-process engine runtime in 100 ns units and allocation sizes in bytes.# https://devblogs.microsoft.com/directx/gpus-in-the-task-manager/$ErrorActionPreference = 'Stop'$server = Get-Process -Id $ServerId -ErrorAction SilentlyContinueif (-not $server) {exit}$created = $server.StartTimewhile (($server = Get-Process -Id $ServerId -ErrorAction SilentlyContinue) -and $server.StartTime -eq $created) { $selector = "Name LIKE 'pid_${ServerId}_%'" $engines = @(Get-CimInstance Win32_PerfRawData_GPUPerformanceCounters_GPUEngine -Filter $selector | Where-Object RunningTime -gt 0 | ForEach-Object { [ordered]@{engine=$_.Name.Split('_')[-1];seconds=[double]$_.RunningTime/$_.Frequency_Sys100NS} }) $memory = @(Get-CimInstance Win32_PerfFormattedData_GPUPerformanceCounters_GPUProcessMemory -Filter $selector) if ($engines.Count -and $memory.Count) { $record = [ordered]@{time=(Get-Date).ToUniversalTime().ToString('o');pid=$ServerId;engines=$engines dedicated_bytes=($memory|Measure-Object DedicatedUsage -Sum).Sum shared_bytes=($memory|Measure-Object SharedUsage -Sum).Sum} [IO.File]::AppendAllText($Destination,($record|ConvertTo-Json -Compress -Depth 4)+[Environment]::NewLine, [Text.UTF8Encoding]::new($false)) } Start-Sleep -Seconds 5}12345678910111213141516171819202122232425262728293031323334353637383940414243"""Verify and publish llama.cpp's actual GPU graph assignments from the experiment's native logs."""
import hashlibimport refrom collections import Counter
from .storage import ORIGINAL_RESULTS, log_directory, read_json, write_json
def graph_assignments(path): """CUDA0 is the only permitted compute graph backend. CPU tokenization is outside these graphs.""" digest, counts = hashlib.sha256(), Counter() pattern = re.compile(rb"## SPLIT #\d+: (\S+) # \d+ inputs") with path.open("rb") as source: for line in source: digest.update(line) for name in pattern.findall(line): counts[name.decode("ascii")]+=1 if not counts or set(counts)!={"CUDA0"}: raise ValueError(f"Unverified CPU-free computation in {path.name}: {dict(counts)}") return dict(log=path.name,sha256=digest.hexdigest(),graph_assignments=dict(counts))
def close_device_records(): """Attach the logs for each scored load to its raw receipt. Skip archived/pre-fix pilot calls.""" for marker in (ORIGINAL_RESULTS/"new-judges").glob("*/result.json"): folder = marker.parent if (folder/"gpu-graphs.json").is_file() or not read_json(marker).get("metrics"): continue logs = sorted((log_directory()/("new-judges-"+folder.name)).glob("*-server.log")) if not logs: continue # A fit event is timestamped after the server is ready. Select its immediately preceding native log. used = set() for fit in read_json(folder/"fit.json",[]): if fit["fit"]: upper = fit["time"].replace(":","-") earlier = [p for p in logs if p.name.removesuffix("-server.log")<=upper] if not earlier: raise ValueError("Missing server log for a verified GPU placement") used.add(earlier[-1]) if used: write_json(folder/"gpu-graphs.json",{"loads":[graph_assignments(p) for p in sorted(used)]})74 unmodified lines75767778787980818283848537 unmodified lines12312412512612712812913013113213326 unmodified lines16016116216316416516616716816974 unmodified lines
class LocalCUDA: def __init__(self, path, log_path, template=None): def __init__(self, path, log_path, template=None, telemetry=None): self.path, self.log_path = path, log_path self.template = template self.telemetry = telemetry self.meter = None self.process = None
def __enter__(self):37 unmodified lines log = self.log_path.read_text(encoding="utf-8",errors="replace") self.placement = dict(**verify_placement(log),before=self.before,after=device_memory(), load_seconds=time.monotonic()-start,build=BUILD,command=command) if self.telemetry and os.name=="nt": self.meter=subprocess.Popen(["powershell","-NoProfile","-ExecutionPolicy","Bypass","-File", str(Path(__file__).with_name("frozen_device.ps1")),"-ServerId",str(self.process.pid), "-Destination",str(self.telemetry)],stdout=subprocess.DEVNULL,stderr=self.stream, creationflags=subprocess.CREATE_NO_WINDOW) return self except BaseException: self.__exit__(None,None,None)26 unmodified lines except subprocess.TimeoutExpired: self.process.kill() self.process.wait() if self.meter: try: self.meter.wait(timeout=8) except subprocess.TimeoutExpired: self.meter.terminate() self.meter.wait() self.stream.close()23 unmodified lines2425262728293037 unmodified lines686970707172737448 unmodified lines12312412512612712812913013113213323 unmodified lines if receipt: if receipt.get("metrics"): receipt["audit"] = released_audit(root/key,receipt["time"]) receipt["devices"] = read_json(root/key/"gpu-graphs.json",{}).get("loads",[]) samples = list(rows(root/key/"gpu-telemetry.jsonl")) if samples: receipt["gpu"] = dict(peak_dedicated_mib=max(r["dedicated_bytes"] for r in samples)/2**20,37 unmodified lines parts.append(decision["result"]+".") for metric, estimate in decision.get("estimates",{}).items(): lo,hi = estimate["ci"] parts.append(f"{metric.replace('_',' ')} improved by a signed {estimate['delta']*100:+.2f} percentage points on {estimate['n']} paired problems (95% interval {100*lo:+.2f} to {100*hi:+.2f}).") parts.append(f"The candidate-minus-control difference in {metric.replace('_',' ')} was {estimate['delta']*100:+.2f} percentage points on {estimate['n']} paired problems (95% interval {100*lo:+.2f} to {100*hi:+.2f}).") return "\n\n".join(parts)
48 unmodified lines markdown(["Judge 2 review","Judge 3 wrote","Checker expected"], list(zip(record["reviews"],record["outputs"],record["expected"],strict=True)))] method += f"\n\nThe release checked {r['audit']['calls']} scored calls against the original prompts, raw generated text and independent arithmetic values. The masked twins returned identical token sequences on {r['audit']['matched_masked_outputs']}/{r['metrics']['twins']['n']} pairs." positions=r["audit"]["error_positions"] method += f" The balanced invalid traces contained {positions['nonfinal']} first errors before the final step and {positions['final']} at the final step." if r.get("devices"): total=sum(x["graph_assignments"]["CUDA0"] for x in r["devices"]) method += f" The server recorded {total:,} compute graph assignments across the measured loads. Every assignment used CUDA0." gpu = r.get("gpu") if gpu: method += ("\n\nWindows sampled the dedicated allocation of the llama.cpp process at up to "53 unmodified lines545556575758596063 unmodified lines12412512612712812913013153 unmodified lines from huggingface_hub import hf_hub_download template = hf_hub_download("Qwen/"+model.title,"chat_template.jinja",revision=config.base_revision) try: backend = stack.enter_context(LocalCUDA(path,logfile,template)) backend = stack.enter_context(LocalCUDA(path,logfile,template,folder/"gpu-telemetry.jsonl")) except GPUFitError as e: fit_attempts.append(dict(time=stamp(),file=config.filename,fit=False,reason=str(e))) write_json(folder/"fit.json",fit_attempts)63 unmodified lines if publish: worker("publish","--milestone","new-judges-"+key) else: from .frozen_device import close_device_records close_device_records() worker("report") return outcome with study_lock("frozen-judge-suite"):23 unmodified lines24252627282930313214 unmodified lines47484947505152535423 unmodified lines return if ORIGINAL_RESULTS != (ROOT/"results").resolve(): raise RuntimeError("Independent replication results use local reporting; the public release uses the registered results directory") if milestone.startswith("new-judges-"): from .frozen_device import close_device_records close_device_records() build() if git("branch", "--show-current") != "main": raise RuntimeError("Publish experiment milestones from the merged main checkout")14 unmodified lines logdir = log_directory()/(milestone if not run else run) if milestone.endswith("-development") or milestone.endswith("-final"): logdir = log_directory()/milestone for path in sorted(logdir.glob("*.jsonl")): native_logs = list(logdir.glob("*-server.log")) if milestone.startswith("new-judges-") else [] for path in sorted([*logdir.glob("*.jsonl"),*native_logs]): packed=STATE/"publication"/"compressed"/logdir.name/(path.name+".gz") packed.parent.mkdir(parents=True,exist_ok=True) with path.open("rb") as source, gzip.open(packed,"wb",compresslevel=5) as target:27 unmodified lines282930313233343536373839404142434427 unmodified lines verify_placement(bad)
def test_native_graph_log_checks_scheduled_devices_and_rejects_host_compute(tmp_path): from study.frozen_device import graph_assignments log=tmp_path/"server.log" log.write_text("## SPLIT #0: CUDA0 # 4 inputs\n## SPLIT #1: CUDA0 # 1 inputs\n") assert graph_assignments(log)["graph_assignments"]=={"CUDA0":2} with log.open("a") as f: f.write("## SPLIT #2: CPU # 3 inputs\n") with pytest.raises(ValueError,match="CPU-free computation"): graph_assignments(log)
def test_template_prefill_never_becomes_a_judge_answer(monkeypatch, tmp_path): server = LocalCUDA(tmp_path/"weights",tmp_path/"log") rendered = "user question\n<|im_start|>assistant\n<think>\n\n</think>\n\n"docs/assets/study.json+15
docs/usage.md+2
reports/experiments/new-judges/q25-1p5b/experiment.md+1-1
reports/experiments/new-judges/q35-4b-ollama/experiment.md+1-1
reports/experiments/new-judges/q35-9b-ollama/experiment.md+1-1
reports/newer-frozen-judges.md+2
src/study/frozen_audit.py+6-2
src/study/frozen_device.ps1Added+24
src/study/frozen_device.pyAdded+43
src/study/frozen_gpu.py+14-1
src/study/frozen_report.py+7-1
src/study/frozen_suite.py+3-1
src/study/publish.py+5-1
tests/test_frozen_screen.py+11