Skip to content

Commit 537c32c

Browse files
Merge pull request #9 from MaharshPatelX/codex/staged-gpu-validation-workflow
docs: define staged CPU-to-GPU validation workflow
2 parents e5f9f97 + 0e9debf commit 537c32c

2 files changed

Lines changed: 80 additions & 2 deletions

File tree

docs/COMPUTE_PLAN.md

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,82 @@ This design keeps both GPU and system-memory use bounded:
4747
| Parts 7–11 model training and evaluation | Local RX 7900 XTX |
4848
| Parts 12–13 replay and online policies | CPU first; local GPU only for neural components |
4949
| 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 |
50+
| Part 16 release verification | Local reproduction plus optional rented NVIDIA cross-check |
51+
52+
## Staged engineering workflow
53+
54+
GPU-dependent work has three separate states. They must not be treated as the
55+
same thing:
56+
57+
| State | Meaning | Evidence |
58+
|---|---|---|
59+
| Implementation ready | Interfaces and code exist and pass CPU tests on tiny deterministic data | Unit tests, type checks and a CPU smoke command |
60+
| Hardware validated | The same code completes bounded forward and backward work on the RX 7900 XTX | Recorded device, software revisions, memory, throughput and 100-step result |
61+
| Experiment complete | The real configuration finishes on the intended split and saves reproducible artifacts | Resolved config, checkpoint, metrics, hashes and run report |
62+
63+
A GPU-dependent project part cannot be marked **Done** from CPU tests alone.
64+
CPU tests let development continue before the GPU arrives; the hardware and
65+
experiment gates still have to pass later.
66+
67+
## What can be implemented before GPU validation
68+
69+
| Part | Safe work before the GPU arrives | Work that still requires real validation |
70+
|---:|---|---|
71+
| 5 | Complete all baseline policies, metrics and CPU tests | Optional acceleration only |
72+
| 6 | Encoder interface, device configuration, cache format and CPU smoke test | ROCm loading, VRAM, throughput and backward pass |
73+
| 7 | Profile schemas, encoders and tests with synthetic embeddings | Neural-profile training at real scale |
74+
| 8 | Prediction heads, losses, masking, trainer and tiny-data tests | Full training, calibration and tuning |
75+
| 9 | Complete registry, constraints, price logic and optimizer on CPU | Performance check with real predictions |
76+
| 10 | Evaluation metrics, artifact writers and figure code | Reports from trained checkpoints |
77+
| 11 | Cold-start protocol and leakage assertions | Held-out-model training runs |
78+
| 12 | Complete deterministic replay simulator on CPU | Scale and performance checks |
79+
| 13 | Bandit interfaces, budget controller and synthetic replay tests | Neural-policy and long replay experiments |
80+
| 14 | Adapter contracts after each source/license audit | Real external evaluation |
81+
| 15 | Ablation scheduler, seed handling and statistics code | Multi-seed experiment campaign |
82+
| 16 | Release templates and reproducibility command | Final claims, figures, model card and weights |
83+
84+
This table authorizes scaffolding and bounded tests, not one giant unvalidated
85+
implementation. Later interfaces should be built only after the earlier
86+
contract they consume has stabilized.
87+
88+
## Validation ladder
89+
90+
Every learned component advances through the same sequence:
91+
92+
1. Validate configuration and schemas without loading a model.
93+
2. Run deterministic unit tests using tiny fixtures or synthetic embeddings.
94+
3. Run one CPU forward pass.
95+
4. Run one training batch and verify finite losses and gradients.
96+
5. Run the RX 7900 XTX hardware acceptance test.
97+
6. Run 100 optimizer steps and verify memory remains bounded.
98+
7. Run one complete epoch with checkpoint/resume enabled.
99+
8. Run the full configuration, then multi-seed and ablation jobs.
100+
101+
A failure returns to the smallest stage that reproduces it. Expensive runs do
102+
not begin while a cheaper stage is failing.
103+
104+
## Device-neutral code rules
105+
106+
- Select `auto`, `cpu` or `cuda` through configuration; do not scatter device
107+
checks throughout model code.
108+
- Do not hard-code NVIDIA-only package imports in shared modules.
109+
- Keep dtype and mixed-precision policy in one runtime configuration.
110+
- Make CPU fixtures small enough for normal CI.
111+
- Use fake embeddings to test downstream model logic without loading LFM.
112+
- Save optimizer, scheduler, scaler, seed and data position for resumable runs.
113+
- Log the physical GPU name, driver, ROCm, PyTorch and model revisions.
114+
- Keep correctness tests separate from throughput benchmarks.
115+
116+
## Immediate pre-GPU sequence
117+
118+
The GPU arrival does not justify building Parts 5–16 in one untested change.
119+
The immediate order is:
120+
121+
1. Complete Part 5 end to end on CPU.
122+
2. Define Part 6's encoder interface, revision-aware cache and device contract.
123+
3. Add CPU fixtures and the bounded hardware-acceptance command.
124+
4. Validate the interface on the RX 7900 XTX when it is installed.
125+
5. Continue to Part 7 only after the Part 6 contract and artifacts are stable.
51126

52127
## Hardware acceptance gate
53128

@@ -80,7 +155,7 @@ A rented GPU is allowed only when one of these conditions is recorded:
80155

81156
- A required operation is unsupported by the validated local ROCm stack.
82157
- A deadline makes a long multi-seed queue impractical on one local GPU.
83-
- Final release verification needs an independent Nvidia/CUDA run.
158+
- Final release verification needs an independent NVIDIA/CUDA run.
84159

85160
Every cloud run must use the same repository command and saved configuration
86161
as the local run. Checkpoints and aggregate results are copied back before the

docs/PROJECT_TRACKER.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,6 @@ remains CPU-first, so hardware arrival does not block the next implementation.
8080
4. Add the merged pull request link in the evidence column.
8181
5. Move **Next** to the following part in the same tracker update.
8282
6. Update the date and progress count whenever a status changes.
83+
7. For GPU-dependent parts, distinguish implementation-ready code from
84+
hardware-validated and experiment-complete work using the
85+
[staged engineering workflow](COMPUTE_PLAN.md#staged-engineering-workflow).

0 commit comments

Comments
 (0)