Resume answer screening with verified paired batching

This commit is contained in:
2026-11-24 18:47:30 +08:00
parent 0f4c0a982c
commit 2d1d28c331
5 changed files with 27 additions and 2 deletions
+15 -2
View File
@@ -155,6 +155,8 @@ def main():
parser.add_argument('--out', required=True, type=Path)
parser.add_argument('--seconds', default=21600, type=int)
parser.add_argument('--batch-prompts', default=2, type=int, choices=(1, 2))
parser.add_argument('--execution-batch-prompts', type=int, choices=(1, 2),
help='Use a different execution batch on resume after replaying completed rows')
parser.add_argument('--preflight', action='store_true')
args = parser.parse_args()
torch.set_num_threads(1)
@@ -193,8 +195,19 @@ def main():
rows = json.loads(path.read_text()) if path.exists() else []
if [r['id'] for r in rows] != [x['id'] for x in examples[:len(rows)]]:
raise ValueError('Existing screen results do not match frozen prompts')
for start in range(len(rows), len(examples), args.batch_prompts):
rows.extend(evaluate(model, tokenizer, examples[start:start+args.batch_prompts], SCHEDULES))
batch = args.execution_batch_prompts or args.batch_prompts
if batch != args.batch_prompts:
if len(rows) < batch:
raise ValueError('The alternate batch requires enough already evaluated prompts for replay')
replay = evaluate(model, tokenizer, examples[:batch], SCHEDULES)
if replay != rows[:batch]:
raise ValueError('Alternate batch changed the first completed token streams')
write_json(args.out/'execution-batch-replay.json',
{'frozen_sha256': fingerprint(manifest), 'batch_prompts': batch,
'matched_rows': [row['id'] for row in replay]})
print('validated execution batch', batch, flush=True)
for start in range(len(rows), len(examples), batch):
rows.extend(evaluate(model, tokenizer, examples[start:start+batch], SCHEDULES))
write_json(path, rows)
print('screen complete', len(rows), '/', len(examples), flush=True)
summary = summarize(rows)
+2
View File
@@ -37,4 +37,6 @@ RESULT=runs/NEW_FULL_ANSWER_RESULT
使用原目录运行相同命令即可续跑。筛选和测试将按已保存的题号继续。训练使用已保存的优化器和训练步。
筛选续跑可加 `--execution-batch-prompts 2`。它会重跑已完成的前两题,要求所有配置的 token 序列、停止原因与判分逐项一致,才继续处理剩余题目,并把回放凭证写入 `execution-batch-replay.json`。冻结的 `--batch-prompts 1` 参数仍用于校验原实验。双题模式超出资源限制或未通过回放时,可用原单题命令从已保存的行继续。本次在第五题写盘后交接,前两题的四个配置均通过了完整回放核对。
服务器约有 1.7 GiB 内存。本轮每次筛选输入一道题,四个配置共享权重读取。前两次预检和一次生成在服务器仍有约 1 GiB 可用内存时触发进程独立换页上限。当前作业沿用原冻结题集,并在每层结束时释放空闲内存。可用内存、进程 RSS、低可用内存下的持续换页压力和运行时间均由原检查器监控。
@@ -0,0 +1 @@
07179a56936844f1bd639e1f31ee7f9d0110ec28c472fe6a59c7fcaf3e033355 crossqkv/lisa_full_answer.py
@@ -0,0 +1,8 @@
{
"frozen_sha256": "409cadff8b2ef2f0efcfa71bf0a94802391a341ed04cb6e374154b8b8ff1b545",
"batch_prompts": 2,
"matched_rows": [
"screen-lookup-000",
"screen-lookup-001"
]
}
@@ -0,0 +1 @@
{"rows": 5, "rows_sha256": "ff93a751537895e3d7fc55e3496afbbc46df34bb04ed89663319e38b8aa7a6e2", "stopped_pid": 4124128}