tchbcb commited on
Commit
fc7b875
·
verified ·
1 Parent(s): 850737e

QwenJev v0.4.3: 25-public-games eval in-repo (run_eval incremental report, fetch_games, CPU feasibility verified)

Browse files
Files changed (2) hide show
  1. HANDOVER.md +18 -3
  2. scripts/v4_recover_bootstrap.py +100 -0
HANDOVER.md CHANGED
@@ -5,19 +5,34 @@
5
 
6
  ## 0. 一句话现状
7
 
8
- **RCA 已定案 + v0.4.9 视觉读出修复已实施,v4 重训中**。v3 阴性结果(0 关 0 胜)的根因
 
9
  不是数据而是架构:`pooled_last_position` 从序列末位读出,帧内容信号被淹没
10
  (实测: radically different frames 的 last-pos cos=0.991,真游戏上 0.9999;而视觉塔
11
  在图像 token 位本身活得好好的 per-token cos=0.60)。**A→B→C 三阶段的决策头从未见过
12
  帧内容** —— 候选分布坍缩(ACTION3 占 70%)、视觉塔形同虚设。修复:池化改为
13
  `[last_text; mean(vision_tokens)]`(2H),头部首层扩维,检查点记录 `pool_vision`
14
- 标志(旧 v3 检查点自动兼容,build_s1 自动探测)。v4 重训(现有 167k 数据)+
15
- ε0.45 重采(CPU 并行)已同时启动。
16
 
17
  v3 历史结论保留:real_b(SFT) 收敛止损 + real_c(RLCD) ECE 0.4151→0.2727,
18
  对照评测 ar25+bp35 各 150 步 0 关 0 胜;产物在 HF `t4_assets_v3/checkpoints/`。
19
  v0.4.8 铁律:**权重一律 .pt 入仓 + HEAD 验证**(HF 静默剔除 .safetensors/.bin,坑 9)。
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  ## 0.4 RCA 实录(v0.4.9,复现工具已入仓)
22
 
23
  | 探针 | 读数 | 结论 |
 
5
 
6
  ## 0. 一句话现状
7
 
8
+ **RCA 已定案 + v0.4.9 视觉读出修复已实施;v4 重训在 real_b 完成后(止损 s160,
9
+ loss 0.25-0.55)遇 T4 回收,等待新 T4 恢复 real_c**。v3 阴性结果(0 关 0 胜)的根因
10
  不是数据而是架构:`pooled_last_position` 从序列末位读出,帧内容信号被淹没
11
  (实测: radically different frames 的 last-pos cos=0.991,真游戏上 0.9999;而视觉塔
12
  在图像 token 位本身活得好好的 per-token cos=0.60)。**A→B→C 三阶段的决策头从未见过
13
  帧内容** —— 候选分布坍缩(ACTION3 占 70%)、视觉塔形同虚设。修复:池化改为
14
  `[last_text; mean(vision_tokens)]`(2H),头部首层扩维,检查点记录 `pool_vision`
15
+ 标志(旧 v3 检查点自动兼容,build_s1 自动探测)。修复直接兑现在训练信号上:
16
+ 同数据同预算,v4 real_b loss 在 s56 即降到 0.485(v3 同期 3-9 震荡)。
17
 
18
  v3 历史结论保留:real_b(SFT) 收敛止损 + real_c(RLCD) ECE 0.4151→0.2727,
19
  对照评测 ar25+bp35 各 150 步 0 关 0 胜;产物在 HF `t4_assets_v3/checkpoints/`。
20
  v0.4.8 铁律:**权重一律 .pt 入仓 + HEAD 验证**(HF 静默剔除 .safetensors/.bin,坑 9)。
21
 
