Skip to content

Commit e5f9f97

Browse files
Merge pull request #8 from MaharshPatelX/codex/local-350m-compute-plan
docs: adopt local 350M compute plan
2 parents 2269eb4 + 6d8b097 commit e5f9f97

7 files changed

Lines changed: 163 additions & 45 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
Research framework for routing prompts across evolving LLM portfolios with a compact Liquid AI encoder.
66

7-
> **Research status:** Pre-alpha. Parts 0–2 are merged. Part 3 is implemented and validated locally, and Part 4 now produces five real leakage-safe xRouteBench manifests plus an explicit unsupported-temporal record. Review and merge are still pending. No benchmark results or trained router checkpoint are claimed yet.
7+
> **Research status:** Pre-alpha. Parts 0–4 are merged. The six canonical tables and five real leakage-safe xRouteBench manifests are reproducible; temporal is explicitly unsupported because the source has no dates. Part 5's baseline suite is next. No benchmark results or trained router checkpoint are claimed yet.
88
>
9-
> **Project progress:** [3 of 17 core parts merged — view the tracker](docs/PROJECT_TRACKER.md)
9+
> **Project progress:** [5 of 17 core parts merged — view the tracker](docs/PROJECT_TRACKER.md)
1010
1111
## Research question
1212

@@ -38,7 +38,7 @@ Development order:
3838
8. Online bandit adapter and budget pacing.
3939
9. External benchmarks, ablations, and research release.
4040

41-
See the [project tracker](docs/PROJECT_TRACKER.md) for current progress, the [project blueprint](docs/PROJECT_BLUEPRINT.md) for the full ordered build plan, the [Part 3 canonical-data guide](docs/PART3_CANONICAL_DATA.md) for the real table build, the [Part 4 split contract](docs/PART4_SPLITS.md) for leakage rules and storage setup, and the [research handoff](docs/RESEARCH_HANDOFF.md) for the literature and dataset review.
41+
See the [project tracker](docs/PROJECT_TRACKER.md) for current progress, the [project blueprint](docs/PROJECT_BLUEPRINT.md) for the full ordered build plan, the [local compute plan](docs/COMPUTE_PLAN.md) for the 350M-only hardware policy, the [Part 3 canonical-data guide](docs/PART3_CANONICAL_DATA.md) for the real table build, the [Part 4 split contract](docs/PART4_SPLITS.md) for leakage rules and storage setup, and the [research handoff](docs/RESEARCH_HANDOFF.md) for the literature and dataset review.
4242

4343
## Repository layout
4444

