gpu-device-evidence · 20a582ee2af1
Browse files- docs/assets/study.json +15 -0
- docs/usage.md +2 -0
- 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 -0
- src/study/frozen_audit.py +6 -2
- src/study/frozen_device.ps1 +24 -0
- src/study/frozen_device.py +43 -0
- 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 -0
docs/assets/study.json
CHANGED
|
@@ -240436,6 +240436,10 @@
|
|
| 240436 |
"audit": {
|
| 240437 |
"calls": 416,
|
| 240438 |
"matched_masked_outputs": 32,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240439 |
"examples": {
|
| 240440 |
"failed": {
|
| 240441 |
"key": "0360e34dc98fec16268444b3951abf4b5a78f76c98630b472a6a26b8406c9539",
|
|
@@ -240475,6 +240479,7 @@
|
|
| 240475 |
}
|
| 240476 |
}
|
| 240477 |
},
|
|
|
|
| 240478 |
"gpu": {
|
| 240479 |
"peak_dedicated_mib": 5627.578125,
|
| 240480 |
"engines": [
|
|
@@ -240581,6 +240586,10 @@
|
|
| 240581 |
"audit": {
|
| 240582 |
"calls": 416,
|
| 240583 |
"matched_masked_outputs": 32,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240584 |
"examples": {
|
| 240585 |
"failed": {
|
| 240586 |
"key": "0360e34dc98fec16268444b3951abf4b5a78f76c98630b472a6a26b8406c9539",
|
|
@@ -240620,6 +240629,7 @@
|
|
| 240620 |
}
|
| 240621 |
}
|
| 240622 |
},
|
|
|
|
| 240623 |
"gpu": {
|
| 240624 |
"peak_dedicated_mib": 2783.65234375,
|
| 240625 |
"engines": [
|
|
@@ -240726,6 +240736,10 @@
|
|
| 240726 |
"audit": {
|
| 240727 |
"calls": 416,
|
| 240728 |
"matched_masked_outputs": 32,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240729 |
"examples": {
|
| 240730 |
"failed": {
|
| 240731 |
"key": "0360e34dc98fec16268444b3951abf4b5a78f76c98630b472a6a26b8406c9539",
|
|
@@ -240747,6 +240761,7 @@
|
|
| 240747 |
}
|
| 240748 |
}
|
| 240749 |
},
|
|
|
|
| 240750 |
"gpu": {
|
| 240751 |
"peak_dedicated_mib": 1261.5390625,
|
| 240752 |
"engines": [
|
|
|
|
| 240436 |
"audit": {
|
| 240437 |
"calls": 416,
|
| 240438 |
"matched_masked_outputs": 32,
|
| 240439 |
+
"error_positions": {
|
| 240440 |
+
"nonfinal": 16,
|
| 240441 |
+
"final": 16
|
| 240442 |
+
},
|
| 240443 |
"examples": {
|
| 240444 |
"failed": {
|
| 240445 |
"key": "0360e34dc98fec16268444b3951abf4b5a78f76c98630b472a6a26b8406c9539",
|
|
|
|
| 240479 |
}
|
| 240480 |
}
|
| 240481 |
},
|
| 240482 |
+
"devices": [],
|
| 240483 |
"gpu": {
|
| 240484 |
"peak_dedicated_mib": 5627.578125,
|
| 240485 |
"engines": [
|
|
|
|
| 240586 |
"audit": {
|
| 240587 |
"calls": 416,
|
| 240588 |
"matched_masked_outputs": 32,
|
| 240589 |
+
"error_positions": {
|
| 240590 |
+
"nonfinal": 16,
|
| 240591 |
+
"final": 16
|
| 240592 |
+
},
|
| 240593 |
"examples": {
|
| 240594 |
"failed": {
|
| 240595 |
"key": "0360e34dc98fec16268444b3951abf4b5a78f76c98630b472a6a26b8406c9539",
|
|
|
|
| 240629 |
}
|
| 240630 |
}
|
| 240631 |
},
|
| 240632 |
+
"devices": [],
|
| 240633 |
"gpu": {
|
| 240634 |
"peak_dedicated_mib": 2783.65234375,
|
| 240635 |
"engines": [
|
|
|
|
| 240736 |
"audit": {
|
| 240737 |
"calls": 416,
|
| 240738 |
"matched_masked_outputs": 32,
|
| 240739 |
+
"error_positions": {
|
| 240740 |
+
"nonfinal": 16,
|
| 240741 |
+
"final": 16
|
| 240742 |
+
},
|
| 240743 |
"examples": {
|
| 240744 |
"failed": {
|
| 240745 |
"key": "0360e34dc98fec16268444b3951abf4b5a78f76c98630b472a6a26b8406c9539",
|
|
|
|
| 240761 |
}
|
| 240762 |
}
|
| 240763 |
},
|
| 240764 |
+
"devices": [],
|
| 240765 |
"gpu": {
|
| 240766 |
"peak_dedicated_mib": 1261.5390625,
|
| 240767 |
"engines": [
|
docs/usage.md
CHANGED
|
@@ -61,3 +61,5 @@ uv run study report
|
|
| 61 |
```
|
| 62 |
|
| 63 |
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)
|
|
|
|
|
|
|
|
|
| 61 |
```
|
| 62 |
|
| 63 |
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)
|
| 64 |
+
|
| 65 |
+
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)
|
reports/experiments/new-judges/q25-1p5b/experiment.md
CHANGED
|
@@ -9,6 +9,6 @@ Complete. J3 verdict 28/64, twins 0/32, masked 0/32
|
|
| 9 |
| Qwen2.5-1.5B-Instruct · screen · balanced | 32/64 | 28/64 | 28/64 | 0/32 | 0/32 |
|
| 10 |
| Qwen2.5-1.5B-Instruct · screen · natural | 23/32 | 19/32 | 13/32 | — | — |
|
| 11 |
|
| 12 |
-
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.
|
| 13 |
|
| 14 |
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/).
|
|
|
|
| 9 |
| Qwen2.5-1.5B-Instruct · screen · balanced | 32/64 | 28/64 | 28/64 | 0/32 | 0/32 |
|
| 10 |
| Qwen2.5-1.5B-Instruct · screen · natural | 23/32 | 19/32 | 13/32 | — | — |
|
| 11 |
|
| 12 |
+
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.
|
| 13 |
|
| 14 |
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/).
|
reports/experiments/new-judges/q35-4b-ollama/experiment.md
CHANGED
|
@@ -9,6 +9,6 @@ Complete. J3 verdict 32/64, twins 1/32, masked 0/32
|
|
| 9 |
| Qwen3.5-4B · deployment replicate · balanced | 32/64 | 32/64 | 32/64 | 1/32 | 0/32 |
|
| 10 |
| Qwen3.5-4B · deployment replicate · natural | 26/32 | 26/32 | 26/32 | — | — |
|
| 11 |
|
| 12 |
-
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.
|
| 13 |
|
| 14 |
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/).
|
|
|
|
| 9 |
| Qwen3.5-4B · deployment replicate · balanced | 32/64 | 32/64 | 32/64 | 1/32 | 0/32 |
|
| 10 |
| Qwen3.5-4B · deployment replicate · natural | 26/32 | 26/32 | 26/32 | — | — |
|
| 11 |
|
| 12 |
+
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.
|
| 13 |
|
| 14 |
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/).
|
reports/experiments/new-judges/q35-9b-ollama/experiment.md
CHANGED
|
@@ -9,6 +9,6 @@ Complete. J3 verdict 43/64, twins 1/32, masked 0/32
|
|
| 9 |
| Qwen3.5-9B · deployment replicate · balanced | 37/64 | 44/64 | 43/64 | 1/32 | 0/32 |
|
| 10 |
| Qwen3.5-9B · deployment replicate · natural | 23/32 | 24/32 | 24/32 | — | — |
|
| 11 |
|
| 12 |
-
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.
|
| 13 |
|
| 14 |
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/).
|
|
|
|
| 9 |
| Qwen3.5-9B · deployment replicate · balanced | 37/64 | 44/64 | 43/64 | 1/32 | 0/32 |
|
| 10 |
| Qwen3.5-9B · deployment replicate · natural | 23/32 | 24/32 | 24/32 | — | — |
|
| 11 |
|
| 12 |
+
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.
|
| 13 |
|
| 14 |
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/).
|
reports/newer-frozen-judges.md
CHANGED
|
@@ -28,4 +28,6 @@ Every model has the same output format and input evidence. Native templates can
|
|
| 28 |
|
| 29 |
## Runtime correction before comparing scores
|
| 30 |
|
|
|
|
|
|
|
| 31 |
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)
|
|
|
|
| 28 |
|
| 29 |
## Runtime correction before comparing scores
|
| 30 |
|
| 31 |
+
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.”
|
| 32 |
+
|
| 33 |
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)
|
src/study/frozen_audit.py
CHANGED
|
@@ -15,6 +15,7 @@ def audit(folder, receipt):
|
|
| 15 |
example = {}
|
| 16 |
counter = 0
|
| 17 |
identical_masked = 0
|
|
|
|
| 18 |
|
| 19 |
def checked(call_id,level,p,trace,history):
|
| 20 |
nonlocal counter
|
|
@@ -50,7 +51,10 @@ def audit(folder, receipt):
|
|
| 50 |
example.setdefault(outcome,dict(key=p.key,expression=p.expression,trace=r["trace"],first=r["first"],
|
| 51 |
reviews=r["reviews"],outputs=r["visible"]["outputs"],expected=[render(v) for v in r["labels"]]))
|
| 52 |
else:
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
| 54 |
history = []
|
| 55 |
for level in (1,2,3):
|
| 56 |
c = checked(f"{r['id']}/j{level}",level,p,r["trace"],history)
|
|
@@ -63,4 +67,4 @@ def audit(folder, receipt):
|
|
| 63 |
history.append(c["text"])
|
| 64 |
if metrics(data)!=receipt["metrics"] or counter!=receipt["cost"]["calls"] or len(calls)!=counter+4:
|
| 65 |
raise ValueError("Published summary disagrees with complete raw observations")
|
| 66 |
-
return dict(calls=counter,matched_masked_outputs=identical_masked,examples=example)
|
|
|
|
| 15 |
example = {}
|
| 16 |
counter = 0
|
| 17 |
identical_masked = 0
|
| 18 |
+
error_positions = {"nonfinal":0,"final":0}
|
| 19 |
|
| 20 |
def checked(call_id,level,p,trace,history):
|
| 21 |
nonlocal counter
|
|
|
|
| 51 |
example.setdefault(outcome,dict(key=p.key,expression=p.expression,trace=r["trace"],first=r["first"],
|
| 52 |
reviews=r["reviews"],outputs=r["visible"]["outputs"],expected=[render(v) for v in r["labels"]]))
|
| 53 |
else:
|
| 54 |
+
solution = solver_truth(p,r["trace"])
|
| 55 |
+
verdict = solution[0]
|
| 56 |
+
if r["kind"]=="balanced-invalid":
|
| 57 |
+
error_positions["final" if solution[1]==len(p.values) else "nonfinal"]+=1
|
| 58 |
history = []
|
| 59 |
for level in (1,2,3):
|
| 60 |
c = checked(f"{r['id']}/j{level}",level,p,r["trace"],history)
|
|
|
|
| 67 |
history.append(c["text"])
|
| 68 |
if metrics(data)!=receipt["metrics"] or counter!=receipt["cost"]["calls"] or len(calls)!=counter+4:
|
| 69 |
raise ValueError("Published summary disagrees with complete raw observations")
|
| 70 |
+
return dict(calls=counter,matched_masked_outputs=identical_masked,error_positions=error_positions,examples=example)
|
src/study/frozen_device.ps1
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
param([Parameter(Mandatory=$true)][int]$ServerId,
|
| 2 |
+
[Parameter(Mandatory=$true)][string]$Destination)
|
| 3 |
+
# Windows exposes per-process engine runtime in 100 ns units and allocation sizes in bytes.
|
| 4 |
+
# https://devblogs.microsoft.com/directx/gpus-in-the-task-manager/
|
| 5 |
+
$ErrorActionPreference = 'Stop'
|
| 6 |
+
$server = Get-Process -Id $ServerId -ErrorAction SilentlyContinue
|
| 7 |
+
if (-not $server) {exit}
|
| 8 |
+
$created = $server.StartTime
|
| 9 |
+
while (($server = Get-Process -Id $ServerId -ErrorAction SilentlyContinue) -and $server.StartTime -eq $created) {
|
| 10 |
+
$selector = "Name LIKE 'pid_${ServerId}_%'"
|
| 11 |
+
$engines = @(Get-CimInstance Win32_PerfRawData_GPUPerformanceCounters_GPUEngine -Filter $selector |
|
| 12 |
+
Where-Object RunningTime -gt 0 | ForEach-Object {
|
| 13 |
+
[ordered]@{engine=$_.Name.Split('_')[-1];seconds=[double]$_.RunningTime/$_.Frequency_Sys100NS}
|
| 14 |
+
})
|
| 15 |
+
$memory = @(Get-CimInstance Win32_PerfFormattedData_GPUPerformanceCounters_GPUProcessMemory -Filter $selector)
|
| 16 |
+
if ($engines.Count -and $memory.Count) {
|
| 17 |
+
$record = [ordered]@{time=(Get-Date).ToUniversalTime().ToString('o');pid=$ServerId;engines=$engines
|
| 18 |
+
dedicated_bytes=($memory|Measure-Object DedicatedUsage -Sum).Sum
|
| 19 |
+
shared_bytes=($memory|Measure-Object SharedUsage -Sum).Sum}
|
| 20 |
+
[IO.File]::AppendAllText($Destination,($record|ConvertTo-Json -Compress -Depth 4)+[Environment]::NewLine,
|
| 21 |
+
[Text.UTF8Encoding]::new($false))
|
| 22 |
+
}
|
| 23 |
+
Start-Sleep -Seconds 5
|
| 24 |
+
}
|
src/study/frozen_device.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Verify and publish llama.cpp's actual GPU graph assignments from the experiment's native logs."""
|
| 2 |
+
|
| 3 |
+
import hashlib
|
| 4 |
+
import re
|
| 5 |
+
from collections import Counter
|
| 6 |
+
|
| 7 |
+
from .storage import ORIGINAL_RESULTS, log_directory, read_json, write_json
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def graph_assignments(path):
|
| 11 |
+
"""CUDA0 is the only permitted compute graph backend. CPU tokenization is outside these graphs."""
|
| 12 |
+
digest, counts = hashlib.sha256(), Counter()
|
| 13 |
+
pattern = re.compile(rb"## SPLIT #\d+: (\S+) # \d+ inputs")
|
| 14 |
+
with path.open("rb") as source:
|
| 15 |
+
for line in source:
|
| 16 |
+
digest.update(line)
|
| 17 |
+
for name in pattern.findall(line):
|
| 18 |
+
counts[name.decode("ascii")]+=1
|
| 19 |
+
if not counts or set(counts)!={"CUDA0"}:
|
| 20 |
+
raise ValueError(f"Unverified CPU-free computation in {path.name}: {dict(counts)}")
|
| 21 |
+
return dict(log=path.name,sha256=digest.hexdigest(),graph_assignments=dict(counts))
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def close_device_records():
|
| 25 |
+
"""Attach the logs for each scored load to its raw receipt. Skip archived/pre-fix pilot calls."""
|
| 26 |
+
for marker in (ORIGINAL_RESULTS/"new-judges").glob("*/result.json"):
|
| 27 |
+
folder = marker.parent
|
| 28 |
+
if (folder/"gpu-graphs.json").is_file() or not read_json(marker).get("metrics"):
|
| 29 |
+
continue
|
| 30 |
+
logs = sorted((log_directory()/("new-judges-"+folder.name)).glob("*-server.log"))
|
| 31 |
+
if not logs:
|
| 32 |
+
continue
|
| 33 |
+
# A fit event is timestamped after the server is ready. Select its immediately preceding native log.
|
| 34 |
+
used = set()
|
| 35 |
+
for fit in read_json(folder/"fit.json",[]):
|
| 36 |
+
if fit["fit"]:
|
| 37 |
+
upper = fit["time"].replace(":","-")
|
| 38 |
+
earlier = [p for p in logs if p.name.removesuffix("-server.log")<=upper]
|
| 39 |
+
if not earlier:
|
| 40 |
+
raise ValueError("Missing server log for a verified GPU placement")
|
| 41 |
+
used.add(earlier[-1])
|
| 42 |
+
if used:
|
| 43 |
+
write_json(folder/"gpu-graphs.json",{"loads":[graph_assignments(p) for p in sorted(used)]})
|
src/study/frozen_gpu.py
CHANGED
|
@@ -75,9 +75,11 @@ def device_memory():
|
|
| 75 |
|
| 76 |
|
| 77 |
class LocalCUDA:
|
| 78 |
-
def __init__(self, path, log_path, template=None):
|
| 79 |
self.path, self.log_path = path, log_path
|
| 80 |
self.template = template
|
|
|
|
|
|
|
| 81 |
self.process = None
|
| 82 |
|
| 83 |
def __enter__(self):
|
|
@@ -121,6 +123,11 @@ class LocalCUDA:
|
|
| 121 |
log = self.log_path.read_text(encoding="utf-8",errors="replace")
|
| 122 |
self.placement = dict(**verify_placement(log),before=self.before,after=device_memory(),
|
| 123 |
load_seconds=time.monotonic()-start,build=BUILD,command=command)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
return self
|
| 125 |
except BaseException:
|
| 126 |
self.__exit__(None,None,None)
|
|
@@ -153,4 +160,10 @@ class LocalCUDA:
|
|
| 153 |
except subprocess.TimeoutExpired:
|
| 154 |
self.process.kill()
|
| 155 |
self.process.wait()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
self.stream.close()
|
|
|
|
| 75 |
|
| 76 |
|
| 77 |
class LocalCUDA:
|
| 78 |
+
def __init__(self, path, log_path, template=None, telemetry=None):
|
| 79 |
self.path, self.log_path = path, log_path
|
| 80 |
self.template = template
|
| 81 |
+
self.telemetry = telemetry
|
| 82 |
+
self.meter = None
|
| 83 |
self.process = None
|
| 84 |
|
| 85 |
def __enter__(self):
|
|
|
|
| 123 |
log = self.log_path.read_text(encoding="utf-8",errors="replace")
|
| 124 |
self.placement = dict(**verify_placement(log),before=self.before,after=device_memory(),
|
| 125 |
load_seconds=time.monotonic()-start,build=BUILD,command=command)
|
| 126 |
+
if self.telemetry and os.name=="nt":
|
| 127 |
+
self.meter=subprocess.Popen(["powershell","-NoProfile","-ExecutionPolicy","Bypass","-File",
|
| 128 |
+
str(Path(__file__).with_name("frozen_device.ps1")),"-ServerId",str(self.process.pid),
|
| 129 |
+
"-Destination",str(self.telemetry)],stdout=subprocess.DEVNULL,stderr=self.stream,
|
| 130 |
+
creationflags=subprocess.CREATE_NO_WINDOW)
|
| 131 |
return self
|
| 132 |
except BaseException:
|
| 133 |
self.__exit__(None,None,None)
|
|
|
|
| 160 |
except subprocess.TimeoutExpired:
|
| 161 |
self.process.kill()
|
| 162 |
self.process.wait()
|
| 163 |
+
if self.meter:
|
| 164 |
+
try:
|
| 165 |
+
self.meter.wait(timeout=8)
|
| 166 |
+
except subprocess.TimeoutExpired:
|
| 167 |
+
self.meter.terminate()
|
| 168 |
+
self.meter.wait()
|
| 169 |
self.stream.close()
|
src/study/frozen_report.py
CHANGED
|
@@ -24,6 +24,7 @@ def collect_frozen(root):
|
|
| 24 |
if receipt:
|
| 25 |
if receipt.get("metrics"):
|
| 26 |
receipt["audit"] = released_audit(root/key,receipt["time"])
|
|
|
|
| 27 |
samples = list(rows(root/key/"gpu-telemetry.jsonl"))
|
| 28 |
if samples:
|
| 29 |
receipt["gpu"] = dict(peak_dedicated_mib=max(r["dedicated_bytes"] for r in samples)/2**20,
|
|
@@ -67,7 +68,7 @@ def frozen_text(study):
|
|
| 67 |
parts.append(decision["result"]+".")
|
| 68 |
for metric, estimate in decision.get("estimates",{}).items():
|
| 69 |
lo,hi = estimate["ci"]
|
| 70 |
-
parts.append(f"{metric.replace('_',' ')}
|
| 71 |
return "\n\n".join(parts)
|
| 72 |
|
| 73 |
|
|
@@ -122,6 +123,11 @@ def experiment_pages(study, dest):
|
|
| 122 |
markdown(["Judge 2 review","Judge 3 wrote","Checker expected"],
|
| 123 |
list(zip(record["reviews"],record["outputs"],record["expected"],strict=True)))]
|
| 124 |
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."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
gpu = r.get("gpu")
|
| 126 |
if gpu:
|
| 127 |
method += ("\n\nWindows sampled the dedicated allocation of the llama.cpp process at up to "
|
|
|
|
| 24 |
if receipt:
|
| 25 |
if receipt.get("metrics"):
|
| 26 |
receipt["audit"] = released_audit(root/key,receipt["time"])
|
| 27 |
+
receipt["devices"] = read_json(root/key/"gpu-graphs.json",{}).get("loads",[])
|
| 28 |
samples = list(rows(root/key/"gpu-telemetry.jsonl"))
|
| 29 |
if samples:
|
| 30 |
receipt["gpu"] = dict(peak_dedicated_mib=max(r["dedicated_bytes"] for r in samples)/2**20,
|
|
|
|
| 68 |
parts.append(decision["result"]+".")
|
| 69 |
for metric, estimate in decision.get("estimates",{}).items():
|
| 70 |
lo,hi = estimate["ci"]
|
| 71 |
+
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}).")
|
| 72 |
return "\n\n".join(parts)
|
| 73 |
|
| 74 |
|
|
|
|
| 123 |
markdown(["Judge 2 review","Judge 3 wrote","Checker expected"],
|
| 124 |
list(zip(record["reviews"],record["outputs"],record["expected"],strict=True)))]
|
| 125 |
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."
|
| 126 |
+
positions=r["audit"]["error_positions"]
|
| 127 |
+
method += f" The balanced invalid traces contained {positions['nonfinal']} first errors before the final step and {positions['final']} at the final step."
|
| 128 |
+
if r.get("devices"):
|
| 129 |
+
total=sum(x["graph_assignments"]["CUDA0"] for x in r["devices"])
|
| 130 |
+
method += f" The server recorded {total:,} compute graph assignments across the measured loads. Every assignment used CUDA0."
|
| 131 |
gpu = r.get("gpu")
|
| 132 |
if gpu:
|
| 133 |
method += ("\n\nWindows sampled the dedicated allocation of the llama.cpp process at up to "
|
src/study/frozen_suite.py
CHANGED
|
@@ -54,7 +54,7 @@ def run_one(key, model, phase, confirmed_file=None):
|
|
| 54 |
from huggingface_hub import hf_hub_download
|
| 55 |
template = hf_hub_download("Qwen/"+model.title,"chat_template.jinja",revision=config.base_revision)
|
| 56 |
try:
|
| 57 |
-
backend = stack.enter_context(LocalCUDA(path,logfile,template))
|
| 58 |
except GPUFitError as e:
|
| 59 |
fit_attempts.append(dict(time=stamp(),file=config.filename,fit=False,reason=str(e)))
|
| 60 |
write_json(folder/"fit.json",fit_attempts)
|
|
@@ -124,6 +124,8 @@ def campaign(publish=False):
|
|
| 124 |
if publish:
|
| 125 |
worker("publish","--milestone","new-judges-"+key)
|
| 126 |
else:
|
|
|
|
|
|
|
| 127 |
worker("report")
|
| 128 |
return outcome
|
| 129 |
with study_lock("frozen-judge-suite"):
|
|
|
|
| 54 |
from huggingface_hub import hf_hub_download
|
| 55 |
template = hf_hub_download("Qwen/"+model.title,"chat_template.jinja",revision=config.base_revision)
|
| 56 |
try:
|
| 57 |
+
backend = stack.enter_context(LocalCUDA(path,logfile,template,folder/"gpu-telemetry.jsonl"))
|
| 58 |
except GPUFitError as e:
|
| 59 |
fit_attempts.append(dict(time=stamp(),file=config.filename,fit=False,reason=str(e)))
|
| 60 |
write_json(folder/"fit.json",fit_attempts)
|
|
|
|
| 124 |
if publish:
|
| 125 |
worker("publish","--milestone","new-judges-"+key)
|
| 126 |
else:
|
| 127 |
+
from .frozen_device import close_device_records
|
| 128 |
+
close_device_records()
|
| 129 |
worker("report")
|
| 130 |
return outcome
|
| 131 |
with study_lock("frozen-judge-suite"):
|
src/study/publish.py
CHANGED
|
@@ -24,6 +24,9 @@ def publish(milestone, run=None):
|
|
| 24 |
return
|
| 25 |
if ORIGINAL_RESULTS != (ROOT/"results").resolve():
|
| 26 |
raise RuntimeError("Independent replication results use local reporting; the public release uses the registered results directory")
|
|
|
|
|
|
|
|
|
|
| 27 |
build()
|
| 28 |
if git("branch", "--show-current") != "main":
|
| 29 |
raise RuntimeError("Publish experiment milestones from the merged main checkout")
|
|
@@ -44,7 +47,8 @@ def publish(milestone, run=None):
|
|
| 44 |
logdir = log_directory()/(milestone if not run else run)
|
| 45 |
if milestone.endswith("-development") or milestone.endswith("-final"):
|
| 46 |
logdir = log_directory()/milestone
|
| 47 |
-
|
|
|
|
| 48 |
packed=STATE/"publication"/"compressed"/logdir.name/(path.name+".gz")
|
| 49 |
packed.parent.mkdir(parents=True,exist_ok=True)
|
| 50 |
with path.open("rb") as source, gzip.open(packed,"wb",compresslevel=5) as target:
|
|
|
|
| 24 |
return
|
| 25 |
if ORIGINAL_RESULTS != (ROOT/"results").resolve():
|
| 26 |
raise RuntimeError("Independent replication results use local reporting; the public release uses the registered results directory")
|
| 27 |
+
if milestone.startswith("new-judges-"):
|
| 28 |
+
from .frozen_device import close_device_records
|
| 29 |
+
close_device_records()
|
| 30 |
build()
|
| 31 |
if git("branch", "--show-current") != "main":
|
| 32 |
raise RuntimeError("Publish experiment milestones from the merged main checkout")
|
|
|
|
| 47 |
logdir = log_directory()/(milestone if not run else run)
|
| 48 |
if milestone.endswith("-development") or milestone.endswith("-final"):
|
| 49 |
logdir = log_directory()/milestone
|
| 50 |
+
native_logs = list(logdir.glob("*-server.log")) if milestone.startswith("new-judges-") else []
|
| 51 |
+
for path in sorted([*logdir.glob("*.jsonl"),*native_logs]):
|
| 52 |
packed=STATE/"publication"/"compressed"/logdir.name/(path.name+".gz")
|
| 53 |
packed.parent.mkdir(parents=True,exist_ok=True)
|
| 54 |
with path.open("rb") as source, gzip.open(packed,"wb",compresslevel=5) as target:
|
tests/test_frozen_screen.py
CHANGED
|
@@ -28,6 +28,17 @@ def test_gpu_placement_rejects_partially_offloaded_or_cpu_weights():
|
|
| 28 |
verify_placement(bad)
|
| 29 |
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
def test_template_prefill_never_becomes_a_judge_answer(monkeypatch, tmp_path):
|
| 32 |
server = LocalCUDA(tmp_path/"weights",tmp_path/"log")
|
| 33 |
rendered = "user question\n<|im_start|>assistant\n<think>\n\n</think>\n\n"
|
|
|
|
| 28 |
verify_placement(bad)
|
| 29 |
|
| 30 |
|
| 31 |
+
def test_native_graph_log_checks_scheduled_devices_and_rejects_host_compute(tmp_path):
|
| 32 |
+
from study.frozen_device import graph_assignments
|
| 33 |
+
log=tmp_path/"server.log"
|
| 34 |
+
log.write_text("## SPLIT #0: CUDA0 # 4 inputs\n## SPLIT #1: CUDA0 # 1 inputs\n")
|
| 35 |
+
assert graph_assignments(log)["graph_assignments"]=={"CUDA0":2}
|
| 36 |
+
with log.open("a") as f:
|
| 37 |
+
f.write("## SPLIT #2: CPU # 3 inputs\n")
|
| 38 |
+
with pytest.raises(ValueError,match="CPU-free computation"):
|
| 39 |
+
graph_assignments(log)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
def test_template_prefill_never_becomes_a_judge_answer(monkeypatch, tmp_path):
|
| 43 |
server = LocalCUDA(tmp_path/"weights",tmp_path/"log")
|
| 44 |
rendered = "user question\n<|im_start|>assistant\n<think>\n\n</think>\n\n"
|