Leszek Bukowski commited on
Commit ·
bc01ce0
1
Parent(s): 39ce46e
Allow 24 GB GPU trials in the Probe demo
Browse filesFiles changed (2)
- README.md+15-10
- notebook.ipynb+5-5
38 unmodified lines394041424344454647484950424344454647484950515253545556575859556061626338 unmodified linesA fresh latest-version session normally needs no restart; if an older librarywas already imported, the setup cell explains when to restart.
Select the **latest Colab runtime version** and an **A100 GPU**. The requirementis Linux, Python **3.12 or 3.13**, native BF16 and at least **40 GiB of reportedGPU memory**. An A100 80 GB meets that requirement; smaller substitute GPUs maynot. Downloading the pinned Qwen backbone takes about 18 GB. The demo verifiesresource hashes and provides editable writing and Decision JSON examples.Private staging requires a Hugging Face read token in the hidden prompt; neversave credentials in notebook source or output.
The demo uses the inference wheel (`0.1.0rc2`) and built-in PyTorch operations,Select the **latest Colab runtime version** and an NVIDIA GPU with **native BF16**.Use Linux and Python **3.12 or 3.13**. **You may try a 24 GB GPU**: there is nominimum-memory cutoff, but actual fit on this capacity is not yet validated.Setup reports total/free GPU memory; **READY** does not guarantee the model fits.BF16 weights alone use about 18 GB, with extra memory needed for loading and requests.
If memory runs out, the demo stops with recovery instructions: restart after afailed load, keep one model loaded, and shorten requests or select a larger GPUif needed. Rerunning the load cell reuses the existing model. No automaticquantization, CPU offload or input truncation is applied. T4 lacks native BF16.Downloading the pinned backbone takes about 18 GB. Private staging needs a HuggingFace read token in the hidden prompt; never save it in source or output.
The demo uses the inference wheel (`0.1.0rc3`) and built-in PyTorch operations,with the same selected weights and routing logic. Inference may be slower andhave small numerical differences from the accelerated reference environment.Notebook 03 reproduces the benchmark measurements with the original referencewheel (`0.1.0rc1`); training and reproduction notebooks remain unchanged.The simplified full-model A100 demo check is pending owner testing.Full-model GPU validation, including the 24 GB trial, remains pending owner testing.
Code, training notebooks and exact usage: [TheSystem](https://github.com/bqpro1/TheSystem).Exact shared data: [TheSystem-Data](https://huggingface.co/datasets/Lbuk/TheSystem-Data).9 unmodified lines10111213131415167 unmodified lines24252627272829301 unmodified line32333435353637381 unmodified line404142434344454671 unmodified lines1181191201211211221231249 unmodified lines "cell_type": "markdown", "id": "prerequisites", "metadata": {}, "source": "## Before you start\n\nSelect **Runtime → Change runtime type → latest runtime version → A100 GPU**.\nUse Linux, Python 3.12 or 3.13, native BF16 and at least **40 GiB of reported GPU memory**;\nan A100 80 GB meets this requirement. Free T4 runtimes are not supported.\nAllow about 18 GB for the pinned Qwen backbone plus working files.\n\nStart with a fresh runtime. This demo reuses Colab's PyTorch 2.14.x and NumPy. Setup installs only the inference\npackages it needs, without compiling CUDA extensions or running training checks.\nThe selected weights and prompt format are unchanged. Built-in PyTorch operations\ncan be slower and may give small numerical differences from the research kernels.\nUse notebook 03 for reproducing the published measurements.\n\nRun the cells in order. During private staging, enter a Hugging Face **read token**\nfrom an account with access to this model repository. Keep the token private.\n" "source": "## Before you start\n\nSelect **Runtime → Change runtime type → latest runtime version → NVIDIA GPU**.\nUse Linux, Python 3.12 or 3.13 and native BF16 support. A **24 GB GPU may be tried**;\nthere is no minimum-memory cutoff. This capacity has not yet been validated for\nthese demos. Free T4 runtimes lack native BF16 support and are unsupported.\n\nBF16 weights alone use about 18 GB. Loading and requests need extra GPU memory,\nwhich depends on the prompt and response length. Setup reports total/free memory;\n**READY** confirms the software and GPU checks, not that the model will fit.\nKeep only one model loaded. Allow about 18 GB of disk space for the backbone plus caches.\n\nStart with a fresh runtime. This demo reuses Colab's PyTorch 2.14.x and NumPy. Setup installs only the inference\npackages it needs, without compiling CUDA extensions or running training checks.\nThe selected weights and prompt format are unchanged. Built-in PyTorch operations\ncan be slower and may give small numerical differences from the research kernels.\nUse notebook 03 for reproducing the published measurements.\n\nRun the cells in order. During private staging, enter a Hugging Face **read token**\nfrom an account with access to this model repository. Keep the token private.\n" }, { "cell_type": "markdown",7 unmodified lines "metadata": { "cellView": "form" }, "source": "# @title Prepare runtime\nRUNTIME_READY = False\nimport getpass, hashlib, os, sys\nfrom urllib.request import Request, urlopen\nfrom urllib.error import HTTPError, URLError\n\nPREPARE = {'repo_id': 'Lbuk/TheSystem-9B-Probe-256', 'revision': '89bf7e352b4e842e4b9a65ff0028b7629137069b', 'sha256': 'e1ac2f9d610a684e14ebfe59ab4157553dcc218f112b5508562ad8f4c9b36d17'}\nprint(\"Prepare runtime: checking Python, then opening private setup access…\", flush=True)\nif sys.version_info[:2] not in ((3, 12), (3, 13)):\n raise RuntimeError(\"Use Python 3.12 or 3.13: Colab Runtime → Change runtime type → the latest runtime version.\")\nos.environ[\"HF_TOKEN\"] = getpass.getpass(\"Hugging Face read token (hidden; Enter only for public access): \").strip()\nprint(\"Downloading the small, pinned setup helper (30-second timeout)…\", flush=True)\nurl = f\"https://huggingface.co/{PREPARE['repo_id']}/resolve/{PREPARE['revision']}/prepare_runtime.py\"\nheaders = {\"Authorization\": f\"Bearer {os.environ['HF_TOKEN']}\"} if os.environ[\"HF_TOKEN\"] else {}\ntry:\n with urlopen(Request(url, headers=headers), timeout=30) as response:\n helper = response.read()\nexcept HTTPError as error:\n raise RuntimeError(\"Setup download failed. For HTTP 401/403, rerun this cell and paste a valid read token for this private repository. \"\n f\"HTTP status: {error.code}. Your browser login is separate from Colab.\") from None\nexcept (URLError, TimeoutError) as error:\n raise RuntimeError(\"Setup helper download failed or timed out. Check the connection and rerun Prepare runtime.\") from None\nif hashlib.sha256(helper).hexdigest() != PREPARE[\"sha256\"]:\n raise RuntimeError(\"Setup helper checksum mismatch. Stop and obtain a fresh release notebook.\")\n_setup = {\"__name__\": \"thesystem_demo_setup\"}\nexec(compile(helper, \"prepare_runtime.py\", \"exec\"), _setup)\nvisible_progress = _setup[\"visible_progress\"]\ntorch = _setup[\"prepare_runtime\"](\"probe\")\n\nRUNTIME_READY = True", "source": "# @title Prepare runtime\nRUNTIME_READY = False\nimport getpass, hashlib, os, sys\nfrom urllib.request import Request, urlopen\nfrom urllib.error import HTTPError, URLError\n\nPREPARE = {'repo_id': 'Lbuk/TheSystem-9B-Probe-256', 'revision': '39ce46e600a9ad7a2d5bf216b17bef71fe40b599', 'sha256': 'a0d1904552b5296ba7c3555fac79bb770b1a4efb75005a5d57e3580b7b3574bc'}\nprint(\"Prepare runtime: checking Python, then opening private setup access…\", flush=True)\nif sys.version_info[:2] not in ((3, 12), (3, 13)):\n raise RuntimeError(\"Use Python 3.12 or 3.13: Colab Runtime → Change runtime type → the latest runtime version.\")\nos.environ[\"HF_TOKEN\"] = getpass.getpass(\"Hugging Face read token (hidden; Enter only for public access): \").strip()\nprint(\"Downloading the small, pinned setup helper (30-second timeout)…\", flush=True)\nurl = f\"https://huggingface.co/{PREPARE['repo_id']}/resolve/{PREPARE['revision']}/prepare_runtime.py\"\nheaders = {\"Authorization\": f\"Bearer {os.environ['HF_TOKEN']}\"} if os.environ[\"HF_TOKEN\"] else {}\ntry:\n with urlopen(Request(url, headers=headers), timeout=30) as response:\n helper = response.read()\nexcept HTTPError as error:\n raise RuntimeError(\"Setup download failed. For HTTP 401/403, rerun this cell and paste a valid read token for this private repository. \"\n f\"HTTP status: {error.code}. Your browser login is separate from Colab.\") from None\nexcept (URLError, TimeoutError) as error:\n raise RuntimeError(\"Setup helper download failed or timed out. Check the connection and rerun Prepare runtime.\") from None\nif hashlib.sha256(helper).hexdigest() != PREPARE[\"sha256\"]:\n raise RuntimeError(\"Setup helper checksum mismatch. Stop and obtain a fresh release notebook.\")\n_setup = {\"__name__\": \"thesystem_demo_setup\"}\nexec(compile(helper, \"prepare_runtime.py\", \"exec\"), _setup)\nvisible_progress = _setup[\"visible_progress\"]\ntorch = _setup[\"prepare_runtime\"](\"probe\")\n\nRUNTIME_READY = True", "outputs": [], "execution_count": null },1 unmodified line "cell_type": "markdown", "id": "load-intro", "metadata": {}, "source": "## 2. Load Probe-256\n\nDownload only this model's release assets and the pinned upstream Qwen backbone.\nThe loader verifies the immutable release manifest and weights. Download progress\nis shown; the first load is slower than later cached loads.\n\nThis demo uses the built-in inference operations. No training or gradient checks run.\n" "source": "## 2. Load Probe-256\n\nDownload only this model's release assets and the pinned upstream Qwen backbone.\nThe loader verifies the immutable release manifest and weights. Download progress\nis shown; the first load is slower than later cached loads.\n\nThis demo uses the built-in inference operations. No training or gradient checks run.\n\nIf GPU memory runs out, the cell stops with recovery instructions. After a loading\nfailure, restart the session to clear partial weights. For a request, try a shorter\nprompt or fewer `max_new_tokens`; if it still fails, use a larger GPU. The demo\nnever silently truncates input, quantizes weights or moves layers to the CPU.\nRerunning the load cell reuses the same already-loaded model.\n" }, { "cell_type": "code",1 unmodified line "metadata": {}, "execution_count": null, "outputs": [], "source": "if not globals().get(\"RUNTIME_READY\", False):\n raise RuntimeError(\"Run Prepare runtime until it reports READY before loading the model.\")\n\nfrom thesystem import load_model\nfrom thesystem.artifacts import resolve_model_resources\n\nwith visible_progress(\"Download and load the selected model\"):\n RESOURCE_ROOT = resolve_model_resources(\"probe\")\n model = load_model(\"probe\", root=RESOURCE_ROOT, execution=\"inference\")\nprint(\"Loaded the selected Probe-256 checkpoint with the shared <FAST> gate.\")\n" "source": "if not globals().get(\"RUNTIME_READY\", False):\n raise RuntimeError(\"Run Prepare runtime until it reports READY before loading the model.\")\n\nfrom thesystem import load_model\nfrom thesystem.artifacts import resolve_model_resources\n\nif globals().get(\"model\") is not None:\n if getattr(model, \"variant\", None) != \"probe\":\n raise RuntimeError(\"A different model is already loaded. Restart the session before loading this model.\")\n print(\"Reusing the loaded model; continue to the examples.\")\nelse:\n with visible_progress(\"Download and load the selected model\"):\n RESOURCE_ROOT = resolve_model_resources(\"probe\")\n model = load_model(\"probe\", root=RESOURCE_ROOT, execution=\"inference\")\n print(\"Loaded the selected Probe-256 checkpoint with the shared <FAST> gate.\")\n" }, { "cell_type": "code",71 unmodified lines "version": "3.12" }, "thesystem": { "release": "0.1.0rc2", "release": "0.1.0rc3", "gpu_required": true, "private_staging": true, "bootstrap_finalized": true,README.md+15-10
notebook.ipynb+5-5