STAR-future commited on
Commit
e5a298a
·
verified ·
1 Parent(s): d3f21a4

H6-lite on GPUs < 39 GB

Browse files
Files changed (1) hide show
  1. tools/colab_k3pass.py +9 -1
tools/colab_k3pass.py CHANGED
@@ -279,11 +279,19 @@ if MODE == "h6":
279
  force_download=True)).read_bytes())
280
  h6 = W / "h6"
281
  h6_doms = os.environ.get("H6_DOMAINS", "chips,space,physics")
 
 
 
 
 
 
 
 
282
  if not (h6 / "full_tail_wsp.pt").exists():
283
  rc = run([sys.executable, "-u", str(W / "trinity_full_tail_wsp.py"), "train", "--cache", str(W / "out_train2"),
284
  str(W / "out_train3"), *extra, "--out", str(h6), "--domains", h6_doms,
285
  "--head-rank", "256", "--head-alpha", "256", "--tail-rank", "128", "--tail-alpha", "128",
286
- "--k", "128", "--include-new-experts", "--routed-rank", "16", "--routed-alpha", "16",
287
  "--skip-prefix-tokens", "2", "--lr", "1.5e-4", "--epochs", "3.0",
288
  "--kl", "6.0", "--block-size", "256"], "h6_train.log")
289
  if rc != 0:
 
279
  force_download=True)).read_bytes())
280
  h6 = W / "h6"
281
  h6_doms = os.environ.get("H6_DOMAINS", "chips,space,physics")
282
+ import torch
283
+ _h6_gpu = torch.cuda.get_device_properties(0).total_memory / 2 ** 30
284
+ # 2026-11-24 (prereg Amendment 3): 384 routed experts (w1+w3 ~58 MB each, ~22 GB) do not fit a 24 GB L4. Below
285
+ # 39 GB the run is "H6-lite": head r256 + tail r128 + final norm, no routed-expert LoRA. Recorded in h6_variant.json.
286
+ h6_routed = ["--k", "128", "--include-new-experts"] if _h6_gpu >= 39 else ["--k", "0"]
287
+ h6.mkdir(parents=True, exist_ok=True)
288
+ (h6 / "h6_variant.json").write_text(json.dumps({"gpu_gib": round(_h6_gpu, 1), "variant": "full" if _h6_gpu >= 39 else "lite",
289
+ "routed_args": h6_routed, "domains": h6_doms}))
290
  if not (h6 / "full_tail_wsp.pt").exists():
291
  rc = run([sys.executable, "-u", str(W / "trinity_full_tail_wsp.py"), "train", "--cache", str(W / "out_train2"),
292
  str(W / "out_train3"), *extra, "--out", str(h6), "--domains", h6_doms,
293
  "--head-rank", "256", "--head-alpha", "256", "--tail-rank", "128", "--tail-alpha", "128",
294
+ *h6_routed, "--routed-rank", "16", "--routed-alpha", "16",
295
  "--skip-prefix-tokens", "2", "--lr", "1.5e-4", "--epochs", "3.0",
296
  "--kl", "6.0", "--block-size", "256"], "h6_train.log")
297
  if rc != 0: