Skip to content

Admit concurrent Liquid requests within a full-context RAM budget - #16

Merged
araysuter merged 7 commits into
mainfrom
asher/codex/liquid-ram-admission
Nov 19, 2026
Merged

araysuter merged 7 commits into
mainfrom
asher/codex/liquid-ram-admission

Conversation

@araysuter

@araysuter araysuter commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

What this changes

Liquid requests can share one qualified native engine, up to eight users, while the gateway reserves each admitted user's remaining full-window growth and leaves an 8 GiB host reserve. RAM refusals return 503/insufficient_memory; an occupied slot ceiling returns 429/concurrency_limit. Cancelling one stateless request closes only its native connection. Existing Swift/Arete snapshot profiles retain serialized requests, model switching and the four-context global LRU. The listener backlog now accepts eight-client bursts without the old five-socket connection resets.

  • Issue: n/a; issues are disabled in this fork. This is the owner's requested Studio deployment, not an upstream competing claim.
  • Stacked on: main at 0c589e6, synchronized in Bring current TensorFold concurrency improvements into the Studio fork #15.
  • ATC overlap: run again after the main integration; incomplete because of PR/file/time limits, no conflicts reported in available coverage. Manual inspection found older fork PRs 5–11 already ancestral to main and no intersecting gateway changes. This is not a claim of complete automated coverage.

Checks on this head

  • Head: ae182bb.
  • Lean: same checker on base and head, 221 inherited findings each, zero new. PR pre-flight: zero errors/warnings. git diff --check passed, including generated SVG cleanup.
  • Gateway: python3 -m unittest discover -s tools/studio-gateway/tests -v — 67 passed after integration with current main. Benchmark client: python3 -m unittest discover -s tests -p test_studio_concurrency_bench.py — 2 passed. Later changes are receipt/docs only.
  • Negative controls: the eight-socket backlog fixture fails with TimeoutError before the backlog fix and passes after; benchmark mismatch/refusal controls return nonzero; RAM, cancellation, slot limit and cohort-footprint fixtures cover the admission behavior.
  • CI: no check runs published for the fork head at inspection; not reported green.
  • Not run: whole desktop/mobile application suite and other-chip qualification; Python gateway changes do not replace their native engines. Liquid uses a separately pinned experimental runtime rather than merging an incompatible old DSpark core into current main.

Receipt

  • Environment: Apple M5 Max, 64 GiB; Liquid MLX Q4 target 667408d494bde191c2cb9dd4f4549827816b9275, DSpark e052e5b1dd103c38cdd4f8ddc068d7dea4586f55 quantized to 8-bit at load. Native runtime 2d5af28, Zig 0.17.0, Metal/Xcode. Gateway executable code qualified at f9f3667; later commits add reproducibility docs and measurements only.
  • Runtime provenance: upstream DSpark lfm2: DSpark drafting with owned context and confidence scheduling ashhart/TensorFold#1394 plus family chunked prefill from lfm2_moe metal: prefill runs a chunk a call, so a new prompt no longer stalls other streams' rounds (#3021) ashhart/TensorFold#3058; an explicit owned-feature opening order fixes cold first-request taps. Other providers keep their existing order. 692/693 scoped native tests passed, one skipped; known golden differences remain classified. No GPU kernel, arithmetic or precision changes. Cold-opening regression fails before its ordering fix and passes after.
  • Paths/platforms: text completions through the concurrent gateway; existing snapshot profiles have gateway unit coverage. M5 Max Metal device tested; M1–M4, CUDA, HIP and Windows device runs not performed.
  • Exactness: 24 solo/plain references; all 44 completed drafted matrix replies matched their reference token hashes. One request in the 4K/eight-user burst was correctly refused by RAM admission, so that cell is 7/8 and the client exited 2. Eight users completed at 8K and 32K with overlapping decode intervals. This is not an all-cells-admitted claim.
  • Capacity: final runtime completed eight distinct 95,000-input/64-output requests, hashes equal to the previous whole-prefill baseline. Sampled peak engine footprint 28.8 GiB; at least 18.3 GiB available; unchanged swap during that capacity run. It does not prove eight idle full histories are retained after completion.
  • Cancellation: cancelling one real stream preserved its peer and subsequent recovery.
  • Admission: conservative configuration probe admitted two users and rejected the third with 503/insufficient_memory, then recovered, without swap growth. Probe budget 11.504 GiB/user; deployed profile budget remains 2.875 GiB/user.
  • Failed stress scope: a separate artificial host-buffer allocation probe grew swap by about 1.2 GiB before the watchdog stopped its native process and released buffers. Retained as a failed attempt, not a no-swap success. Admission cannot prevent unrelated applications from allocating after admission.
  • Speed: at 32K/eight users, whole-prefill baseline 11.9 median output tok/s/user and 54.0 aggregate; stepped final 27.2 and 64.5. Solo approximately 157–211 tok/s output; group cold prompt throughput approximately 6.7K–8.6K tok/s. Single synthetic trials, 256 outputs, cache disabled; not quality or universal throughput claims.
  • Raw rows/hashes, baseline, capacity/admission receipts, CSV and regeneratable graphs: receipt. Pinned runtime/profile guide.
  • New weights/licence: n/a; no weights added or redistributed by this PR.

Checklist

  • Title, source pins, receipt and stack match this head.
  • New tests include failing-before/passing-after and nonzero negative controls.
  • No credentials, private hosts, machine paths or AI attribution added.
  • No precision trade; completed concurrent results equal plain solo tokens.
  • Failed/refused cases and platform gaps are explicitly retained.
  • All native paths/platforms and every stochastic sampling mode qualified: not claimed; this deployment is the recorded M5 Max scope.

Production deployment

Merged and deployed from main d0435f8. Public API qualification passed: all three model IDs, invalid-key rejection, prose token equality to the previous DSpark reference, streaming/non-streaming required tool calls, tool-result continuation and Swift → Arete → Liquid switches. Swift/Arete remain at 131072 total tokens and one active request; Liquid advertises 96000 total tokens and max_concurrent=8. Health ended idle with one Liquid process loaded. Swap was unchanged during deployment (2560.88 MiB before and after; the earlier failed host-stress increase remains explicitly documented). Private rollback config/launcher copies are retained outside the repository.

@araysuter araysuter changed the title Admit concurrent model requests within a per-profile RAM reserve Admit concurrent Liquid requests within a full-context RAM budget Nov 19, 2026
@araysuter
araysuter marked this pull request as ready for review November 19, 2026 01:26
@araysuter
araysuter merged commit d0435f8 into main Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant