Swordnael commited on
Commit
838a339
·
verified ·
1 Parent(s): 22d71e7

Publish one-start Colab structural campaign

Browse files
notebooks/autonoma_fable_router_structural_campaign_colab.ipynb ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "# Autonoma Fable router structural campaign \u2014 Colab\n",
8
+ "\n",
9
+ "This is a **one-start, mechanical, non-routing campaign**. It never trains or publishes a candidate model. Each frozen donor bank runs in a fresh subprocess, uploads its own append-only evidence, releases CUDA process state, and then the campaign uploads a final private summary.\n",
10
+ "\n",
11
+ "Source bundle: `Swordnael/LFM2.5-Fable-Router-Curriculum@9ca90c594c294cea501b33df97f4d2b18ff94116`. The campaign continues after a bank-specific failure so unattended time still produces evidence. A pass authorizes no routing or training.\n"
12
+ ]
13
+ },
14
+ {
15
+ "cell_type": "code",
16
+ "execution_count": null,
17
+ "metadata": {},
18
+ "outputs": [],
19
+ "source": [
20
+ "%pip install -q 'transformers>=4.56' 'accelerate>=1.2' 'safetensors>=0.5' 'huggingface_hub>=0.34' 'trackio>=0.3'\n"
21
+ ]
22
+ },
23
+ {
24
+ "cell_type": "code",
25
+ "execution_count": null,
26
+ "metadata": {},
27
+ "outputs": [],
28
+ "source": [
29
+ "from google.colab import userdata\n",
30
+ "import os\n",
31
+ "token = userdata.get(\"HF_TOKEN\")\n",
32
+ "if not token:\n",
33
+ " raise RuntimeError(\"Add HF_TOKEN in Colab Secrets and grant this notebook access\")\n",
34
+ "os.environ[\"HF_TOKEN\"] = token\n"
35
+ ]
36
+ },
37
+ {
38
+ "cell_type": "code",
39
+ "execution_count": null,
40
+ "metadata": {},
41
+ "outputs": [],
42
+ "source": [
43
+ "from pathlib import Path\n",
44
+ "from urllib.request import urlopen\n",
45
+ "\n",
46
+ "REVISION = \"9ca90c594c294cea501b33df97f4d2b18ff94116\"\n",
47
+ "ROOT = Path(\"/content/autonoma-fable-smoke\")\n",
48
+ "CODE = ROOT / \"runner\"\n",
49
+ "CODE.mkdir(parents=True, exist_ok=True)\n",
50
+ "files = {\n",
51
+ " \"fable-router-cloud-smoke.v1.json\": \"fable-router-cloud-smoke.v1.json\",\n",
52
+ " \"training/fable_router_common.py\": \"fable_router_common.py\",\n",
53
+ " \"training/fable_router_hybrid.py\": \"fable_router_hybrid.py\",\n",
54
+ " \"training/run_fable_router_structural_smoke.py\": \"run_fable_router_structural_smoke.py\",\n",
55
+ " \"training/run_fable_router_structural_campaign.py\": \"run_fable_router_structural_campaign.py\"\n",
56
+ "}\n",
57
+ "for remote, local in files.items():\n",
58
+ " url = f\"https://huggingface.co/datasets/Swordnael/LFM2.5-Fable-Router-Curriculum/resolve/{REVISION}/{remote}\"\n",
59
+ " destination = CODE / local\n",
60
+ " destination.write_bytes(urlopen(url).read())\n",
61
+ " print(destination, destination.stat().st_size)\n"
62
+ ]
63
+ },
64
+ {
65
+ "cell_type": "code",
66
+ "execution_count": null,
67
+ "metadata": {},
68
+ "outputs": [],
69
+ "source": [
70
+ "import subprocess, sys\n",
71
+ "command = [\n",
72
+ " sys.executable,\n",
73
+ " str(CODE / \"run_fable_router_structural_campaign.py\"),\n",
74
+ " \"--owner-execute\",\n",
75
+ " \"--config\", str(CODE / \"fable-router-cloud-smoke.v1.json\"),\n",
76
+ " \"--runner\", str(CODE / \"run_fable_router_structural_smoke.py\"),\n",
77
+ " \"--source-revision\", REVISION,\n",
78
+ " \"--platform\", \"colab\",\n",
79
+ " \"--work-dir\", str(ROOT),\n",
80
+ " \"--continue-on-failure\",\n",
81
+ "]\n",
82
+ "print(\" \".join(command))\n",
83
+ "completed = subprocess.run(command, check=False)\n",
84
+ "if completed.returncode:\n",
85
+ " raise RuntimeError(f\"Campaign completed with one or more failures (exit {completed.returncode}); all available evidence was still persisted\")\n"
86
+ ]
87
+ },
88
+ {
89
+ "cell_type": "markdown",
90
+ "metadata": {},
91
+ "source": [
92
+ "## Interpretation\n",
93
+ "\n",
94
+ "The authoritative records are uploaded automatically to the private evidence dataset after every bank and at campaign completion. `campaign_passed_nonrouting` means all four structural smokes passed; it does not authorize training or production routing.\n"
95
+ ]
96
+ }
97
+ ],
98
+ "metadata": {
99
+ "accelerator": "GPU",
100
+ "kernelspec": {
101
+ "display_name": "Python 3",
102
+ "language": "python",
103
+ "name": "python3"
104
+ },
105
+ "language_info": {
106
+ "name": "python"
107
+ }
108
+ },
109
+ "nbformat": 4,
110
+ "nbformat_minor": 5
111
+ }