anima_closeout v12: smoke + both relay arms TRAINED; the LoRA control died in peft's torchao dispatcher (Colab preinstalls torchao 0.10.0, peft raises wanting >=0.16; nothing here uses torchao -> CELL 0 uninstalls it, probe then returns False and dispatch falls to standard Linear). run_arm is now IDEMPOTENT: an arm with its final-step save present is reused, never retrained — the campaign resumes from local files after any crash.
Browse files- colab/anima_closeout.ipynb +21 -0
colab/anima_closeout.ipynb
CHANGED
|
@@ -139,6 +139,15 @@
|
|
| 139 |
" sh('pip install -q \"amoe-lora[diffusion] @ '\n",
|
| 140 |
" 'git+https://github.com/AbstractEyes/amoe-lora\"')\n",
|
| 141 |
" ANIMA[\"DEPS_DONE\"] = True\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
"import amoe, deepspeed\n",
|
| 143 |
"print(f\"amoe {amoe.__version__} | deepspeed {deepspeed.__version__}\")\n",
|
| 144 |
"\n",
|
|
@@ -506,7 +515,19 @@
|
|
| 506 |
" lf.write(line)\n",
|
| 507 |
" return proc.wait()\n",
|
| 508 |
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 509 |
"def run_arm(tag, resume=False):\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 510 |
" log = RUNS / f\"{tag}.log\"\n",
|
| 511 |
" flags = \" --resume_from_checkpoint\" if resume else \"\"\n",
|
| 512 |
" t0 = time.time()\n",
|
|
|
|
| 139 |
" sh('pip install -q \"amoe-lora[diffusion] @ '\n",
|
| 140 |
" 'git+https://github.com/AbstractEyes/amoe-lora\"')\n",
|
| 141 |
" ANIMA[\"DEPS_DONE\"] = True\n",
|
| 142 |
+
"# Colab preinstalls torchao 0.10.0; peft's LoRA torchao dispatcher RAISES\n",
|
| 143 |
+
"# on it ('only versions above 0.16.0 are supported') \u2014 killing the LoRA\n",
|
| 144 |
+
"# control arms. Nothing in this stack uses torchao; with it ABSENT peft's\n",
|
| 145 |
+
"# probe returns False and dispatch falls through to the standard Linear.\n",
|
| 146 |
+
"import importlib.util\n",
|
| 147 |
+
"if importlib.util.find_spec(\"torchao\"):\n",
|
| 148 |
+
" sh(\"pip uninstall -y -q torchao\")\n",
|
| 149 |
+
" importlib.invalidate_caches()\n",
|
| 150 |
+
" assert importlib.util.find_spec(\"torchao\") is None, \"torchao survived\"\n",
|
| 151 |
"import amoe, deepspeed\n",
|
| 152 |
"print(f\"amoe {amoe.__version__} | deepspeed {deepspeed.__version__}\")\n",
|
| 153 |
"\n",
|
|
|
|
| 515 |
" lf.write(line)\n",
|
| 516 |
" return proc.wait()\n",
|
| 517 |
"\n",
|
| 518 |
+
"def _arm_max_steps(tag):\n",
|
| 519 |
+
" import tomllib\n",
|
| 520 |
+
" return tomllib.loads(ARMS[tag].read_text())[\"max_steps\"]\n",
|
| 521 |
+
"\n",
|
| 522 |
"def run_arm(tag, resume=False):\n",
|
| 523 |
+
" # IDEMPOTENT: an arm whose FINAL-step save already exists is never\n",
|
| 524 |
+
" # retrained \u2014 after any crash the campaign resumes from local files,\n",
|
| 525 |
+
" # skipping straight past every finished arm.\n",
|
| 526 |
+
" done = sorted(\n",
|
| 527 |
+
" glob.glob(str(RUNS / tag / \"*\" / f\"step{_arm_max_steps(tag)}\")))\n",
|
| 528 |
+
" if done:\n",
|
| 529 |
+
" print(f\"[{tag}] already trained \u2014 reusing {done[-1]}\")\n",
|
| 530 |
+
" return Path(done[-1])\n",
|
| 531 |
" log = RUNS / f\"{tag}.log\"\n",
|
| 532 |
" flags = \" --resume_from_checkpoint\" if resume else \"\"\n",
|
| 533 |
" t0 = time.time()\n",
|