PLAN: step 18, multi-GPU (layer split): what upstream has, what the setup/serve removal dropped, the work
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
a04434668e
commit
a9dd402f15
1 file changed
+1
@@ -322,6 +322,7 @@ Expected diff shape: removals dominated by `setup.py`, `serve/`, translations an
|
||||
| 15 | **Accuracy protocol against llama.cpp** (added 2026-10-18; extends step 12 with pass criteria). The reference is llama.cpp at the pinned commit, CUDA build, on the same GGUF. (a) Noise floor first: llama.cpp CUDA versus llama.cpp CPU on the same model and ids, per-position logits: max abs difference, KL(ref||other) per position, top-1 agreement. That floor is the tolerance, as the user put it: "as close as llama.cpp's GPU and CPU kernels are to each other". (b) Kernel level: upstream's parity programs that cover the kernels in use (step 11's list) at the pinned commit on each target arch, all green; the per-kernel error against the ggml reference recorded, not only pass/fail; target 1e-5 relative where the kernel is exact-arithmetic (norms, rope, residual), and the quant kernels within the floor from (a). (c) Logit level, teacher-forced: the engine's per-position logits along fixed ids (upstream's `--teacher-force` style diagnostics, `tools/canonical_xcheck.py`) against llama.cpp CUDA for Flash-Next IQ3_XXS and Qwen3.6 UD-Q3_K_M and UD-IQ4_XS: per-position KL median and p99, top-1 agreement rate, first position where the greedy argmax differs; 20 prompts of 512 to 4096 tokens including code and a tool-call transcript. Pass: median KL within 2x the floor from (a), top-1 agreement not below the floor's. (d) Perplexity on a fixed public text (a wikitext-2 slice, 64K tokens) engine versus llama.cpp CUDA: within 1 %. (e) Speculation is lossless: greedy ids with `--spec 0` equal to `--spec 4` and to the drafter off, for 20 prompts x 512 tokens; sampled with a fixed seed likewise. (f) Each speed knob upstream ships on by default that changes answers (`--tail-skip`, `STRATA_ROUTE_TAIL_SKIP`, int8 KV, `--spec-min-p`) measured off versus on with the (c) metrics, so the README states the accuracy cost of each default. (g) Long context: a needle test (`tools/needle_bench.py`) at 32K and the model's maximum, engine versus llama.cpp. Pass criteria written down before the runs | `bench/unbiased/correctness/<date>/` with the floor, every metric per model, the commands and the raw logits' checksums; `docs/MODEL-FILES.md` says per file: KL median and p99 against llama.cpp, top-1 agreement, PPL ratio |
|
||||
| 16 | **Front-end equivalence to upstream's Python server** (added 2026-10-18; the part of the port that is not the engine). (a) Prompt rendering: a corpus of chat requests (system prompt, multi-turn, tools with optional arguments, tool results, `reasoning_content` on assistant turns, `enable_thinking` on and off, `preserve_thinking`, an image once step 8 lands) rendered by upstream's jinja2 path and by llama.cpp's template engine in the fork: the token id sequences must be identical, per model template. A difference changes what the model sees and breaks checkpoint reuse. (b) Output parsing: a corpus of raw model outputs (tool calls in both argument orders, parallel calls, reasoning blocks, truncated streams) parsed by upstream's per-family parsers and by llama.cpp's: same `tool_calls`, same `content`, same `reasoning_content`. (c) Streaming equals non-streaming: for the same seed, the concatenated deltas equal the non-streamed message, usage counts equal the engine's `DONE` counts. (d) API conformance: the HTTP-level tests of upstream's `serve/` (import commit, 58 files) that apply to the kept surface, ported to run against both servers; cancel and disconnect semantics (the engine is told to stop; the next request is clean) on both. (e) Task level: pi on 10 fixed coding tasks x 3 runs per server, pass rate and tokens per wall second; within noise | corpora and results under `bench/unbiased/frontend-equivalence/`; a rendering or parsing difference is a bug in the fork unless upstream is shown wrong, with the request that reproduces it |
|
||||
| 17 | **Release gate** (added 2026-10-18). Steps 12 to 16 green or every open finding written in `README.md` with its size; the acceptance suite (13) run on every file on at least one card; `UPSTREAM.md` current; a tagged commit with the `bench/unbiased/` directories it was judged on | the tag; the README's measured table cites only those directories |
|
||||
| 18 | **Multi-GPU** (added 2026-10-19, user priority after the correctness work). Upstream runs one model across several cards as a layer split (`docs/MULTI_GPU.md`): `strata` (Flash-Next) with `--layer-split`, `--split-device`, `--split-skip-if-fits`, the chunk pipeline, `--pipeline-windows` and the `STRATA_SPLIT_*` variables; `strata-poly` with `--layer-split auto|N[,N...]` across the cards `CUDA_VISIBLE_DEVICES` shows it (two RTX 3080 measured upstream for Qwen3.6, Gemma 4, GLM REAP50; two cards hold about twice the experts, decode and prefill gain follow from that). The engines' code is unchanged in this fork, so the capability is intact; what went with `setup.py` and `serve/` (UPSTREAM.md, Removed) is the glue: card detection and the `--gpus 0,1` choice, the run-config `"gpu"`/`"layer_split"` fields, putting the faster card last, `--calibrate` setting `--prefill-pipe`, and `tools/batch_test.py`'s config-driven `--layer-split`. Nothing in the fork has exercised a split yet; the first run is the 2x RTX PRO 6000 pod (DeepSeek V4 Flash UD-Q4_K_XL / UD-Q8_K_XL, `tools/pod/serve.sh deepseek-q4|deepseek-q8`, `--layer-split auto`). Work: (a) README Run section documents `CUDA_VISIBLE_DEVICES` plus `--layer-split` for both engines as the replacement for `--gpus`, including the faster-card-last rule; (b) the front end passes the environment through untouched and `/props` or the log says which cards and layers each stage took; (c) measured: one card vs two, same model and workloads as step 14, on the 2-card pod for strata-poly (DeepSeek, GLM) and, when a 2-card 24 GB-class box exists, Flash-Next with `strata`; (d) correctness: the step-12 arms (T1/T2 against llama.cpp, T0 base vs draft) on the split, since upstream notes the rounding changes with which card or the CPU computes an expert; (e) upstream's layer-split parity and gate programs that still build, run and recorded | `bench/unbiased/multi-gpu/<date>-<box>/` tables with the split chosen per cell and the engine log lines naming each card's layers; README section with the flags and the measured rows; any divergence a finding with the inputs that reproduce it |
|
||||
|
||||
Steps 14 to 17 (2026-10-18) are the ship bar for consumers of PolyStrata: as fast and as accurate as upstream within
|
||||
5 % on decode and prompt processing, kernels within 1e-5 where exact and otherwise within the spread between
|
||||
|
||||
Reference in new issue
Block a user