plato-ai 0.1.0.dev0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- plato/__init__.py +1 -0
- plato/bench/__init__.py +1 -0
- plato/bench/csvio.py +120 -0
- plato/bench/fit_spike.py +1138 -0
- plato/bench/fit_spike_test.py +310 -0
- plato/bench/hidden_size_guard.py +142 -0
- plato/bench/hidden_size_guard_test.py +75 -0
- plato/bench/offload.py +132 -0
- plato/bench/results/.gitkeep +1 -0
- plato/bench/results/decode_sweep.csv +13 -0
- plato/bench/results/fit.csv +3 -0
- plato/bench/results/hidden_size_guard.json +7 -0
- plato/bench/results/microbench.csv +2 -0
- plato/bench/results/prefill.csv +2 -0
- plato/bench/results/section_8_1.md +55 -0
- plato/bench/results/verbalise_decode_remeasure.csv +101 -0
- plato/bench/throughput.py +900 -0
- plato/bench/throughput_test.py +297 -0
- plato/data/__init__.py +1 -0
- plato/data/episodes.py +839 -0
- plato/data/episodes_test.py +165 -0
- plato/data/fixtures/c2_golden/MANIFEST.json +26 -0
- plato/data/fixtures/c2_golden/README.md +8 -0
- plato/data/fixtures/c2_golden/a5369b2d057d4a4fb0553bfb28975ef097bb792c7eb7fa3f376edeaee21e01a5.jsonl +100 -0
- plato/data/fixtures/c2_golden/episodes.jsonl +100 -0
- plato/data/pipeline.py +473 -0
- plato/data/pipeline_test.py +204 -0
- plato/data/renderers.py +121 -0
- plato/data/renderers_test.py +267 -0
- plato/data/synthetic/__init__.py +1 -0
- plato/data/synthetic/__main__.py +5 -0
- plato/data/synthetic/c0.py +992 -0
- plato/data/synthetic/c0_test.py +381 -0
- plato/data/synthetic/c2.py +1452 -0
- plato/data/synthetic/c2_test.py +392 -0
- plato/data/synthetic/cli.py +309 -0
- plato/data/synthetic/cli_test.py +111 -0
- plato/data/synthetic/credential.schema.json +39 -0
- plato/data/synthetic/hygiene.py +211 -0
- plato/data/synthetic/judge.py +352 -0
- plato/data/synthetic/providers.py +567 -0
- plato/data/synthetic/providers_test.py +350 -0
- plato/data/synthetic/realise.py +1867 -0
- plato/data/synthetic/realise_test.py +1345 -0
- plato/data/synthetic/repeat_copy.py +231 -0
- plato/data/synthetic/repeat_copy_test.py +43 -0
- plato/data/synthetic/veto.py +230 -0
- plato/data/synthetic/veto_test.py +192 -0
- plato/eval/__init__.py +1 -0
- plato/eval/ablations.py +478 -0
- plato/eval/ablations_test.py +485 -0
- plato/eval/budget.py +360 -0
- plato/eval/budget_test.py +167 -0
- plato/eval/stats.py +1688 -0
- plato/eval/stats_test.py +937 -0
- plato/memory/__init__.py +1 -0
- plato/memory/access.py +680 -0
- plato/memory/access_test.py +724 -0
- plato/memory/addressing.py +421 -0
- plato/memory/addressing_test.py +658 -0
- plato/memory/boundary_test.py +127 -0
- plato/memory/config.py +94 -0
- plato/memory/design_test.py +724 -0
- plato/memory/errors.py +17 -0
- plato/memory/golden_test.py +555 -0
- plato/memory/ops.py +214 -0
- plato/memory/ops_test.py +98 -0
- plato/memory/parity_adapters.py +193 -0
- plato/memory/parity_adapters_test.py +122 -0
- plato/memory/property_test.py +570 -0
- plato/memory/state.py +406 -0
- plato/memory/state_test.py +205 -0
- plato/model/__init__.py +1 -0
- plato/model/bare_load.py +77 -0
- plato/model/bare_load_test.py +26 -0
- plato/model/encoder.py +446 -0
- plato/model/encoder_test.py +178 -0
- plato/model/episodes.py +194 -0
- plato/model/episodes_test.py +81 -0
- plato/model/fakes.py +232 -0
- plato/model/fixtures/__init__.py +1 -0
- plato/model/fixtures/etime_features.npz +0 -0
- plato/model/fixtures/etime_proj_2048.npz +0 -0
- plato/model/fixtures/etime_proj_4096.npz +0 -0
- plato/model/fixtures/make_fixtures.py +126 -0
- plato/model/gate.py +264 -0
- plato/model/gate_test.py +213 -0
- plato/model/heads.py +374 -0
- plato/model/heads_test.py +233 -0
- plato/model/hf.py +572 -0
- plato/model/lora.py +240 -0
- plato/model/lora_test.py +100 -0
- plato/model/lr.py +59 -0
- plato/model/lr_test.py +58 -0
- plato/model/pins.py +12 -0
- plato/model/pins_test.py +42 -0
- plato/model/reader.py +245 -0
- plato/model/reader_test.py +134 -0
- plato/model/registry.py +145 -0
- plato/model/registry_test.py +94 -0
- plato/model/rosters/__init__.py +1 -0
- plato/model/rosters/dump.py +29 -0
- plato/model/rosters/qwen3_5_0_8b.txt +186 -0
- plato/model/rosters/qwen3_5_2b.txt +186 -0
- plato/model/smoke.py +944 -0
- plato/model/smoke_mutant_results.json +13713 -0
- plato/model/smoke_results.json +13523 -0
- plato/model/smoke_test.py +321 -0
- plato/obs/__init__.py +1 -0
- plato/obs/viewer.py +1242 -0
- plato/obs/viewer_test.py +409 -0
- plato/package_metadata_test.py +46 -0
- plato/testing/__init__.py +1 -0
- plato/testing/data_mutants.py +379 -0
- plato/testing/eval_mutants.py +200 -0
- plato/testing/memory_mutants.py +387 -0
- plato/testing/model_mutants.py +80 -0
- plato/testing/mutants.py +110 -0
- plato/testing/mutants_meta_test.py +231 -0
- plato/testing/obs_mutants.py +32 -0
- plato/train/__init__.py +1 -0
- plato/train/curriculum.py +34 -0
- plato/train/curriculum_test.py +14 -0
- plato_ai-0.1.0.dev0.dist-info/METADATA +255 -0
- plato_ai-0.1.0.dev0.dist-info/RECORD +129 -0
- plato_ai-0.1.0.dev0.dist-info/WHEEL +4 -0
- plato_ai-0.1.0.dev0.dist-info/entry_points.txt +2 -0
- plato_ai-0.1.0.dev0.dist-info/licenses/LICENSE +203 -0
- plato_ai-0.1.0.dev0.dist-info/licenses/NOTICE +11 -0
plato/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""plato: a controller-operated DNC memory that any LLM can use."""
|
plato/bench/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Fit-check and controller-plane throughput benchmarks."""
|
plato/bench/csvio.py
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"""Idempotent CSV helpers for S7 bench outputs.
|
|
2
|
+
|
|
3
|
+
A cell is skipped when a row with the same key columns already exists
|
|
4
|
+
(M0 §9 Spot mitigation: each bench run ≤ 30 min and idempotent).
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import csv
|
|
10
|
+
from collections.abc import Mapping, Sequence
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
from typing import cast
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def cell(value: object) -> str:
|
|
16
|
+
"""Render a CSV cell. Bools are ``true``/``false`` (not ``1``/``0``).
|
|
17
|
+
|
|
18
|
+
``None`` is an empty field (OOM / incomplete-step metrics). The markdown
|
|
19
|
+
writer prints ``—`` for empty numeric cells.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
if value is None:
|
|
23
|
+
return ""
|
|
24
|
+
if isinstance(value, bool):
|
|
25
|
+
return "true" if value else "false"
|
|
26
|
+
if isinstance(value, float):
|
|
27
|
+
return f"{value:.8g}"
|
|
28
|
+
return str(value)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def csv_rows(path: Path) -> list[dict[str, str]]:
|
|
32
|
+
if not path.is_file():
|
|
33
|
+
return []
|
|
34
|
+
with path.open(newline="", encoding="utf-8") as handle:
|
|
35
|
+
reader = csv.DictReader(handle)
|
|
36
|
+
rows: list[dict[str, str]] = []
|
|
37
|
+
for raw in reader:
|
|
38
|
+
typed = cast(dict[object, object], raw)
|
|
39
|
+
row: dict[str, str] = {}
|
|
40
|
+
for key, value in typed.items():
|
|
41
|
+
if not isinstance(key, str):
|
|
42
|
+
continue
|
|
43
|
+
row[key] = "" if value is None else str(value)
|
|
44
|
+
rows.append(row)
|
|
45
|
+
return rows
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def csv_has_row(path: Path, key: Mapping[str, str]) -> bool:
|
|
49
|
+
"""True iff some existing row matches every ``key`` column exactly."""
|
|
50
|
+
|
|
51
|
+
for row in csv_rows(path):
|
|
52
|
+
if all(row.get(name) == value for name, value in key.items()):
|
|
53
|
+
return True
|
|
54
|
+
return False
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def csv_append(
|
|
58
|
+
path: Path,
|
|
59
|
+
fieldnames: Sequence[str],
|
|
60
|
+
row: Mapping[str, object],
|
|
61
|
+
) -> None:
|
|
62
|
+
"""Append ``row`` (creating the file + header if needed)."""
|
|
63
|
+
|
|
64
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
65
|
+
new_file = not path.is_file() or path.stat().st_size == 0
|
|
66
|
+
with path.open("a", newline="", encoding="utf-8") as handle:
|
|
67
|
+
writer = csv.DictWriter(handle, fieldnames=list(fieldnames), extrasaction="ignore")
|
|
68
|
+
if new_file:
|
|
69
|
+
writer.writeheader()
|
|
70
|
+
rendered: dict[str, str] = {name: cell(row.get(name, "")) for name in fieldnames}
|
|
71
|
+
writer.writerow(rendered)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def csv_upsert(
|
|
75
|
+
path: Path,
|
|
76
|
+
fieldnames: Sequence[str],
|
|
77
|
+
row: Mapping[str, object],
|
|
78
|
+
key: Mapping[str, str],
|
|
79
|
+
) -> None:
|
|
80
|
+
"""Replace the row matching ``key``, or append if none exists.
|
|
81
|
+
|
|
82
|
+
Read-modify-write of the whole file. Extra rows with the same key are
|
|
83
|
+
dropped so a prior append-on-OOM cannot leave duplicates.
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
87
|
+
rendered: dict[str, str] = {name: cell(row.get(name, "")) for name in fieldnames}
|
|
88
|
+
written: list[dict[str, str]] = []
|
|
89
|
+
replaced = False
|
|
90
|
+
for old in csv_rows(path):
|
|
91
|
+
if all(old.get(name) == value for name, value in key.items()):
|
|
92
|
+
if not replaced:
|
|
93
|
+
written.append(rendered)
|
|
94
|
+
replaced = True
|
|
95
|
+
continue
|
|
96
|
+
written.append({name: old.get(name, "") for name in fieldnames})
|
|
97
|
+
if not replaced:
|
|
98
|
+
written.append(rendered)
|
|
99
|
+
with path.open("w", newline="", encoding="utf-8") as handle:
|
|
100
|
+
writer = csv.DictWriter(handle, fieldnames=list(fieldnames), extrasaction="ignore")
|
|
101
|
+
writer.writeheader()
|
|
102
|
+
for item in written:
|
|
103
|
+
writer.writerow(item)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def lookup_row(path: Path, key: Mapping[str, str]) -> dict[str, str] | None:
|
|
107
|
+
for row in csv_rows(path):
|
|
108
|
+
if all(row.get(name) == value for name, value in key.items()):
|
|
109
|
+
return row
|
|
110
|
+
return None
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def parse_float(row: Mapping[str, str], name: str) -> float | None:
|
|
114
|
+
raw = row.get(name)
|
|
115
|
+
if raw is None or raw == "":
|
|
116
|
+
return None
|
|
117
|
+
try:
|
|
118
|
+
return float(raw)
|
|
119
|
+
except ValueError:
|
|
120
|
+
return None
|