Swordnael commited on
Commit
c4d443d
·
verified ·
1 Parent(s): 0117235

Add pinned Colab structural smoke

Browse files
notebooks/autonoma_fable_router_structural_smoke_colab.ipynb ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "# Autonoma Fable router structural smoke \u2014 Colab\n",
8
+ "\n",
9
+ "This notebook runs **mechanical, non-routing evidence only**. It does not train or publish a candidate model. It validates one frozen donor bank against the real Fable host, attaches only layer 29, persists pass/fail evidence to the private `Swordnael/LFM2.5-Fable-Router-Smoke-Evidence` dataset, and refuses GPUs below 14 GiB or insufficient disk.\n",
10
+ "\n",
11
+ "Source bundle: `Swordnael/LFM2.5-Fable-Router-Curriculum@0117235e91542dc5bc91d876b0c89d89becdfbc8`. The four bank IDs should be run in the declared order, one per fresh execution. Failed runs remain evidence and never authorize 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 = \"0117235e91542dc5bc91d876b0c89d89becdfbc8\"\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
+ "}\n",
56
+ "for remote, local in files.items():\n",
57
+ " url = f\"https://huggingface.co/datasets/Swordnael/LFM2.5-Fable-Router-Curriculum/resolve/{REVISION}/{remote}\"\n",
58
+ " destination = CODE / local\n",
59
+ " destination.write_bytes(urlopen(url).read())\n",
60
+ " print(destination, destination.stat().st_size)\n"
61
+ ]
62
+ },
63
+ {
64
+ "cell_type": "code",
65
+ "execution_count": null,
66
+ "metadata": {},
67
+ "outputs": [],
68
+ "source": [
69
+ "BANKS = ['kat-coder-v25-dev-q4km', 'qwen36-35b-base-q4km', 'ornith10-35b-q4km', 'qwen35-35b-base-q4km']\n",
70
+ "BANK = BANKS[0] # Change only this value for the next isolated run.\n",
71
+ "assert BANK in BANKS\n",
72
+ "print(\"Selected:\", BANK)\n"
73
+ ]
74
+ },
75
+ {
76
+ "cell_type": "code",
77
+ "execution_count": null,
78
+ "metadata": {},
79
+ "outputs": [],
80
+ "source": [
81
+ "import subprocess, sys\n",
82
+ "command = [\n",
83
+ " sys.executable,\n",
84
+ " str(CODE / \"run_fable_router_structural_smoke.py\"),\n",
85
+ " \"--owner-execute\",\n",
86
+ " \"--config\", str(CODE / \"fable-router-cloud-smoke.v1.json\"),\n",
87
+ " \"--bank\", BANK,\n",
88
+ " \"--platform\", \"colab\",\n",
89
+ " \"--work-dir\", str(ROOT),\n",
90
+ "]\n",
91
+ "print(\" \".join(command))\n",
92
+ "completed = subprocess.run(command, check=False)\n",
93
+ "if completed.returncode:\n",
94
+ " raise RuntimeError(f\"Structural smoke failed with exit code {completed.returncode}; the failure evidence was still persisted\")\n"
95
+ ]
96
+ },
97
+ {
98
+ "cell_type": "markdown",
99
+ "metadata": {},
100
+ "source": [
101
+ "## Interpretation\n",
102
+ "\n",
103
+ "`structural_smoke_passed_nonrouting` means only that the bank passed the frozen structural gates. Copy the final printed `result.json` path if you want a local reference, but the authoritative evidence is uploaded automatically to the private evidence dataset. Do not start full training until all four banks pass and the owner issues a separate training authorization.\n"
104
+ ]
105
+ }
106
+ ],
107
+ "metadata": {
108
+ "accelerator": "GPU",
109
+ "kernelspec": {
110
+ "display_name": "Python 3",
111
+ "language": "python",
112
+ "name": "python3"
113
+ },
114
+ "language_info": {
115
+ "name": "python"
116
+ }
117
+ },
118
+ "nbformat": 4,
119
+ "nbformat_minor": 5
120
+ }