interplane.Get Omega
Read in your language

gpu-head-to-head

aien-dev/gpu-head-to-head

Brought by drakestapleton

branch main Branches Tags History

gpu-head-to-head / PROTOCOL.md

466 lines · 35798 bytes Raw Blame History Source

PROTOCOL: same-machine head-to-head, Qwen3.6-35B-A3B on one DGX Spark (bar P0)

Predeclared before any timed run. This file is committed and pushed before the first arm starts; any later change to it is a separate, dated commit listed in section 10, and results say which protocol commit they were taken under.

1. Question

On one DGX Spark (GB10, sm_121, driver 580.173.02, 121 GiB unified LPDDR5x), serving the same model to the same prompts over the same HTTP API, how do three stacks compare end to end?

Every number in this repo is end to end: an HTTP client on the same host, timestamps taken in the client. **No chip-only number (kernel time, GPU timer, per-launch microbenchmarks) appears in the results table.** Numbers from other repos are not mixed in.

2. Model and weights

3. API and request shape (identical for all arms)

POST /v1/chat/completions, one user message, stream: true, stream_options.include_usage: true, temperature: 0, top_p: 1, seed: 0, chat_template_kwargs.enable_thinking: false (OURS also runs --thinking off). The client is bench/bench.py (Python 3 stdlib, http.client, one thread per stream, a barrier releases concurrent streams together). One JSON row per request is written to results/raw/.

Timestamps (client time.monotonic()): t_send before the request is written; t_first at the first SSE chunk carrying non-empty content or reasoning_content; t_last at the last such chunk. Token counts come from the server's usage (prompt_tokens, completion_tokens). If an arm reports no usage, the count is re-derived by tokenizing the returned text with the checkpoint's tokenizer.json and the row is labeled count=retokenized.

4. Prompts (prompts/, generated by bench/make_prompts.py, committed before runs)

5. Metrics

IDMetricCellDefinition
M1TTFTdecode c=1t_first - t_send, short prompt
M2decode tok/s, 1 streamdecode c=1, max_tokens 256(completion_tokens - 1) / (t_last - t_first)
M3decode tok/s at 4/8/16 concurrentdecode c=4/8/16, max_tokens 256per batch: aggregate = sum(completion_tokens) / (max(t_last) - min(t_send)); also per-stream M2
M4prefill tok/s at 256/2k/8kprefill, max_tokens 1, nonce prefixprompt_tokens / (t_first - t_send) (end-to-end: includes HTTP, template, tokenizer, first sampled token)
M5peak memorywhole arm sessionMemAvailable(baseline, before launch) - min(MemAvailable during session) from /proc/meminfo at 1 Hz; plus peak summed VmRSS of the server process tree (host-side view; on GB10 device allocations are system memory)
M6output agreementagree c=1, 16 prompts, max_tokens 128per prompt, tokenize both outputs with tokenizer.json; matched = common-prefix length; rate = Σ matched / Σ max(len_a, len_b); also count of byte-identical outputs out of 16; pairs OURS–VLLM, OURS–LLAMA, VLLM–LLAMA; plus within-arm R1 vs R2

A nonce line (Request id <uuid>. Ignore this line.) is prepended to every prefill prompt so that no arm's prefix cache can hit. Decode prompts carry no nonce (they are short; prefix caching of 40 tokens does not change decode rate; TTFT on a repeated short prompt is labeled as such in M1).

Concurrency is what the arm is configured for as deployed: OURS runs the live --batch-slots 8. At c=16, OURS refuses requests beyond 8 with HTTP 503 server_busy ("retry shortly"); the client retries those every 50 ms with the clock running from the first send (amendment A1), and the retry count is stored per row. That is part of the end-to-end result and is stated beside it.

6. Arm configuration

7. Schedule, repetitions, statistics

8. Load and GPU-lock gates

9. Publication

