diff --git a/crossqkv/lisa_full_answer.py b/crossqkv/lisa_full_answer.py index 6b44303..e6a4c07 100644 --- a/crossqkv/lisa_full_answer.py +++ b/crossqkv/lisa_full_answer.py @@ -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) diff --git a/docs/LISA_FULL_ANSWER_PROTOCOL.md b/docs/LISA_FULL_ANSWER_PROTOCOL.md index cc60305..0b2cf91 100644 --- a/docs/LISA_FULL_ANSWER_PROTOCOL.md +++ b/docs/LISA_FULL_ANSWER_PROTOCOL.md @@ -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、低可用内存下的持续换页压力和运行时间均由原检查器监控。 diff --git a/results/lisa-full-answer-reproduction/batch-resume-code.sha256 b/results/lisa-full-answer-reproduction/batch-resume-code.sha256 new file mode 100644 index 0000000..eca8308 --- /dev/null +++ b/results/lisa-full-answer-reproduction/batch-resume-code.sha256 @@ -0,0 +1 @@ +07179a56936844f1bd639e1f31ee7f9d0110ec28c472fe6a59c7fcaf3e033355 crossqkv/lisa_full_answer.py diff --git a/results/lisa-full-answer-reproduction/execution-batch-replay.json b/results/lisa-full-answer-reproduction/execution-batch-replay.json new file mode 100644 index 0000000..59a6750 --- /dev/null +++ b/results/lisa-full-answer-reproduction/execution-batch-replay.json @@ -0,0 +1,8 @@ +{ + "frozen_sha256": "409cadff8b2ef2f0efcfa71bf0a94802391a341ed04cb6e374154b8b8ff1b545", + "batch_prompts": 2, + "matched_rows": [ + "screen-lookup-000", + "screen-lookup-001" + ] +} diff --git a/results/lisa-full-answer-reproduction/execution-handoff.json b/results/lisa-full-answer-reproduction/execution-handoff.json new file mode 100644 index 0000000..5bb7292 --- /dev/null +++ b/results/lisa-full-answer-reproduction/execution-handoff.json @@ -0,0 +1 @@ +{"rows": 5, "rows_sha256": "ff93a751537895e3d7fc55e3496afbbc46df34bb04ed89663319e38b8aa7a6e2", "stopped_pid": 4124128}