docs/COMPUTE_PLAN.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Local Compute Plan
2+
3+
## Active decision
4+
5+
The current project trains and evaluates **only**
6+
`LFM2.5-ModelRouter-350M`. Larger LFM variants are not part of the active MVP
7+
or its compute budget. They may be reconsidered only after the 350M research
8+
release is complete.
9+
10+
| Resource | Current plan |
11+
|---|---|
12+
| Query encoder scale | 350M parameters only |
13+
| Encoder candidate | `LiquidAI/LFM2.5-Embedding-350M`; pin the exact revision in Part 6 |
14+
| Primary accelerator | Local AMD Radeon RX 7900 XTX with 24 GB VRAM |
15+
| Host memory | Existing 16 GB RAM |
16+
| Cloud GPU | Fallback only; not the default training environment |
17+
| Default training mode | Frozen encoder with cached query embeddings |
18+
| Fine-tuning | Partial/full fine-tuning only as a later controlled ablation |
19+
20+
There is no RAM-upgrade requirement before development or training begins.
21+
The project will measure the real workload before recommending any hardware
22+
purchase.
23+
24+
## Why this is practical
25+
26+
The current canonical xRouteBench build contains 15,339 eligible queries and
27+
231,750 query/model outcomes. The 350M encoder processes each unique query
28+
once, and the resulting embedding is referenced by outcome rows rather than
29+
copied 18 times.
30+
31+
This design keeps both GPU and system-memory use bounded:
32+
33+
- Read Parquet in batches and select only required columns.
34+
- Cache one embedding per stable query ID.
35+
- Store outcome-to-query indices instead of repeated embedding tensors.
36+
- Begin with zero or one data-loader worker.
37+
- Use small GPU batches plus gradient accumulation when required.
38+
- Keep only the current and best checkpoint.
39+
- Avoid CPU or disk offloading unless a measured run requires it.
40+
41+
## Execution by project stage
42+
43+
| Project stage | Default compute |
44+
|---|---|
45+
| Part 5 baselines | Local CPU; GPU optional for small learned baselines |
46+
| Part 6 embedding cache | Local RX 7900 XTX |
47+
| Parts 7–11 model training and evaluation | Local RX 7900 XTX |
48+
| Parts 12–13 replay and online policies | CPU first; local GPU only for neural components |
49+
| Parts 14–15 external tests and ablations | Local GPU in queued, resumable runs |
50+
| Part 16 release verification | Local reproduction plus optional rented Nvidia cross-check |
51+
52+
## Hardware acceptance gate
53+
54+
When the RX 7900 XTX is installed, Part 6 must first run a bounded acceptance
55+
test:
56+
57+
1. Create a separate, pinned Python/ROCm environment.
58+
2. Verify that PyTorch detects the expected GPU and 24 GB VRAM.
59+
3. Load the 350M encoder and encode a small fixture.
60+
4. Benchmark 1,000 real canonical queries.
61+
5. Run 100 optimizer steps with backward propagation.
62+
6. Record peak VRAM, peak host RAM, throughput, temperature and failures.
63+
7. Extrapolate measured runtime before scheduling a full run.
64+
65+
The initial Windows route must follow AMD's current
66+
[PyTorch compatibility matrix](https://rocm.docs.amd.com/projects/radeon-ryzen/en/latest/docs/compatibility/compatibilityrad/windows/windows_compatibility.html).
67+
If a required training operation is unsupported, native Linux is the next
68+
local option.
69+
70+
## Host-memory rule
71+
72+
The existing 16 GB of RAM is accepted for Parts 5–6 and remains the default
73+
for later work unless measurements show a real problem. An upgrade is
74+
considered only after reproducible out-of-memory failures or sustained paging
75+
under the bounded loader design.
76+
77+
## Cloud fallback rule
78+
79+
A rented GPU is allowed only when one of these conditions is recorded:
80+
81+
- A required operation is unsupported by the validated local ROCm stack.
82+
- A deadline makes a long multi-seed queue impractical on one local GPU.
83+
- Final release verification needs an independent Nvidia/CUDA run.
84+
85+
Every cloud run must use the same repository command and saved configuration
86+
as the local run. Checkpoints and aggregate results are copied back before the
87+
instance and unused storage are deleted.
88+
89+
## Planning estimates
90+
91+
These are budgeting ranges, not claimed benchmark results:
92+
93+
| Work unit | Initial estimate |
94+
|---|---:|
95+
| Full embedding-cache build | 5–30 minutes |
96+
| One frozen-encoder router run | 20–60 minutes |
97+
| One LoRA experiment | 1–3 GPU-hours |
98+
| One full 350M fine-tuning experiment | 1–4 GPU-hours |
99+
| MVP experimentation through Part 10 | 20–50 GPU-hours |
100+
| Research campaign through Part 15 | 120–300 GPU-hours |
101+
102+
The acceptance benchmark replaces these ranges with measured estimates before
103+
we commit to the expensive experiment stages.

docs/PART3_CANONICAL_DATA.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
## Current status
44

5-
Part 3 is implemented and validated locally on the
6-
`codex/leakage-safe-splits` branch. The only remaining project-management gate
7-
is review and merge.
5+
Part 3 is complete. Its implementation and real-data validation were merged
6+
into `main` by
7+
[PR #7](https://github.com/MaharshPatelX/LFM2.5-ModelRouter/pull/7), with both
8+
Python 3.11 and 3.12 CI passing.
89

910
The builder reads the 41 pinned xRouteBench Parquet files from `data/raw/`,
1011
normalizes them into six versioned tables, validates the complete result in

docs/PART4_SPLITS.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
## Current status
44

5-
The reusable Part 4 engine is implemented on the
6-
`codex/leakage-safe-splits` branch. It now consumes the real Part 3 canonical
7-
tables and generates five leakage-safe xRouteBench manifests, a common
8-
deduplication manifest and an audit report.
5+
Part 4 is complete. Its reusable engine and real xRouteBench validation were
6+
merged into `main` by
7+
[PR #7](https://github.com/MaharshPatelX/LFM2.5-ModelRouter/pull/7). It consumes
8+
the Part 3 canonical tables and generates five leakage-safe xRouteBench
9+
manifests, a common deduplication manifest and an audit report.
910

1011
The pinned xRouteBench source schema does not contain query timestamps or model
1112
release dates. The temporal strategy therefore requires trustworthy provenance
@@ -128,6 +129,8 @@ forms 14,688 atomic clusters, including 435 clusters with multiple queries.
128129
Five real strategies pass their leakage checks. Temporal is the sole
129130
unsupported strategy because all 15,339 eligible queries lack `observed_at`.
130131

131-
## Remaining completion gate
132+
## Completion status
132133

133-
- Review and merge the pull request, then update the tracker to Done.
134+
The reproducibility and leakage gates pass, and the implementation is merged.
135+
The temporal limitation is a property of xRouteBench's missing source dates,
136+
not unfinished split-engine work.

docs/PROJECT_BLUEPRINT.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
**Project name:** `LFM2.5-ModelRouter` (selected)
55
**Primary checkpoint name:** `LFM2.5-ModelRouter-350M`
66
**Proposed paper title:** **LFM2.5-ModelRouter: Sparse Cold-Start Routing for Evolving LLM Portfolios**
7-
**Primary encoder:** `LiquidAI/LFM2.5-Encoder-350M`
7+
**Primary encoder candidate:** `LiquidAI/LFM2.5-Embedding-350M` (pin the revision in Part 6)
8+
**Active scale:** 350M only; larger model variants are future work
89
**Detailed research reference:** [`RESEARCH_HANDOFF.md`](RESEARCH_HANDOFF.md)
910
**Current progress:** [`PROJECT_TRACKER.md`](PROJECT_TRACKER.md)
11+
**Compute policy:** [`COMPUTE_PLAN.md`](COMPUTE_PLAN.md)
1012

1113
This document is the practical build order for the project. Each numbered part is a real system component or a required research stage. We will follow the parts in order and will not treat a later part as complete until its entry conditions are satisfied.
1214

docs/PROJECT_TRACKER.md

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
| Tracker summary | Current value |
44
|---|---|
55
| Last updated | 2026-08-21 |
6-
| Current phase | Part 3 implementation is complete locally; review and merge are next |
7-
| Core progress | 3 of 17 parts complete (Parts 0–16) |
6+
| Current phase | Part 5 — Baseline Suite is next |
7+
| Core progress | 5 of 17 parts complete (Parts 0–16) |
8+
| Active model scope | `LFM2.5-ModelRouter-350M` only |
9+
| Compute plan | Local RX 7900 XTX 24 GB VRAM with existing 16 GB RAM |
810
| Optional work | Part 17 is deferred until the MVP is complete |
911

1012
This file is the quick status board for the project. The
@@ -29,9 +31,9 @@ part's requirements and completion gate.
2931
| 0 | Project Contract and Scope | ✅ Done | Scope and research question are documented |
3032
| 1 | Reproducible Repository Foundation | ✅ Done | [PR #1](https://github.com/MaharshPatelX/LFM2.5-ModelRouter/pull/1) merged; CI passed |
3133
| 2 | Dataset Source Audit and Ingestion | ✅ Done | [PR #6](https://github.com/MaharshPatelX/LFM2.5-ModelRouter/pull/6) merged; pinned ingestion checks passed |
32-
| 3 | Canonical Data Layer | 🚧 **In progress** | Six real tables built and validated; review and merge are pending |
33-
| 4 | Deduplication and Leakage-Safe Splits | 🧩 **Partial** | Five real manifests generated; temporal is explicitly unsupported because source dates do not exist |
34-
| 5 | Baseline Suite | ⬜ Pending | Complete Part 4 first |
34+
| 3 | Canonical Data Layer | ✅ Done | [PR #7](https://github.com/MaharshPatelX/LFM2.5-ModelRouter/pull/7) merged; six real tables validated |
35+
| 4 | Deduplication and Leakage-Safe Splits | ✅ Done | [PR #7](https://github.com/MaharshPatelX/LFM2.5-ModelRouter/pull/7) merged; five real manifests plus an explicit unsupported-temporal artifact |
36+
| 5 | Baseline Suite | ➡️ **Next** | Implement simple and learned baselines on the Part 4 manifests |
3537
| 6 | LFM Query Encoder | ⬜ Pending | Complete Part 5 first |
3638
| 7 | Candidate Model Profile System | ⬜ Pending | Complete Part 6 first |
3739
| 8 | Multi-Outcome Predictor | ⬜ Pending | Complete Part 7 first |
@@ -45,36 +47,30 @@ part's requirements and completion gate.
4547
| 16 | Research Release | ⬜ Pending | Complete Part 15 first |
4648
| 17 | Later Extensions | 💤 Deferred | Consider only after the MVP release |
4749

48-
## Part 3 Local Completion Checklist
50+
## Merged Data Foundation
4951

50-
- [x] Define the six canonical table schemas.
51-
- [x] Build the canonical query table from pinned xRouteBench rows.
52-
- [x] Build the canonical model registry with stable IDs, families, and aliases.
53-
- [x] Build the outcome table with query/model references and preserved source fields.
54-
- [x] Build the price-history, probe-profile, and online-route-log schemas.
55-
- [x] Add understandable validation for required fields, ranges, IDs, and relationships.
56-
- [x] Add canonical Parquet writers and bounded JSONL debug exports.
57-
- [x] Add tested price recomputation from token counts and price snapshots.
58-
- [x] Save generated canonical data beneath ignored `data/processed/` storage.
59-
- [x] Pass every Part 3 completion gate in the project blueprint locally.
60-
- [ ] Review, open and merge the pull request before marking Part 3 done.
52+
- [x] Store real data in portable repository-local ignored directories.
53+
- [x] Build and validate all six canonical Parquet tables.
54+
- [x] Preserve stable IDs, raw fields, model aliases and price snapshots.
55+
- [x] Generate five real leakage-safe split manifests.
56+
- [x] Record temporal as unsupported instead of inventing source dates.
57+
- [x] Recreate all 21 generated artifacts byte-for-byte.
58+
- [x] Merge Parts 3 and 4 in PR #7 with Python 3.11 and 3.12 CI passing.
6159

62-
## Part 4 Prework Already Completed
60+
## Next Part Checklist — Part 5
6361

64-
- [x] Keep real data in portable, repository-local ignored directories.
65-
- [x] Support an optional external-storage override without hard-coded paths.
66-
- [x] Implement exact and normalized prompt hashing.
67-
- [x] Implement deterministic near-duplicate checks and audit counts.
68-
- [x] Implement source-ID and synthetic-lineage grouping.
69-
- [x] Implement model alias and family validation.
70-
- [x] Isolate complete probe clusters from final test traffic.
71-
- [x] Implement all six split strategies.
72-
- [x] Add deterministic manifests and a generated deduplication report.
73-
- [x] Add unit tests for reproducibility and leakage boundaries.
74-
- [x] Complete Part 3 canonical Parquet tables and JSONL debug exports locally.
75-
- [x] Document temporal as unsupported because the pinned source has no dates.
76-
- [x] Generate and validate real xRouteBench manifests in `data/processed/part4/`.
77-
- [ ] Merge the Part 4 pull request and mark Part 4 as done here.
62+
- [ ] Define one shared evaluation contract and candidate pool for every baseline.
63+
- [ ] Implement random, cheapest and largest/most-expensive policies.
64+
- [ ] Implement best-single-model and per-domain-best policies using only training data.
65+
- [ ] Implement best-quality and cheapest-successful oracle upper bounds.
66+
- [ ] Add logistic-regression, small-MLP and fixed-model-ID learned baselines.
67+
- [ ] Evaluate every method on the same Part 4 split manifest and price snapshot.
68+
- [ ] Save a baseline result table, quality-cost plot and oracle-gap report.
69+
- [ ] Add deterministic tests and a reproducible baseline command.
70+
71+
The [local compute plan](COMPUTE_PLAN.md) fixes the active scope at 350M and
72+
uses the incoming 24 GB RX 7900 XTX with the existing 16 GB of host RAM. Part 5
73+
remains CPU-first, so hardware arrival does not block the next implementation.
7874

7975
## How to Maintain This Tracker
8076

docs/REPRODUCIBILITY.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@
77
- Heavy ML dependencies will be added only after model and platform compatibility checks.
88
- CI runs formatting, linting, static types, tests, and package builds.
99

10+
## Local compute policy
11+
12+
- The active checkpoint scale is 350M only; larger variants are future work.
13+
- Part 5 is CPU-first.
14+
- Parts 6 onward use the local RX 7900 XTX with 24 GB VRAM when acceleration is needed.
15+
- The existing 16 GB of host RAM is the accepted starting configuration.
16+
- No memory upgrade is required without measured paging or an out-of-memory failure.
17+
- Cloud GPUs are a documented fallback, not the default environment.
18+
19+
The bounded smoke test, memory controls and cloud fallback conditions are in
20+
the [local compute plan](COMPUTE_PLAN.md). The exact ROCm, PyTorch and encoder
21+
revisions must be pinned only after the Part 6 hardware acceptance test passes.
22+
1023
## Configuration
1124

1225
Repository defaults live in `configs/base.toml`. Every experiment must save the fully resolved configuration used for the run.

0 commit comments

Comments
 (0)