Repository navigation
[Engine] Add bounded protected Flash Next extraction execution - #1
Merged
Merged
Conversation
…(bench: down 18.7->10.3 us, fc 29.3->16.4, akp 8.2->4.1, o 12.4->8.2, qkv 11.9->9.5; 184/184 bitwise)
…), app label test
… keeps vision on, no reader device choice, a pack without the tower offers the missing shared file); load applies the --vision pair
… E26) is opt-in on AMD (STRATA_PCIE_START=new); CUDA keeps it by default. It flipped near-tie tokens in the first ~50 windows after a start on the R9700 for +-1%, the only default that made merged-with-the-other-defaults-off differ from v0.2.9 there (p620, G2: 21/45 -> 45/45 identical serve answers with the old start)
…t 17); one warp a row (28) is best on a 188-SM card but 10-35% slower than 17 on l620's 110 SMs
…calibration texts) and tests
…e process, CPU tests, two data files, LICENSE and NOTICE
…e: the ring, attention-exchange and prompt-path buffers live in page-locked mapped host memory; the peer probe, peer enabling, peer copies and the IOMMU/BAR1 start checks are gone; the 27B files are dropped; CMake option STRATA_BUILD_SPLIT (off by default) builds strata-split-N for N cards
…NE after the NaN-stop ERR, server drops a trailing DONE, abort-sync test
…ss asked; Linux, 2-4 identical cards of a tested kind, UD-Q4_K_XL-type GGUF, every expert fits the cards, RAM free), its run config with the normal config kept as fallback, tests incl. no peer API in src/split; defaults: SM-ring prompt path, Strata's draft-layer files
…layer split, with one plain line, if the split engine refuses or fails to come up (start_engine_or_fallback, tests)
…peer function) and docs/SPLIT_ENGINE.md
…i) and RAM, reads the GGUF, and turns the run config into the split engine's with the normal one kept as fallback; strata launch calls it only when the config says split_engine true (or STRATA_SPLIT_ENGINE=1 for testers); tests
… buffer by a kernel, not a host-to-host cudaMemcpyAsync (which blocks the one thread that enqueues the cards in turn: the cause of the copy-engine ring stalling in the first read)
…es, keep the model's pack, draft layer and data folder, no installer run A model that is downloaded, in its own GGUF folder, with Read pictures on (the default) and no picture file started an install job on Load: `--data-dir <app models folder>\Strata-data --gguf-dir <own folder> --vision yes`. That re-checked the model files (finish marks written in the person's own folder), prepared a second pack and downloaded the draft layer into the wrong data folder, and rewrote data_dir in app-settings.json. - strata_control/pictures.py (new): finds the pinned picture file (size and SHA-256; beside the model, one folder up, in the model's data folder) or downloads it once into <data folder>/models, shared; the data folder is the one the model's run config names (packs/<tag>, mtp/rt). Works out the run config's vision section for the engine in use with the same rule as setup (CPU reader under 24 GB, GPU reader from 24 GB, AMD/Intel Arc/Mac readers). No internet is one plain sentence after a short probe; a start never downloads (acquisition guard). - native-control.mjs: Load (kind load, vision on) fetches the files through Control, writes the vision section, shows plain-word progress with a bar and loads. No internet, no room on the disk or a failed download: the model loads without pictures, nothing saved about pictures, one short line on the page. A restart or a tuning run never downloads. kind pictures does the same without a load (the "Download picture-reading files" button). A model whose only gap is a deleted picture file is no longer "missing files". installArgs: an installed model is prepared again in the folder its own run config names, never the app's models folder, and that folder is never written to the settings; the Drafting plan looks there too. - Models page: the Load shortcut no longer needs the picture files prepared for the families Load can fetch for; the button and the line use the new kind. - Tests: tests/terminal/test_pictures.py, apps/host/tests/load-pictures.test.mjs, UI preview fixture scenario, Chrome driver script, nine-language catalog.
…ere fetched, the page driver counts new dialogs only - With a loaded model that runs without pictures (no internet, no room), the existing "Picture reading needs a few more files" offer says the one short line instead of a second warning beside it; the offer is hidden while a download or load runs. - "Download picture-reading files" ends with a toast; a model that is loaded without pictures is told to load again. - Nine-language catalog: three more sentences. UI preview fixture: context 128K with its marker; the Chrome driver reports dialogs that are new after the click.
…9700 (placement lines, memory-capped one-card decode), words and menu row of its own
… the Q4_0 pack's shapes (small kernels from the first Metal port, df2_mm4 Q4_0 matrix kernel, engine gemv_mma over native Q4_0 blocks); micro-benchmark only, not in the engine
…erplexity, speed on R9700 and RTX PRO 6000)
…screte GPU the tower is read into pinned host memory at the load and takes its ~320 MiB of graphics memory only for a picture turn (out of what --reserve-mib keeps free; kept on the card when the reserve is below its size + 192 MiB, on a GPU that shares the PC's memory, on Metal, or with --vision-resident). The expert split then counts the tower's MiB as experts' room. A card that has no room at the turn gets 3 retries, then the request's ERR names --vision-resident
…er that does not start (no room, card busy) is the CPU reader for that start and the next start tries the card again; a cache that cannot shrink and under elastic_mib free VRAM goes straight to the CPU reader; a CPU reader makes the cache grow back at once; pictures already encoded start no reader; --vram-elastic on a driver without virtual memory management starts as one block with a log line
…drafter (9000+: 0.35, 3000+: 0.7, below: 0.8; the person's own --expert-cache N or --draft-conf wins); gfx1201 is a tested card (+7.2% short, +1.35% long), not a slower one
…matrix units (split-K variant), df2_bench modes for it, soak and head cap; drafter round 3.0 ms GPU / 3.3 ms wall (was 7.1 / 7.4)
….cpp from the first Metal port
… and the prompt chunks, Q8_0 pack through the engine's GEMVs, windowed attention, top-16 selector); same Dflash2Drafter API as the CUDA build
… a round against 36), Q8_0 draft head, STRATA_DF2_DUMP and tools/dflash2/check_metal_dump.py (final rows cos 0.9999 against the torch port) # Conflicts: # metal/src/engine/msl/dflash2.metal
…repack at load, df2_mma4s matrix-unit GEMMs, Q8_0 draft head on the matrix units (df2_mma8), DF-04 candidate cap (set_max_drafts), begin_request/note_rows/prepare, attention floor for a restarted lineage; builds on f-0291-df2-q4
…top once on the n-th request (does nothing when unset), to run the post-NaN path on a real engine
…comment and a docstring is not a model host the runtime reaches
…es work off the GPU The context ladder, the fewer-requests step and the one-request-at-a-time fallback of the earlier fit are gone. A start short of VRAM keeps its context and its number of requests and is moved off the GPU by the backend's knobs (CUDA: the KV window down to the engine's 20480; Arc: the prompt chunk, then the reserve, then the window), with one plain note. CUDA single requests are priced from the measured base per drafter (DFlash2 alone, DFlash2 with the MTP layer, MTP, none). Measured on the 8 GB mimic: DFlash2 alone starts at 128K with --kv-resident 20480 and not with 32768.
…register-blocked instance) and DFlash2's rope_table_inv_kernel (32 B) measured on l620
…e in setup: the choice (en / fr / cyrillic) is copied beside the DFlash2 pack, refreshed when it changes and on update and start, kept by the drafter's fetch; tests for DFlash2-only and MTP-folder installs
… at once (--batch N) and a long context no longer end in a refusal on an 8 GB A750: when the expert cache sizing leaves no working cache (or only one sized for a prompt loan that cannot happen), the prompt path's own chunk goes down (to 256), then a reserve that was asked for (to 300 MiB); a context that does not fit in VRAM turns KV streaming on by itself (the largest resident window that fits, 20480 at the least); the person's own --prefill N and --kv-resident N are kept. Only a start with no slot even then is refused, with one plain line saying what is taken and what to lower, and an out-of-memory during the load ends the same way. short_cache.hpp holds the arithmetic, short_cache_test (CPU) the A750 figures from the engine logs
…ve on (Linux ticks in ~4 ms steps, a same-size rewrite right away kept the marker's mtime_ns)
A short section next to the Linux setup: what Strata's own downloader does, the measured speeds (anonymous, 16-24 MB/s whatever the method), and the manual route with `hf download` and `--gguf-dir`, which setup already supports (checks the SHA-256, never deletes a file in your own folder). No code change.
…lots, the draft layer is dropped when it cannot fit A card whose expert cache stays below the 128 slots a prompt-path loan keeps behind used to be squeezed (reserve lowered to 100 MiB free, then the first long prompt aborted in an mmq allocation) or gave the prompt path 600 MiB of its own buffers and stopped. The loan now leaves 16 slots, the auto lend cap is lifted for such a card, and every 128-slot floor in the lend, request-time lend and VRAM-shrink paths follows it (g_lend_keep). When the draft layer, the head and a working cache with room left do not fit in the free VRAM before the layer loads, the start runs without the layer and says so (STRATA_MTP_KEEP=1 keeps it). An out-of-memory in the layer or head load with --batch names --batch and --max-context. Measured on an 8 GB mimic at 128K with --kv-resident 20480: DFlash2 alone 391 MiB free, 69-73 tok/s, a 32K-token prompt in 19.8 s; MTP asked: layer dropped, 557 MiB free, 62-70 tok/s, 32K prompt in 13.4 s. 12 GB unchanged.
…M_KEEP_MIN_ENGINE and its test)
…p, Cargo, the version test, the bug-report template
… and AGENTS.md follow the bump; the '0.2.9.1' tags that meant this release now read 0.2.10; the test comment names 0.2.9.1 as the unpublished DeepSeek hotfix label
…t; output head to pinned host memory as the last step The draft-layer drop, the 16-slot prompt-path loan, the own-buffer fallback and the head-to-host move run only on a discrete GPU (strata::spill_allowed: not Metal, not an integrated GPU such as Strix Halo), with a CHECK for the gate in arch_defaults_test. qsa_kv_resident_min is 4096 (20480 on a Metal build; STRATA_KV_RESIDENT_MIN overrides): windows of 4096 and 8192 gave the same tokens as 20480 with the cache fixed. fit_start walks the window 20480 / 8192 / 4096 only as far as the card needs. When every step leaves the cache no slot, the output head (Q6_K, 0.41 GiB) moves to mapped pinned host memory (about 3x slower decode). Measured on the 8 GB mimic at 128K: DFlash2 alone 391 MiB free, 63-70 tok/s, 32K prompt 19.8 s; MTP asked: layer dropped, 555 MiB free, 61-71 tok/s, 32K prompt 13.4 s; 2 requests 277 MiB free, 46 tok/s per user; 4 requests 171 MiB free, 15 tok/s per user. 12 GB cells unchanged.
…er repository keeps its model shards in IQ2_XXS/ and the Engram and picture file at the root): subdir, engram_path, mmproj_path
…the Metal build flag too, so it is refused on Metal like the rest of the spill logic (it asked spill_allowed(false, integrated) and the Metal shim reports integrated 0)
…Flash-1017-GSQ-RCO-Coder-GGUF, revision 0b1d5da5, every file's size and LFS sha256 from the Hub: five shards in IQ2_XXS/, the Engram at the root is the shared Engram (same name, size and SHA-256 as the unpruned release's converted one, used where it is, on the SSD), the repository's mmproj is accepted beside the shared one; tests pin the Engram rule
18 real HTTP/subprocess controls pass on zz/logprobs base82b9f878. CUDA barrier is uncompiled and unqualified; no shared activation. Parallel protected execution is explicitly unavailable.
18 endpoint controls and two compatibility controls pass; ordinary chat retains its existing stop allowance. Native CUDA remains uncompiled and GPU-unqualified.
settinghead
marked this pull request as ready for review
November 14, 2026 02:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flash Next extraction needs a bounded, correlated execution endpoint that the Harmony facade can hold under its admission lease. Add an opt-in loopback private endpoint and a native GPU barrier command on the maintained zz/logprobs branch, preserving its logprob/hidden-state support.
The endpoint admits one request, enforces the fixed extraction policy and absolute deadline, keeps the generation lock through a nonce-correlated barrier, and quarantines unknown completion. Native STOP draining is bounded; process exit alone never produces a successful GPU receipt. Older engines and parallel protected execution are explicitly refused. Private configuration and token files are bounded and owner-only; no Responses storage or response history is added.
Validation: 18 real HTTP/subprocess protocol controls plus 2 ordinary-chat compatibility controls pass. These use a native-protocol shim and do not qualify GPU execution or model quality.
Native CUDA compilation passed on zz-whitby for exact HEAD a593f4b: CUDA 13.1, GNU 14.2, architecture 86, Release, target strata; all 153 steps succeeded (exit 0), runtime 5m05s, peak memory 2.1 GiB. Isolated source/build only; nothing installed or loaded. Binary: 77,717,520 bytes, SHA256 b0e86cb9c33210fd42dd09fcd2997ef2bb627e33363f885f2de44baf901ec50b. Build log: 225,889 bytes, SHA256 3c34818bd39ae41d22d9c1675708d6ada19ba81253f099272722e5a87b9e1fae, https://benchday.app/s/B9GVPV3RTK . HIP/SYCL builds were not performed.
Draft: actual GPU completion/cancellation and failure proof, exact deployed model/tokenizer pinning, supported operator rollout, and a real admitted extraction remain required. No deployed service/configuration/credential changes were performed. Harmony-side profile support: zigzag-tech/livestack#19 .
Target-compatible CUDA12.9 artifact (2026-11-13): all153 steps pass in isolated nvidia/cuda:12.9.1-devel-ubuntu24.04 (image sha256:020bc241a628776338f4d4053fed4c38f6f7f3d7eb5919fecb8de313bb8ba47c), source a593f4b, sm86. Binary89173160B SHA256546549ee6b9c805dc80df608047d90f31a08a44c32766c89bcb69d45d79f141d; libstrata_kq.so14540488B SHA256d488e9b9e2e003d655ee6765a66a63a679402b14d9c6ebf3870229925c5055c3; log222340B SHA256ebede9659a045e5f3461f1c202d5f424c7b8cb3d51e9eba767cbce91cb9eeacd. Private staging only: tower resolves all libraries to CUDA12.9; --version and --families pass before GPU initialization. Receipt https://benchday.app/s/G3NM2T47WC . Earlier CUDA13 build proves compilation but is not the tower deployment artifact. No installed binary or service changed; real GPU cancellation still unverified. Owner pre-approved activation once Benchday branch gate passes; no further signoff required.
Portable AVX2 deployment candidate supersedes the CUDA12.9 host-native artifact above: source unchanged a593f4b; STRATA_PORTABLE=ON/GGML_NATIVE=OFF, enhanced AVX512/AMX options explicitly off, CUDA12.9 sm86. All17 rebuild steps pass. Fifteen ggml-cpu compile commands checked: no -march=native/-mavx512/-mamx. Binary89033792B SHA256250b454ad846a07754dc6b5c994bd5e9c6b05518de7158ae96f2dab6ca26493e; libstrata_kq.so SHA256d488e9b9e2e003d655ee6765a66a63a679402b14d9c6ebf3870229925c5055c3; log13995B SHA256baebe3adcfe361ec2dad183a9dc96bd63e85008d9318105ed411f7d647b0fc87. Private tower staging verifies hashes, all dynamic libraries and pre-GPU version/family controls. Receipt https://benchday.app/s/BR5Z4N2YMS . Prior CUDA13 and host-native builds are historical compile evidence and MUST NOT be deployed to this AVX2 tower. Native GPU cancellation still awaits actual activation after Benchday branchgreen.
Compatibility update for the installed engine 0.1.56: candidate 243845b incorporates source 06698c6 and preserves the fork hidden-state readout and newer upstream logprobs. The combined HTTP/subprocess controls passed: 65 tests (hidden state, continued final message, logprobs, parallel logprobs, protected extraction and bounded stop). The earlier candidate a593f4b / engine0.1.45 must not replace the installed newer engine. CUDA12.9 portable compilation of intermediate e5fac13 passed all170 steps. Final integrated source243845b7 passed its27-step incremental native rebuild (sm86, AVX2 baseline). Verified artifacts: strata SHA256 d80ead313bcb44a18b5ca1fa62220eaf8b559f04c68afe16c8412f0f42288a7f; libstrata_kq.so SHA256 8cff77acbfaf6a24d0966d402a5724bb103645f1382edc7d61efdf731b4c710f. Target-host ldd resolves every library. These are compilation/linkage results; real admitted GPU cancellation remains pending. HIP/SYCL hardware validation has not run. No installation or service mutation is claimed.