Cion-lab commited on
Commit
1279da6
·
verified ·
1 Parent(s): 38d1f55

train: preflight -- hubckpt.ensure_repo writes LFS attributes before the first checkpoint push (found by P1)

Browse files
Files changed (1) hide show
  1. train/preflight.py +7 -7
train/preflight.py CHANGED
@@ -115,10 +115,7 @@ ounce100m_credentials.install()
115
  from huggingface_hub import HfApi
116
  api = HfApi(); tok = os.environ["HF_TOKEN"]
117
  repo = "Cion-lab/ounce100m-ckptbench-DELETEME"
118
- try:
119
- api.create_repo(repo_id=repo, repo_type="dataset", exist_ok=True, token=tok)
120
- except Exception as e:
121
- print("repo create:", type(e).__name__, str(e)[:120])
122
  d = "/kaggle/working/ckptbench/checkpoint-1"
123
  os.makedirs(d, exist_ok=True)
124
  # 106,194,240 params x 4 B x 4 arrays (fp16-saved weights + fp32 master + Adam m and v) is the real
@@ -146,15 +143,18 @@ try:
146
  # to mistake it for a checkpoint. Everything measurable is in the log by this point.
147
  api.delete_repo(repo_id=repo, repo_type="dataset", token=tok)
148
  except Exception as e:
149
- res, ver, got, same = {"error": f"{type(e).__name__}: {str(e)[:300]}"}, {}, {}, False
 
150
  print("HUB_JSON_BEGIN")
151
- print(json.dumps({"push_verify_seconds": round(time.time()-up_t0,1),
 
152
  "cycle": {k: res.get(k) for k in ("verify","pruned","free_before_gb","free_after_gb")},
153
  "downloaded": got, "readback_ok": bool(ver.get("ok")) and same,
154
  "gen_seconds": round(time.time()-t0,1)}, default=str))
155
  print("HUB_JSON_END")
156
  '''
157
- r = sh([sys.executable, "-c", src], timeout=5400, label="P1 hub cycle (425 MB mock checkpoint)")
 
158
  R["P1"] = last_json(r["out"], "HUB_JSON_BEGIN", "HUB_JSON_END")
159
  R["P1_rc"] = r["rc"]
160
  j = R["P1"] or {}
 
115
  from huggingface_hub import HfApi
116
  api = HfApi(); tok = os.environ["HF_TOKEN"]
117
  repo = "Cion-lab/ounce100m-ckptbench-DELETEME"
118
+ print("ensure_repo:", json.dumps(hubckpt.ensure_repo(repo, api, tok)), flush=True)
 
 
 
119
  d = "/kaggle/working/ckptbench/checkpoint-1"
120
  os.makedirs(d, exist_ok=True)
121
  # 106,194,240 params x 4 B x 4 arrays (fp16-saved weights + fp32 master + Adam m and v) is the real
 
143
  # to mistake it for a checkpoint. Everything measurable is in the log by this point.
144
  api.delete_repo(repo_id=repo, repo_type="dataset", token=tok)
145
  except Exception as e:
146
+ res, ver, got, same = {"error": f"{type(e).__name__}: {str(e)[:600]}"}, {}, {}, False
147
+ print(" P1 raised:", res["error"], flush=True)
148
  print("HUB_JSON_BEGIN")
149
+ print(json.dumps({"error": res.get("error"),
150
+ "push_verify_seconds": round(time.time()-up_t0,1),
151
  "cycle": {k: res.get(k) for k in ("verify","pruned","free_before_gb","free_after_gb")},
152
  "downloaded": got, "readback_ok": bool(ver.get("ok")) and same,
153
  "gen_seconds": round(time.time()-t0,1)}, default=str))
154
  print("HUB_JSON_END")
155
  '''
156
+ r = sh([sys.executable, "-c", src], timeout=5400,
157
+ label="P1 hub cycle (1.7 GB mock checkpoint: weights+master+Adam m,v)")
158
  R["P1"] = last_json(r["out"], "HUB_JSON_BEGIN", "HUB_JSON_END")
159
  R["P1_rc"] = r["rc"]
160
  j = R["P1"] or {}