22
+ **T4 FUKJA61G 已回收(~5.8h 超时,502)—— 死于 v4 real_c 中途(~step 60-100,无 WIP)**。
23
+ 损失:① real_c 进度(Stage C 无断点保险,重跑 ~50min);② ε0.45 重采 traces_real3
24
+ (275+ 集未推 HF,重采 ~2h,CPU 与训练并行不额外占时间)。其余全部安全:v4
25
+ Stage B 权重(s160 止损版,loss 0.25-0.55)已 HEAD 验证在 HF
26
+ `t4_assets_v4/checkpoints/hf_lora/adapter_model.pt`。
27
+
28
+ **新 T4 恢复(一键)**:标准 bootstrap 装好代码+依赖后:
29
+ ```bash
30
+ cd /content/qwenjev && QWENJEV_OUT=qwenjev-s1-hf-v4 QWENJEV_ASSETS=t4_assets_v4 \
31
+ nohup python3 -u -B scripts/v4_recover_bootstrap.py > /content/v4_recover.log 2>&1 &
32
+ ```
33
+ 自动:抽 dataset_final.tgz → 拉 v4 权重到 stage_a_lora/hf_lora → 盖 prep/data/real_b 章
34
+ → 直进 real_c → ALL_DONE → 对照评测。之后合并 traces_real3 重训 v4b(见 §6)。
35
+
36
  ## 0.4 RCA 实录(v0.4.9,复现工具已入仓)
37
 
38
  | 探针 | 读数 | 结论 |
scripts/v4_recover_bootstrap.py ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """One-command v4 recovery bootstrap for a FRESH Colab T4.
3
+
4
+ Context (2026-09-23): the FUKJA61G T4 died mid-real_c (uptime ~5.8h).
5
+ Everything that matters is on HF:
6
+ * code v0.4.9 (vision-aware pooling fix) -> repo root
7
+ * v4 Stage B weights (loss 0.25-0.55 @ s160-164) -> t4_assets_v4/checkpoints/hf_lora/adapter_model.pt
8
+ * the merged 167,635-sample dataset -> t4_assets_v3/data/dataset_final.tgz
9
+ * HANDOVER with full RCA -> HANDOVER.md
10
+
11
+ This script (run INSIDE the fresh T4, after the standard code+deps bootstrap):
12
+ 1. extracts dataset_final.tgz -> data/dataset_final (data stage equivalent)
13
+ 2. pulls v4 hf_lora .pt -> checkpoints/qwenjev-s1-hf-v4/stage_a_lora + hf_lora
14
+ (Stage B is NOT re-run: s160 weights are the operator-approved stop)
15
+ 3. stamps prep/data/real_b as done -> orchestrator goes straight to real_c
16
+ 4. launches the orchestrator (GPU) -> real_c -> ALL_DONE -> upload
17
+ 5. launches the eps0.45 collector (CPU) -> data/traces_real3 (in parallel; ~2h)
18
+
19
+ Usage (on the T4, inside /content/qwenjev after deps install):
20
+ QWENJEV_OUT=qwenjev-s1-hf-v4 QWENJEV_ASSETS=t4_assets_v4 \
21
+ nohup python3 -u -B scripts/v4_recover_bootstrap.py > /content/v4_recover.log 2>&1 &
22
+ """
23
+
24
+ import json
25
+ import os
26
+ import shutil
27
+ import subprocess
28
+ import sys
29
+ import tarfile
30
+ import time
31
+ from pathlib import Path
32
+
33
+ REPO = Path("/content/qwenjev")
34
+ WORK = Path(os.environ.get("QWENJEV_WORK", "/content/qwenjev_work_v3"))
35
+ OUT = REPO / "checkpoints" / os.environ.get("QWENJEV_OUT", "qwenjev-s1-hf-v4")
36
+ ASSETS = os.environ.get("QWENJEV_ASSETS", "t4_assets_v4")
37
+ DONE = WORK / "done_v3"
38
+ HF_REPO = "tchbcb/qwenjev"
39
+
40
+ os.chdir(REPO)
41
+ token = None
42
+ for cand in (os.environ.get("HF_TOKEN"), WORK / ".hf_token"):
43
+ if cand and str(cand).strip() and os.path.exists(str(cand)):
44
+ token = open(str(cand)).read().strip()
45
+ break
46
+ if not token:
47
+ raise SystemExit("no HF_TOKEN / .hf_token found")
48
+ os.environ["HF_TOKEN"] = token
49
+
50
+ from huggingface_hub import hf_hub_download # noqa: E402
51
+
52
+ print("[recover] 1/4 dataset_final", flush=True)
53
+ ds = REPO / "data" / "dataset_final"
54
+ if not (ds / "train" / "samples.jsonl").exists():
55
+ tgz = hf_hub_download(HF_REPO, f"{ASSETS}/data/dataset_final.tgz"
56
+ if False else "t4_assets_v3/data/dataset_final.tgz")
57
+ ds.mkdir(parents=True, exist_ok=True)
58
+ with tarfile.open(tgz) as t:
59
+ t.extractall(REPO) # archive root is data/dataset_final
60
+ print(" train rows:", sum(1 for _ in open(ds / "train" / "samples.jsonl")), flush=True)
61
+
62
+ print("[recover] 2/4 v4 stage_b weights -> stage_a_lora + hf_lora", flush=True)
63
+ pt = hf_hub_download(HF_REPO, f"{ASSETS}/checkpoints/hf_lora/adapter_model.pt")
64
+ for sub in ("stage_a_lora", "hf_lora"):
65
+ d = OUT / sub
66
+ d.mkdir(parents=True, exist_ok=True)
67
+ shutil.copyfile(pt, d / "adapter_model.safetensors")
68
+ for f in ("adapter_config.json", "README.md"):
69
+ try:
70
+ src = hf_hub_download(HF_REPO, f"{ASSETS}/checkpoints/hf_lora/{f}")
71
+ shutil.copyfile(src, d / f)
72
+ except Exception:
73
+ pass
74
+ meta = hf_hub_download(HF_REPO, f"{ASSETS}/checkpoints/stage_b_meta.json")
75
+ shutil.copyfile(meta, OUT / "stage_b_meta.json")
76
+ print(" restored ->", OUT, flush=True)
77
+
78
+ print("[recover] 3/4 stamps", flush=True)
79
+ DONE.mkdir(parents=True, exist_ok=True)
80
+ now = time.strftime("%F %T")
81
+ for name in ("prep", "data", "real_b"):
82
+ (DONE / f"{name}.stamp").write_text(
83
+ f"{now} (v4 recovery: prep=v2 lora re-seed, data=dataset_final from HF, "
84
+ "real_b=s160 operator-approved weights from HF)")
85
+ print(" stamps:", sorted(p.name for p in DONE.glob("*.stamp")), flush=True)
86
+
87
+ print("[recover] 4/4 launch orchestrator (GPU) + collector (CPU)", flush=True)
88
+ env = {**os.environ, "QWENJEV_OUT": os.environ.get("QWENJEV_OUT", "qwenjev-s1-hf-v4"),
89
+ "QWENJEV_ASSETS": ASSETS, "PYTHONUNBUFFERED": "1"}
90
+ subprocess.Popen(["python3", "-u", "-B", "ops/t4_real25.py"],
91
+ cwd=str(REPO), stdout=open("/content/t4_v4.log", "w"),
92
+ stderr=subprocess.STDOUT, env=env,
93
+ start_new_session=True)
94
+ subprocess.Popen(["python3", "-u", "-B", "-m", "data.collect_selfplay",
95
+ "--config", "configs/collect_real_v4.yaml"],
96
+ cwd=str(REPO), stdout=open("/content/collect_v4.log", "w"),
97
+ stderr=subprocess.STDOUT, env=env,
98
+ start_new_session=True)
99
+ print("[recover] launched: orchestrator -> real_c; collector -> traces_real3", flush=True)
100
+ print("[recover] monitor: tail /content/t4_v4.log /content/collect_v4.log", flush=True)