Repository navigation
tools: served gates prove they ran: drafts landed, the sampler and the cache were used, requests overlapped - #3708
Conversation
|
Thanks @jschmied. The new fault controls make the gate changes clear, and the tooling changes look sound. One thing before landing: the new The supplied device results and their stated failures stay separate from this.
|
|
Thanks @jschmied. The watched partner window is now 60 ms, the census wait is 500 ms, and the unsampled test still requires exactly its two named failures. Please resolve fake_served_api.py against main’s FixtureHTTPServer while preserving its backlog, then post the Windows benchmark-clients result on that rebased head.
|
|
@ashhart Rebased onto main
The third red line on Windows was
Only the fake changed since |
|
Thank you @jschmied. The fake now uses main's FixtureHTTPServer with its backlog, the partner window explains the Windows-only third line, and the seed test still requires exactly its two named failures. The Windows and Ubuntu benchmark-clients runs are green at this head. Nothing further is needed from you on this PR.
|
…e cache were used, requests overlapped A gate that compares two replies passes vacuously when the property it names never ran. serve_check.py's resumed == fresh still never asserted the resumed turn cached anything (Qwen 3.5 keeps prompts from 4,096 tokens; its chat was 23-201), and the kit, lfm3's serve_check and qwen27's HTTP gate had the same gap for drafts, sampling, overlap or empty replies. Each check now fails by name when its property was not exercised. - conformance: a reply without a token is unverified (two empty replies hash the same); drafted == plain needs a draft accepted in each mode and none drafted by the plain replies; repeat asks a sampled prompt with the next seed and needs a different reply; concurrent polls GET /v1/load during each batch and needs two chat requests open at once, and at each level drafted rows that accepted and plain rows that drafted none. - zig/tests/qwen35/serve_check.py: compares token_sha256 (reasoning included, empty never equal); drafted == serial needs drafts accepted and none in plain; t0.8 must differ from greedy; the resumed turn must resume tokens, and its first turn carries a 900-item document so a healthy Qwen 3.5 server does. - tools/lfm3/serve_check.py: drafts/exercised and sampled_*/sampler_ran (tensorfold.sampling == "exact"). - tools/zig/qwen27_http_gate.py: a drafted reply must accept a draft, not only propose one. - The fake served API gains the faults undrafted, plain_drafts, sampled_drafts, unsampled, serial and empty; each new test is red on main's scripts and green here (test_bench*.py, found by no-gpu.yml).
…s counts them On windows-latest every gate test failed concurrent == solo: 1 to 4 of 16 batches never showed two chat requests open at once. A request that found a partner stayed open a fixed 25 ms, and there a GET /v1/load read can take longer than that, so the census missed the overlap. It now stays open until a census counts two open at once (at most 2 s). With census reads slowed to 30 ms the old fake fails the clean run and the new one passes at 100 ms.
At 2b7a41c every pair waited up to 2 s for a census, also in the serve_check and lfm3 tests, which send requests together without reading one; both benchmark-clients jobs passed the 5 min limit. A pair now waits to be counted only while a census was read in the last 0.25 s (and at most that long); otherwise it stays open 25 ms as before. The listen backlog is main's FixtureHTTPServer (ba970d9).
…uest's partner windows-latest at 72b7117 still saw 1 to 3 of 16 concurrent batches never open two requests at once. The threads a batch releases together can start a scheduler tick apart there (about 16 ms), past the fake's 10 ms partner window, so a pair never formed. Staggering each post by 0 to 30 ms reproduces it on macOS (1 of 16, same line). While a client polls the census (two reads within 0.1 s, the last that recent) a request now waits 60 ms for a partner; elsewhere it waits 10 ms as before, and a counted pair waits at most 0.5 s. Posts staggered 0 to 50 ms: the clean gate run passes 3 of 3. Full test_bench* set merged with main 2a674b5: 199 OK in 177 s (157 s at 72b7117).
|
Thank you @jschmied. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
Head:
e4ab4bdebbon maine3fb56cb09. Follows #2460 (comments 6711746590, 6716617133).Since
47a72d569e, onlytools/tests/fake_served_api.pychanged: the fake now forms its concurrent pairs on Windows too, and it keeps main'sFixtureHTTPServerbacklog. The device results below were taken at47a72d569e, and none of the gate or client code they ran has changed since.benchmark-clientspasses at this head on windows-latest (199 tests, 194.6 s) and on ubuntu-latest (199 tests, 170.1 s), run 44439156164.What was vacuous
A gate comparing two replies passes without testing anything when the property it names never ran.
zig/tests/qwen35/serve_check.pyresumed == fresh is still vacuous on CUDA at main.core/prompt_rules.zig:12).sameand serve_check's content compare hash "" == "".qwen27_http_gatenever counted accepted drafts."draft": falseis ignored, both arms draft and drafted == plain compares drafted against drafted. Nothing checked for this.The full audit covers every gate in scope and 18 more served or host scripts, with file:line and a verdict per gate. The fixes here are limited to the kit and the gates it replaces (list below); the rest are follow-ups.
The fixes
Each check fails by name when its property was not exercised.
tools/conformance.py:GET /v1/loadevery 5 ms during each batch:http_active.chat_completions >= 2;The census is
conformance_lifecycle.census, shared rather than copied.zig/tests/qwen35/serve_check.py:token_sha256(reasoning included; a reply with no tokens equals nothing);--context 8192or more.tools/lfm3/serve_check.py:drafts/exercised: accepted > 0 over the drafted requests and 0 drafted on the plain ones;sampled_*/sampler_ran:tensorfold.sampling == "exact".tools/zig/qwen27_http_gate.py: a drafted reply must accept a draft, not only propose one.Planted controls (red on main, green here)
The fake served API gains six faults, each named for the gate it turns red:
undrafted,plain_drafts,sampled_drafts,unsampled,serialandempty. The new tests aretools/tests/test_bench_{conformance,serve_check,lfm3_serve_check,qwen27_http_gate}.py, which thetest_bench*.pyline inno-gpu.yml:37finds, so the workflow is unchanged.test_bench_conformance9 failures and 3 errors (the drafted gate's new signature);test_bench_serve_check5 of 5 fail; lfm3 3 of 3; qwen27 HTTP 1 of 2undraftedandplain_draftsalso redden concurrent, where batched rows draft;unsampledalso reddens resumed, because only the cached fake carries the fault.On the GB10
main's native binary (
038e4a2787, md5caa8ca7c, CUDA sm_121) with this head's tools. The receipts are in the author's ledger.qwen35-cuda(Qwen3.8-27B NVFP4 + DFlash2): 7 passed, 0 failed.gemma4-cuda(Gemma 4 31B 4-bit + DFlash): 7 passed, 0 failed.serve_check.py, this head, against a cached server and a--prompt-cache-gib 0server, both--context 16384 --parallel 8: 15 of 15 ok.cached_tokens: 4096.serve_check.py, on the same two servers: also 15 of 15 ok, but its resumed == fresh passes withcached_tokens: 0. That is the vacuous pass, reproduced live.Metal (M3 Pro 36 GB, mac-agent)
Server binary main
038e4a278; this PR's tools (47a72d569) against main's tools, on the same server.qwen27-metal(Qwen3.8-27B MLX 4-bit + DFlash), same result with both tools:--parallel 1, where requests queue.[86,175,87,174].[0,175,87,0])./v1/loadshowed running 1, waiting 22 (memory_pressure 21), everyhttp_active0. It was still 15 waiting 70 s later.qwen27_http_gate: this branch 16/16 PASS, every drafted row accepted (153 to 216 drafts). Main's gate is also 16/16. Inputs: ids from/v1/tokenize; CLI receipts fromtf-qwen27-dflash-run --prototype q4 --compare-plain, where 4 of 4 drafted runs equal plain and the final state is equal.Not run here
lfm3-1.7b-baseis bf16 (UnsupportedLfm3Quantization), andlfm3-vl-2b-4bitneeds the stacked vision contribution. Both tools fail the same way at server start.Follow-ups, not in this PR (from the audit)
flashnext_constraint_gate.py: draft counters and the two seeds are unchecked (Metal).clef_head_gate.py compare: passes with 0 logits. It needs numpy, which CI lacks.xpu_draft_receipt.py: prints FAIL but exits 0.structured_served.py,vision_served.py,video_served.py: drafted == plain compares content only.reuse_served.py: cancel is unchecked.image_cache_turns.py: reuse never assertscached_tokens.bench_concurrent.py --serial/--alone: a reporter with no draft or overlap evidence.Proposed CHANGELOG line (for you to place):
- Tools: served gates fail by name when the property they compare never ran: the conformance kit, serve_check.py (Qwen 3.5 and LFM3) and qwen27's HTTP gate now require landed drafts, a plain arm without drafts, a sampler the seed reaches, overlapping requests, a resumed turn that resumed tokens, and replies with tokens (#2460).No refusal changes; no speed claims; tools and tests only.
CI time: the bench tests take 185 s here against 121.5 s on main. Scaled from main's last CI run (an estimate, not measured), the Windows job would land near 4:20 of its 5-minute limit. If that is too close, I can split the new fault tests into their own step.