Everything is published even if OURS loses: results/RESULTS.md (table), results/raw/*.jsonl (every request row incl. warmups), results/logs/ (server stdout/stderr, memory samples, BOARD lines, versions), bench/ (exact commands). Evidence label of every number: MEASURED, end to end, on this one Spark, on the stated date and load.

10. Amendments

A8 (2026-10-29, before resumed 35B timing): external measurement integrity

Numbered A8 and A9 because A6 is the llama.cpp methodology amendment on branch results/2026-10-27-a6 and A7 is the cold-start study above.

Drake clarified that Aien architecture and structural implementation stay Python-free, while external testing equipment, independent references and calculations may use Python, with Wolfram preferred for calculations. These host measurement tools are external equipment; this amendment introduces no Python production dependency.

The legacy 35B runner could return success after a failed client, a missing foreign-process monitor summary, an exhausted disturbed-cell retry, or a session timeout. Its Python client also returned zero after failed HTTP requests and accepted truncated streams. Synthetic regressions reproduced these paths before the fixes. New resumed runs use the following controls:

CPU-only controls: python3 bench/test-run-arm.py, python3 bench/test-bench-python.py, and python3 bench/test-extract-admission.py; shell syntax: bash -n bench/run_arm.sh. This fixes acceptance/reporting defects only. The runner's shared-model coordination, lifecycle, current source/weight verification and resumed 35B execution still require qualification before use. The active 9B campaign uses frozen instruments recorded in its own manifest and is unchanged.

A9 (2026-10-29, before resumed 35B timing): owned-process lifecycle

The external runner now sources bench/session-lifecycle.sh. It tracks child process identities using Linux /proc/<pid>/stat starttime, rechecks identity before signaling, snapshots descendants, waits for children, and refuses untracked or stale live process identities. A pid whose /proc entry is already gone was reaped by the shell and is not waited for again: Bash 5.2 wait on it from the EXIT trap that interrupted the client wait (the watchdog's TERM) blocked forever. It no longer searches process command lines to decide which server to stop or count for memory. Native server identity is published to the sampler because a sampler started before launch cannot see later shell-variable updates; container memory sampling includes the owned container root and descendants.

Each container has a unique session name and aien.stack-comparison.run ownership label. Creation completes before docker start --attach; missing images are refused with --pull never. Shutdown checks the label before stopping a container. The historical shared container names are unused.

EXIT, INT and TERM enter one cleanup path for the client, monitor, server, watchdog and samplers. The client runs as a tracked child so the parent can interrupt its wait. The watchdog warns at 55 minutes from GPU-lock acquisition and ends request execution at 59 minutes, reserving the last minute of the original 60-minute limit for cleanup. Cleanup gives process waits a shared 30-second budget, bounds container stop and GPU inventory commands, and removes DONE on failure. These are host-exercised controls; an actual model/session and unload-baseline qualification remain required.

Before model launch, the GPU inventory must be empty. The runner itself never stops the shared 18091 model; the authorized exclusive-window controller must check activity, stop it only when idle, and restore its exact configuration afterward. H2H_GPU_LOCK_FD=9 permits that controller to lend the already-open GPU-lock descriptor. The runner checks its path and acquires it nonblockingly; cleanup preserves a borrowed lock so the controller can retain exclusivity through restoration. A standalone runner releases only its own lock.

CPU-only controls: python3 bench/test-run-arm-lifecycle.py, plus the A8 controls. Tests cover foreign container refusal, labeled owned launch, create failure, normal/failing/interrupted exits, watchdog interruption, stale/untracked process refusal, descendant shutdown, termination-resistant children, sampler identity and parent-versus-child lock ownership. No GPU, real model or real container is used by these controls. The active frozen 9B campaign is unchanged. Source and runtime pins, the shared-service controller, unload/memory evidence and full 35B execution remain separate requirements before this runner is used for the larger-model comparison.

A10 (2026-10-31, before DRA-74 35B timing): comparator arms, TTFT rows, window sessions

Arms. bench/arms.conf declares every comparator arm; run_arm.sh hashes it into driver-sha256.txt, so the record carries the exact hooks.

Cell sets. H2H_CELLS is a comma list without duplicates, so one model load can serve several sets:

TTFT rows. prompts/ttft.jsonl (sha256 348c36ec…2f0e59) is generated by bench/make_ttft_prompts.py. The generator pins its sources by sha256 and exits 2 on a mismatch.

Session control.

These numbers are HTTP-only (client-side t_send, t_first, t_last) and are never placed beside chip-only measurements.

Named limit: DRAM GB/s. The DRA-74 acceptance item "DRAM GB/s per arm" is NOT_RUN-able on this host as configured.

Not yet verified on the chip: whether vLLM prefix caching hits on this hybrid DeltaNet model (the /metrics capture will show it), and whether OURS accepts a multi-turn chat that includes an assistant message.

CPU-only controls: python3 bench/test-run-arm-dra74.py, python3 bench/test-ttft.py, python3 bench/test-nsys-classify.py and node bench/test-bench-node.mjs, plus the A8 and A9 controls. They use fake servers and fixtures and never touch a GPU, model or container.