Repository navigation
Releases
osmos [0.22.3]: `osmos-evo-hy4` - Hy4-flash closer to its release and faster plain, on AngelSlim's Q3_K
A new pack, osmos-evo-hy4: AngelSlim's Q3_K of Tencent's Hy4-flash with osmos's delta in - the 0.7.6 / 0.8.0
evo method (DeepSeek's osmos-evo, Inkling-2-Small's osmos-evo-inkling) on Hy4. hy4-flash stays as it was.
- What changed in the weights: every dense matrix (attention, shared and dense FFNs, Engram projections) and the
output head Q6_K by GPTQ from the pack's own values (Q8_0 / BF16), calibrated on private agentic sessions; every
routed expert IQ4_XS, requantized from the release's BF16 with each expert's own importance-matrix column (the
stock pack's Q3_K gate/up carried 3.7x the error of IQ4_XS). The Engram table, embeddings and norms are AngelSlim's. - Against the release (its BF16 experts; teacher-forced, every row's KL over the vocabulary): Wikipedia KL
0.332 -> 0.254 (-23.5%), top-1 82.2% -> 84.2%; held-out agentic sessions' assistant rows 0.073 -> 0.056
(-24%), 92.2% -> 93.4%. - Speed (low-power, osmos 0.22.3): plain decode 58.0 -> 51.3 ms a token (+13%; 1.81 GB a token less of dense
and head). Drafted, a DFly2 round costs the same (the IQ4_XS experts' int8 verify path spends the dense savings), so
drafted speed follows acceptance on the text: session bench--fast31.2 drafted / 19.2 plain tok/s against
hy4-flash's 34.0 / 17.7 in the same run (the two write different answers); agent bench 12/12. Every weight
resident: ~85 GB, ashy4-flash's 84.5. - Measured, not shipped: Q5_K dense (slower than Q6_K on osmos's matvec - 57.2 vs 51.4 ms - and wiki KL +22%);
IQ4_XS only in the stock Q3_K slots (ties on KL and speed, 3 GB more). DESIGN.md "0.22.3" has every number. - Install:
python3 tools/install/osmos_install.py osmos-evo-hy4 --servefetches AngelSlim's Q3_K (pinned) and
the 83.9 GB delta (mrsirg97-rgb/osmos-evo-hy4, two parts) and assembles the pack (btrfs / XFS: cloned, no copy).
The delta carries the Tencent Hy License 1.0, the base model's. - Tooling:
OsmosProbe(include/osmos/run/probe.h) - one calibration probe shape for DeepSeek, Qwen and Hy4;
hy4_forward_probe(mutation-checked intest_hy4_probe_gpu);tools/bench/hy4_calib(GPTQ sums, the experts'
imatrix) andhy4_run DUMP=; the oracle'shy4_forward --release / --ids / --logp-out;tools/convert/patch_gguf.py
(one replacements writer for every family, wasink2_patch.py);tools/evo/requant_hy4_exps.py. No serving-path
change: every existing pack's ids hashes the same.
osmos [0.22.2]: the installer fetches DeepSeek's Engram table into a fresh cache
A fix release: no engine or protocol change, every ids hash the same.
- Fixed (severe): a file past 50 GB under a folder of its repo - DeepSeek's Engram table,
engram/DeepSeek-V4.1-Flash-1017-engram-MXFP8.gguf_file, 202 GB - failed to download in a fresh cache with "No such
file or directory". The installer's HTTPS path for files past the hub CLI's 50 GB (tools/install/fetch.py, since
0.11.0) made the cache root but not the file's own folder, so a first install ofosmos-evo-1017(the default) or
anyud-*pack stopped at the table; machines that already had the table never saw it. The file's folder is now
made (and on the release-asset path too);test_under_a_folderfails without it. - Credit: found and fixed by @aiordanescu in their fork
(aiordanescu/libosmos,fix/engram-dir) - thank you. - Upgrade:
git pull- the installer runs from the checkout, so a fresh install works as soon as you have it; no
rebuild needed for this fix.
osmos [0.22.1]: `GET /v1/models` reports what a pack serves: quantization, bits a weight, pack, file type, Engram table
osmos-api's GET /v1/models now says the served weights' quantization as stored, so a client (a benchmark matrix,
a dashboard) tells a Q4 pack from an FP8 one and a stock pack from a requantized one (#88,
requested and designed with @aic0d3r for the community bench in aic0d3r/local-ai-harness). No engine or
protocol change: every ids hash the same.
- New fields (
tools/api/models.c, split out oftools/api/main.c):quantization(besideid, as LM Studio places it): every tensor type of the served weights, by weights held,
most first, ties by name, joined by+- e.g.IQ2_XXS+IQ1_S+IQ2_XS+IQ2_S+Q6_K+Q8_0+Q5_K+F32+BF16(UD-IQ1_M),
Q8_0+F32(osmos1.7b).osmos.pack(the pack's name, apart from the id'sosmos-prefix),osmos.bpw(bits a weight as stored, scales
included, two places as llama.cpp prints BPW: UD-IQ1_M 2.03, osmos-evo 2.13, osmos-evo-inkling 2.13, UD-IQ2_XXS
2.40, Qwen UD-IQ3_XXS 3.49, Hy4 4.62, Inkling-2-Mini 5.92, osmos1.7b 8.51),osmos.file_type(the GGUF's own
general.file_type, raw, when it has one).osmos.engram.{quantization, bpw}for packs with an Engram / n-gram table (per_layer_token_embd: DeepSeek,
Hy4, Qwen): the table is 26-50% of those packs' values, so it is reported apart and never names the pack (Qwen's
weights readIQ2_S+..., not its table'sIQ4_NL).- Known from the headers before the engine is up (listed while loading, as before); an overlay is counted in place
of the tensors it replaces, the drafter is not counted.
- Why not
general.file_typefirst: on the installed packs it is right for osmos1.7b, Hy4 and osmos-evo-inkling,
but unsloth's DeepSeek files (and osmos-evo) state 7 (MOSTLY_Q8_0) on IQ1/IQ2 experts, Qwen's states IQ3_XXS where
IQ2_S holds the most weights, and Inkling-2-Mini states none - so it passes through raw, andquantizationis
computed from the tensors (DESIGN.md "0.22.1"). - Shared pieces (
include/osmos/model/quant_report.h,src/model/quant_report.c,include/osmos/model/gguf.h,
src/model/gguf.c):quant_report(pure over a model's and an overlay'sGguf),gguf_values, and
gguf_overlay_fits- the overlay rule (each tensor one of the model's, same dims) now one function for
weights_createand the report;GGUF_ENGRAM_TABLEnames the table where four literals did. A report that cannot be
read (a shard or the overlay missing, an overlay that does not fit, ageneral.file_typethat is not a u32) is
said on stderr and its fields left out - unknown, as before - andosmos-apiserves on: the engine stays the gate
and refuses such a model itself (CI's case: the tests fetch each model's first shard only). - Tests (failing first):
test_quant_report(order, ties, the table apart, overlays in either part, a stranger
and a reshaped overlay tensor refused,file_typeraw / a string or negative refused, 300 random models with and
without overlays checked against the test's own count, every type in one string's room; mutation-checked);
test_api.pyModels,ModelsOverlay,ModelsNoEngram(each skipped without every shard) against an oracle apart from the C code (the installer's
stdlib GGUF scanner +qtype.h's block sizes) on the real UD-IQ1_M and osmos1.7b files - all four fail on 0.22.0's
osmos-api;ModelsFirstShard(runs in CI): the first shard alone served with no report and the missing shard
named.tests/gguf_writer.h:test_gguf's hand-written GGUF writer, shared. - Verification: 49/49 host tests (
make tests), ASan/LSan/UBSan (make asan) and TSan (make tsan) 49/49
clean, 122/122 API tests (make api-test, 1 expected skip), CI'shost+sanitizersjobs in an ubuntu:24.04
container with first shards only (122 API tests, 19 skips by design incl. the three real-pack classes;
ModelsFirstShardran; 80/80 installer tests),/v1/modelson all 8 installed packs,test_weights/
test_q4x_weightsoverlay refusals unchanged on huihui's real patches,test_overlay_q4x_gpu(same bits). Not run:
the full GPU suite - no engine or kernel change (theweights.coverlay check moved, same messages; the hy4 / q4x
table names a constant of the same text).
osmos [0.22.0]: Unified Paged GPU KV Cache across all 6 families, lightweight marks, and 4-tier pool pressure
Replaces static per-sequence full-context KV reservations across all six model families (ink2, q4x, lfm3, q35, hy4, ds4) and their full-context MTP/DFly2 drafters with a shared paged GPU KV cache pool (KvPool, KV_PAGE_TOKENS = 512) that allocates physical pages on demand across concurrent lanes, adds O(1) lightweight mark_save / mark_load to lfm3, hy4, and ds4 (completing all 6 families), and wires 4-tier pool backpressure with strict FIFO admission into osmos-serve and osmos-api (--kv-tokens, --kv-gb, osmos.json). Every family remains 0-ULP bit-exact across non-contiguous shuffled pages, single and multi-stream runs, and prior v0.21.x / v0.18.0 baselines.
- Measured multi-agent & long-context wins (
performanceprofile, 128 GB Strix Halo, 0 hash diffs):qwen38-ud-iq3_xxs@ shipped 512K (P=4,autoshared pool vsv0.21.2-equiv4×512Kstatic KV): KV pool drops30.88 ->7.72 GiB (-23.16 GiB, 4.0×), keeping Qwen 100% resident in GPU RAM (97.10 GiB,9.27 GiBleft free) instead of streaming experts off SSD — boostingdecode_bench.pyS=4drafted53.4 -> 84.1 tok/s (+57.5%)and cutting 4-agentagent_bench.py --fastwall33.4 -> 12.5 s (2.67× faster, -62.6%)(p95 TTFT10.04 -> 3.31 s, p95 turn done20.14 -> 5.68 s, 12/12 bit-exact).osmos-evo-inkling@ shipped 512Kq8/q8(P=4A/B & newS=8): KV pool drops42.00 ->10.50 GiB (+31.50 GiB reclaimed straight back into resident experts) — boostingdecode_bench.pyS=4drafted10.3 -> 27.3 tok/s (+165%, 2.65×)and cutting 4-agentagent_bench.py --fastwall145.2 -> 69.8 s (2.08× faster, -51.9%)(p50 turn done48.52 -> 20.23 s, 12/12 bit-exact). UnlocksS=8@ 512Kq8/q8(previously84 GiBKV OOM):decode_bench.pyS=1/2/4/8plain13.2 / 20.3 / 26.9 / 23.2, drafted14.7 / 22.6 / 26.9 / 19.9 tok/s(0 diffs).inkling-2-mini@ shipped 1Mq8/q8(S=1/4/8): previously~168 GiBOOM atS=8, now shares one 1M pool (~21 GiB) and decodes at28.9 / 58.1 / 81.9 tok/splain and35.5 / 73.1 / 97.9 tok/sdrafted (bit-exact vsv0.21.0). Full4×8agent_bench.py@ 131K hit151.2 s(flat vsv0.21.2's151.1 s,2.62 GiBshared KV, 32/32 bit-exact).hy4-flash@ shipped 1M (S=1/4/8&P=4): previously OOM at bothP=4andP=8, now fits in one10.88 GiBshared 1M pool (96.98 GiBtotal,12.75 GiBfree), decoding18.4 / 44.2 / 52.1 tok/sdrafted (S=1/4/8, bit-exact vsv0.21.0) and completing 4-agentagent_bench.py --fastin21.3 s(12/12drafted == plain).osmos-evo-1017@ shipped 1M (P=4): shared 1M pool takes0.87 GiB(109.41 GiBauto budget),56.6 sagent_bench.py --fast(12/12drafted == plain).osmos1.7b@ shipped 256K (S=1/2/4/8):throughput_bench.pyhit96.5 / 172.1 / 277.6 / 363.9 tok/s (3.77×),S=8wall45.3 s(faster thanv0.21.0's47.5 s@ 32K,6.6 GiBGPU,8/8held +8/8SSD slot reuse, 0 hash diffs).- Single-stream (
S=1) flat & bit-exact: all 10/10session_bench.py --fastreplays across all 6 core packs (9 greedy/sampled vssession-180+ shipped 512Kq8/q8osmos-evo-inklingdrafted == plain) passed 80/80 steps with 0 diffs and flat GPU memory.
- Shared KV page allocator & paged attention kernels (
include/osmos/mem/kv_pool.h,src/mem/kv_pool.c,src/mem/hip_kv_pool.c,include/osmos/gpu/state_parts.h,src/mem/hip_state_parts.c,kernels/):- Implemented
KvPool(KV_PAGE_TOKENS = 512),KvSeqPages(host + device page tables, atomic rollback/trim,kv_pool_reserve_one_gpu/kv_pool_reserve_gpu, andkv_pool_shufflefor non-contiguous page verification), and pagedStatePartstreaming save/load preserving the existingSlotswire format and FNV-1a checksums verbatim. - Added paged
block_table+page_sizeindirection across all sixattn_coreattention paths (attn_core_kernel.h,attn_core_mla.h,attn_core_latent.h,attn_core_q35.h,attn_core_draft.h,attn_core_heads.h), keepingfa_interior_kernelat <= 240 VGPRs / 0 spills via an outer page loop, plus paged write/index/gather kernels (ink2.hip,q4x_attn.hip,q4x_qsa.hip,lsa.hip,hy4.hip,attn.hip). Full HIP + CUDA (cuda.mk) portability preserved.
- Implemented
- All 6 model families & lightweight marks (
src/{ink2,q4x,lfm3,q35,hy4,ds4}/,src/lsa/hip_lsa_close.c):- Migrated every
O(max_ctx)full-attention, QSA, LSA, sparse MLA, compressed KV, indexer, and full-context MTP/DFly2 drafter cache onto each family's sharedKvPool(coupledphyspage IDs across layers/indexers/drafter) while keepingO(1)sliding rings, DeltaNet/conv states, and fixed-window drafter rings per sequence; zero ledger leaks across all 8 packs intest_engine_ledger_gpu. - Added O(1) lightweight
mark_save/mark_loadforlfm3(LM3K, safely joininglsa_closer, un-closing blocks pasth.closed, and trimming pages while rejecting YaRN stage crossings),hy4(HY4K), andds4(DS4K), matchingink2,q4x, andq35and reclaiming tail pages on rollback/mark-load.
- Migrated every
- Engine,
osmos-serve, andosmos-apipool sizing & 4-tier backpressure (include/osmos/run/engine.h,src/run/hip_engine*.c,tools/serve/,tools/api/):- Added
OsmosOptions.kv_bytes,OsmosStats.{kv_bytes,kv_pages,kv_used,kv_page_tokens},osmos_kv_full(),oseq_pages(), and--kv-tokens N|Nk|Nm|auto(defaultauto = max(max_ctx, lanes * 512)),--kv-gb G, andosmos.json"kv_tokens"/"kv_gb"(loggingNOTE kv-pool: ...at startup). - Implemented 4-tier shared-pool pressure management with strict FIFO wait-queue admission (
tools/serve/{multi,round}.c): Tier 1 evicts LRUIDLElanes intoSlots; Tier 2 enforces strict FIFOm->wait[0]admission with committed-reading accounting, prefill pacing, and decode page reserve + draft-boundary capping; Tier 3 losslessly preempts the youngestREADINGlane back to the front ofwait[0](0 tokens emitted); Tier 4 runs pre-flightensure_decode_pagesbefore emitting tokens and refuses only the youngestANSWERINGvictim withERR <rid> KV cache pool full(neverFATAL, siblings finish bit-exact).
- Added
- Review fixes (failing tests first, 0 hash diffs vs the PR head across every bench):
- Tier 4 refused a lane that was ending:
ensure_decode_pagesnow counts the pages held byANSWERINGlanes that end this round (they goIDLEand are reclaimed before the batch retries) and picks its victim only among lanes that step (kv_pool_test.pytier4_end). - Reading lanes could starve each other or preempt older readers:
can_read_pieceis side-effect free;piece()takes a lane that fits whole, then round-robin among lanes that fit, and on a full pool preempts only younger readers (multi_preempt_reading(m, after)), pausing instead when lanes are answering (kv_pool_test.pyreaders,storm). - A prompt that fit the pool with no room for its first answer token is refused up front (
a prompt past the KV cache pool (its answer's first token included)). osmos_kv_fullreported a stale refusal: the flag is cleared at each family step's entry and reported only for the last step's own refusal (test_engine_errors_gpu).- q4x MTP read another conversation's rows: a window-seeded long prompt left rows
[0, from)of reused pages unwritten while the MTP head attends from position 0; those rows are now zeroed (mtp_own), keeping drafts independent of page reuse (test_mtp_q4x_gpuwindow_seeded). - Hy4 draft fault leaked tail pages: trimmed when the stream drained, the sequence marked broken otherwise.
--kv-tokensparsing shared and bounded:kv_tokens_parse(autoorN|Nk|Nm, 512 toUINT32_MAX) in both tools;osmos-apigains--kv-tokens autoand--kv-gb, refuses both at once, andosmos.jsonkv_tokensmust be an integer in range.
- Tier 4 refused a lane that was ending:
- Verification: 48/48 host tests (
make tests, includingtest_kv_pool), ASan/LSan/UBSan (make asan), TSan (make tsan), 117/117 API tests (make api-test, includingKvTokens/KvGb), 80/80 installer tests (test_install.py), 120/120 GPU tests (make NPU=0 gpu-tests: 113 ran + 7 expected skips, including 336/336attn_corechecks, 8/8test_engine_ledger_gpu, 7/7test_engine_state_gpu), liveNPU=1XDNA 2 E2E tests (test_npu_pack_gpu+test_npu_live_gpuQwen3.8 & LFM3),tools/serve/kv_pool_test.py(all 4 tiers +--kv-gb),turn_test.pyacross 4 families,parallel_test.py,slot_test.py,fill_test.py, 10/10session_bench.py --fastreplays, and all multi-agent/long-context showcase benchmarks.
osmos [0.21.2]: Inkling-2-Small 512K Q8 KV, Inkling long-context prefill speedup, correctness & consolidation, and 6-pack quality eval
Upgrades osmos-evo-inkling (Inkling-2-Small) to 512K context with q8/q8 KV (~35 tok/s drafted decode on agent sessions, ~356 tok/s short prefill, 10/10 planted + 1/1 unplanted needle recall at 511K, #1 overall in our 6-pack task eval), ships a 0-ULP bit-exact two-pass Inkling-2 long-context full-attention prefill kernel (+10.8% / +18.0% / +24.4% end-to-end on inkling-2-mini at 128K/256K/512K, +10.3% / +4.3% on osmos-evo-inkling at 128K/256K), fixes 13 correctness and SCOPE.md ownership bugs (failing tests first), consolidates 9 duplicated subsystems (-835 net LOC before the new kernel; -559 net LOC overall, 0 output-bit changes), and completes a full 6-pack max-context multi-needle + KL/PPL + HumanEval-164 / GSM8K-100 / Agent-Tool-20 quality evaluation.
- Inkling-2-Small (
osmos-evo-inkling) bumped to 512Kq8/q8KV (tools/install/packs.json):- Updated
settingstomax_context: 524288, kv_q8: true(temperature: 1.0,wiki_kld: 0.1959). - Measured A/B:
q8/q8vsq8/q5KLD0.195901(85.47% top-1) vs0.196627(85.76%); 512Kq8/q8recalled 10/10 planted + 1/1 unplanted across 511,199 tokens (12.61 tok/ssustained prose decode at 511.8K, auto-sized98.0 GiBbudget,minAvail 8,159 MiB) vs 256Kq8/q5's8/10 + 1/1;session_bench.py --fastat 512Kq8/q8ran at 34.6 tok/s median drafted decode (17.1plain, 2.02×), ~356 tok/s step-0 prefill,8/8drafted == plain,0loops, flat24.3 GiBGPU memory.
- Updated
- Inkling-2 long-context full-attention prefill speedup (
kernels/attn_core_kernel.h,kernels/attn_core.hip,tests/gpu/test_attn_core_gpu.hip):- Split long-context non-window full-attention prefills (
base > d.extent,end_keys >= kFaUnit,(pos0 + end_keys) % kFaUnit == 0,f16/q8q8/q8q5) into a pure interior kernel (fa_interior_kernel) handing(gm, gl)via existingc.partscratch tofa_tail_kernel(fa_body<..., TAIL=true>), with fail-closed fallback to 1-passfa_kernelwhen scratch is unavailable. - Dropping
rel/rel_proj/cmin/cmax/window/gatestate from the interior loop cut 127 VGPR spills -> 0 spills across all 6 instantiations (236–239VGPRs,45,824 BLDS), holding fullqa[8]andgmr[8]/glr[8]in registers (0 ds_bpermute), raisingST=3(all 768 threads active on fetch/dequant), disablingsubauto-unroll (#pragma clang loop unroll(disable)), splitting 8-row branchlessexpf(s - mn)ILP, guarding PV rescaling withif (__any(any_chg)), and ping-pongingbv_c/bv_nLDS loads behind PV WMMAs. - Measured (
-O2 -ffp-contract=off,performanceprofile, 0-ULP bit-exact across 101/101test_attn_core_gpu, 34/34fa_microbenchhashes, and 5/5 real-modelink2_enginelogit dumps viacmp):- Kernel (
fa_microbench, 524Kq8q8): Mini2,057.4 ->1,141.9 ms (12.78 -> 23.02 TFLOPs, 1.80×), Small4,525.8 ->2,347.7 ms (11.62 -> 22.39 TFLOPs, 1.93×). - End-to-end
ink2_engine(KVQ8=1, 4,096-tok steps):inkling-2-mini128K138.8 -> 125.3 s(1,046.4 tok/s, +10.8%), 256K398.7 -> 337.8 s(776.1 tok/s, +18.0%), 512K1,247.1 -> 1,002.6 s(522.9 tok/s, +24.4%, −4.1 min);osmos-evo-inkling128K555.7 -> 503.8 s(260.2 tok/s, +10.3%), 256K1,160.0 -> 1,111.8 s(235.8 tok/s, +4.3%).
- Kernel (
- Split long-context non-window full-attention prefills (
- Correctness &
SCOPE.mdresource-ownership hardening (13 fixes, failing tests first):- Reverse-order DS4 NPU teardown (
fwd_npu_destroybeforehost_slots_destroyinsrc/ds4/hip_ds4_make.c), plus NULL-safesay(), bounded non-hanging drain of remaining in-flightxrt::runhandles onnpu_wait()/npu_submit()errors (wedging the context and leaking its buffers innpu_close()if a run outlives the drain instead of freeing memory the NPU may still write), and one-timeXCL_BO_SYNC_BO_TO_DEVICECPU-cache flushes onnpu_open()/npu_device()/npu_region()so kernel-zeroed freshhipMallocpages (e.g.npu_tail_c0/c1) and pre-populated host weight buffers cannot clobber non-coherent XDNA 2 DMA (src/npu/npu_xrt.cpp,include/osmos/npu/npu.h,tests/gpu/test_npu_live_gpu.hip). - Unsigned underflow guard (
g->sizes[0] < 8) and NULL-safeerrinsrc/model/safetensors.c, routing LFM3lsa_load()(src/lfm3/hip_lfm3_make.c) throughst_create()for full bounds/shape validation; NULL-safeerrinsrc/text/json.candsrc/text/chat_ink2.c. - Input token bounds checks
[0, n_vocab)insrc/q4x/hip_q4x_step.candsrc/q35/hip_q35_step.c;n && !except, finitetemperature > 0,top_p in (0, 1], andstatic const float ninfinsrc/run/hip_engine.c. - Partial-startup teardown (
serve_unbuild+goto cleanupintools/serve/{main,build}.c) and fail-closedoseq_save()handling inconv_set_aside()(tools/serve/conv.c). - Error-path fd/mutex/cond/child cleanup in
engine_start()andEINTR-safewrite()inengine_run()(tools/api/engine.c); duplicateOrigin:refusal (400,tools/api/http.c); explicitram_gb: 0/days: 0forwarding (tools/api/config.c); non-arraytoolsrefusal, OOM propagation inrequest_format()andrequest_ink2(), non-string LFM3reasoning_effortrefusal, and-O1-safesnprintftruncation cap intools/api/chat.c; OOM-safebuf_same()intools/api/loop.cand allocation-free drain ons->goneintools/api/reply.c.
- Reverse-order DS4 NPU teardown (
- Code consolidation (9 shared modules, 0 output-bit changes):
- Promoted shared DFlash2 core (
include/osmos/dflash/dflash_core.h,src/dflash/hip_dflash_core.c) with shared cursor/window/count helpers across Q4x, LFM3, and Ink2; unified single- and multi-stream serving intotools/serve/multi.c(deleted 319-linetools/serve/single.c). - Added shared stdlib-only
tools/install/gguf_scan.py(used bygguf_assemble.py,gguf_delta.py,overlay.py,overlay_q4x.py,stamp.py),src/text/pretok_impl.h(across Llama3/O200k/Qwen pretokenizers),tools/gen_chat_fixtures_common.py,include/osmos/mem/npu_chunk.h,src/mem/fd_size.h, sharedexperts_plan/gguf_meta_get_u32/read_pickshelpers, unified single/multi-run attention & kernel launch templates (kernels/), andtools/bench/bench_common.h.
- Promoted shared DFlash2 core (
- 6-pack quality, long-context & objective task evaluation:
- Objective tasks (shipped defaults, 0 errors & 0 tool-parse errors across 1,704 items — HumanEval-164 / GSM8K-100 / Agent-Tool-20):
osmos-evo-inkling93.9% / 97.0% / 95.0%,hy4-flash93.3% / 98.0% / 95.0% (153/153 finished HE),inkling-2-mini92.1% / 96.0% / 80.0%,osmos-evo-101790.9% / 99.0% / 85.0% (149/149 finished HE),qwen38-ud-iq3_xxs90.2% / 97.0% / 85.0% (148/148 finished HE),osmos1.7b67.1% / 94.0% / 70.0% (508.2 / 481.0agg tok/s). - Max-context multi-needle (10 planted + 1 unplanted) & KL/PPL:
hy4-flash10/10 + 1/1 @ 1,014K (21.45 tok/s),inkling-2-mini10/10 + 1/1 @ 1,014K (10.68 tok/s, KL1.11e-3),qwen38-ud-iq3_xxs10/10 + 1/1 @ 508K (36.45 tok/s, YaRN PPL2.0278),osmos-evo-inkling10/10 + 1/1 @ 511K (12.61 tok/s, KL0.1959),osmos1.7b9/10 + 1/1 @ 250K (3,776prefill /83.70 tok/sdecode, KL0.00034),osmos-evo-10177/10 + 1/1 @ 1,013K undereffort=high(20.80 tok/s, PPL1.8758; controlled diagnostics confirmed zero engine/KV/drafter bugs —plain == drafted,ud-iq2_xxs10/10 at 14.6K & 59.8K,osmos-evo-101710/10 at 14.6K & 59.8K under shippedeffort=max, 40/40LIST_ALL, and 4/4 pushback).
- Objective tasks (shipped defaults, 0 errors & 0 tool-parse errors across 1,704 items — HumanEval-164 / GSM8K-100 / Agent-Tool-20):
- Verification: 47/47 host tests (
make tests), ASan/LSan/UBSan (make asan), TSan (make tsan), 111/111 API tests (make api-test), 80/80 installer tests (test_install.py), 119/119 GPU tests (make NPU=0 gpu-tests, including 101/101test_attn_core_gpu), liveNPU=1XDNA 2 tests (Qwen/LFM3/DS4), 9/9session_bench.py --fastreplays + post-kernel Inkling Mini (greedy + sampled) & Small (q8/q58/80diffs;512K q8/q88/8drafted == plain), and 4×8agent_bench.pyoninkling-2-mini(32/32 turns bit-exact vs0.21.0, 28/28 in-place,151.1 swall).
osmos [0.21.1]: Inkling-2-Mini DFlash2 drafter, `GET /metrics` Prometheus exposition & loop/KV-eviction observability
Integrates incoai/Inkling-2-Mini-DFlash2 onto Inkling-2's engine (osmos_ink2, opt-in via --dspark / "drafter") with 100% bit-exact answers (drafted == plain), adds a read-only GET /metrics Prometheus text endpoint to osmos-api (#85), and closes the loop-detection and KV-slot eviction observability gaps across all 6 model families (#47). Zero regressions on existing packs.
- Inkling-2-Mini DFlash2 speculative drafter (
tools/convert/dflash2_gguf.py,src/q4x/,kernels/q4x_dflash.hip,src/ink2/hip_ink2_dflash.c,src/run/hip_engine_ink2.c):- Extended
tools/convert/dflash2_gguf.pywith--nameand optionaldflash2.final_logit_softcapping/dflash2.selector_softcap_modemetadata; convertsincoai/Inkling-2-Mini-DFlash2(model.safetensors, 81 BF16 tensors) into a0.53 GBQ8_0GGUF. - Extended
Q4xDflashGeometry/Q4xDflashTarget,q4x_df_softcap+q4x_df_select(..., post_softcap)(kernels/q4x_dflash.hip), andhip_dflash_core.cfor unpaddedvalid_vocab(200058vs padded201024), post-final-norm last tap (final_tap), andbefore_correction/after_correctionlogit softcapping (30.0) with calibrated confidence scores. - Wired DFlash2 onto
Ink2Forward(Ink2Options.dflash, mutually exclusive withmtp) with isolated f16 staging and overflow flags, Ink2'sembed_normon anchor and mask embeddings, padded-to-valid head slicing, and automaticdflash2GGUF detection inosmos_ink2(--dspark/osmos.json"drafter"). - Measured on
inkling-2-mini(performanceprofile, bit-exactdrafted == plain):- GSM8K + HumanEval + MT-Bench (
T=1.0,seed=42, identical 739 tokens): 52.6 tok/s vs DSpark MTP45.7 tok/s(+15.1%; GSM8K 67.3 vs58.8, HumanEval 61.6 vs51.5, MT-Bench 39.3 vs34.8; 3.21 vs2.55 tok/round, draft pass7.73 msvs7.49 ms). session_bench.py --fast --sampled(max_context = 1M): 8/8 bit-exact vs0.18.0baseline, median decode 81.7 tok/s (MTP81.6), wall 28.9 s (MTP29.2 s), GPU memory 27,256 MiB vs MTP31,136 MiB(-3.9 GiB per sequence at 1M context, because all 5 DFlash2 layers cap rings at2,080rows =81 MiBvs MTP's full-context layer-2 K/V ring =4,096 MiB; at4Kcontext intest_engine_ledger_gpu, footprints match closely: built 21,502 vs21,462 MiB, two sequences 23,918 vs23,766 MiB).decode_bench.py(S=1,2,4,8greedy, bit-exact):35.3 / 46.9 / 59.7 / 66.7 tok/s(DFlash2 runs single-sequence per draft pass viaengine_draft_each, as on Qwen3.8; DSpark MTP remains batched for multi-laneS=8).
- GSM8K + HumanEval + MT-Bench (
- Extended
GET /metricsPrometheus exposition inosmos-api(#85, requested and designed with @aic0d3r;tools/api/api.h,tools/api/engine.c,tools/api/metrics.c,tools/api/main.c):- Exposes
text/plain; version=0.0.4; charset=utf-8using vLLM-compatible metric names (vllm:request_prefill_kv_computed_tokens_sum,vllm:request_prefill_time_seconds_sum,vllm:request_generation_tokens_sum,vllm:request_decode_time_seconds_sum,vllm:prompt_tokens_cached_total,vllm:request_success_total{model_name,finished_reason="stop|length|cancel|error"},vllm:num_requests_running) plusosmos_prompt_reuse_total{model_name,via}andosmos_loop_stuck_total{model_name}, built directly fromPPandDONElines already parsed bytools/api/engine.c(noosmos-serveprotocol break). - Lifetime counters accumulate once under
Engine.muwhen a run ends, tracking computed tokens reported byPPso requests cancelled while queued do not inflate prefill counters; serves200while loading (zeros), refuses non-GET (405), and inherits the existingOriginand loopbackHostsecurity checks (403).
- Exposes
- Generalized loop detection & KV-slot / full-prefill observability across all families (#47, reported and traced by @ucotman;
tools/api/{loop.h,loop.c,chat.c,reply.c,http.c},include/osmos/serve/slots.h,src/serve/slots.c,tools/serve/conv.c):- Assistant-text & turn-batch loops: added
assistant_repeats(consecutive trailing assistant turns with identical normalized non-emptycontentand, for turns withtool_calls, the same calls or the same results - the #47 shape, one text before new arguments and the same error, counts; one preamble before calls that each return something new does not;stuckat>= 3), upgradedunchanged_repeatsto compare whole multi-call assistant turns(calls[], results[])as a unit alongside single-call runs, and removed deadLOOP_REPEATS. - Cross-request frozen prompts: added a bounded 16-entry FNV-1a ring (
Api.seen) tracking multi-turn prompt retries that would get the same answer again (prompt_repeats,stuckat>= 3; the token ids, and when sampled the temperature,top_p,top_kand seed - so regenerations, best-of-N and seedless sampled retries are not loops; ignores single-turn prompts with no assistant turn). Both new fields appear inosmos.loopandx-osmos-loop, andstuck=1is logged tostderrand counted inosmos_loop_stuck_total(strictly observational). - KV-slot eviction & re-prefill visibility: added
slots_evictions()(src/serve/slots.c: every kept conversation dropped for room or lost to a failed folder write, includingslots_room's with no slots folder),NOTE slots: evicted ...andNOTE conv: full prefill (prev_held, common, prompt_pt, user_pt, slots)diagnostics (tools/serve/conv.c),osmos.prompt: {via, reused, prompt_tokens, computed}on all chat JSON responses (x-osmos-promptheader on non-streaming), and SSE: osmos-prefill via=... reused=... done=... total=... ms=...comments on multi-chunk prefills (preserving: keep-aliveand clean single-chunk SSE streams).
- Assistant-text & turn-batch loops: added
- Tests: expanded
tests/test_q4x_dflash.c,tests/test_slots.c,tests/gpu/test_q4x_dflash_ops_gpu.hip,tests/gpu/test_engine_ledger_gpu.hip, andtests/api/test_api.py(Metrics,LoopAndPrefill), and addedtests/gpu/test_ink2_dflash_gpu.hip(mutual exclusion, seed/load invariants, greedy/sampledT=1.0andS=2bit-exactness).
osmos [0.21.0]: bit-exact single-stream speedups & XDNA 2 NPU redesign
Accelerates single-stream (S=1) prefill and decode across every shipped pack with 100% bit-exact answers (diff: ok vs 0.20.1), and redesigns --npu for AMD XDNA 2 with strict split/batch/repeat determinism, 2 MiB THP host slots, 1.9–3.3x faster Qwen IRON kernels, a 0-ULP bit-exact Q8_0 proof, and dense Q8_0 prompt offload on osmos1.7b.
- Measured single-stream gains (
session_bench.py --fast, shipped mode,performanceprofile;0.20.1 -> 0.21.0, all 6 packs 8/8diff: okbit-for-bit):osmos1.7b(sampled): prompt5,368 ->5,649 tok/s (+5.2%), median decode77.1 ->92.3 tok/s (+19.8%), wall11.3 ->10.0 s (-11.4%).osmos-evo-inkling(drafted, sampled): prompt344 ->378 tok/s (+9.7%), median decode28.6 ->35.9 tok/s (+25.4%), wall95.0 ->84.9 s (-10.6%).hy4-flash(drafted, greedy): prompt498 ->554 tok/s (+11.2%), median decode35.1 ->35.7 tok/s (+1.9%), wall46.1 ->41.8 s (-9.4%).osmos-evo-1017(drafted, sampled): prompt205 ->241 tok/s (+17.4%), median decode41.1 ->41.7 tok/s (+1.6%), wall77.2 ->72.0 s (-6.8%).inkling-2-mini(drafted, sampled): prompt1,291 ->1,393 tok/s (+7.9%), median decode79.1 ->81.6 tok/s (+3.2%), wall29.7 ->28.3 s (-4.5%).qwen38-ud-iq3_xxs(drafted, greedy): prompt868 ->914 tok/s (+5.2%), median decode67.6 ->68.8 tok/s (+1.8%), wall28.0 ->27.3 s (-2.5%).
- Single-stream kernel & runtime optimizations (zero bit drift):
- Multi-block GPU sampling (
kernels/ops.hip,src/run/hip_engine.c,tools/serve/): split-reductionops_sample+ batchedops_sample_batch()(one launch + one sync for drafted verify blocks; verified bit-exact intest_sample_gpu). Greedy,top_kandtop_p: 1draws are the bits of0.20.1's;top_p < 1on a vocabulary past 4,096 now cuts on fixed-point mass (2^-40steps) instead of a float bisection, so a token at the nucleus' edge can differ from0.20.1's for the same seed - still deterministic, drafted == plain (every shipped pack's default istop_p: 1). - Attention & fused GEMM epilogues: halved prompt stage
ST4 -> 2, Wave32 half-splitQfragments viads_bpermute(kQHalf), and per-wave LDS relative-bias caching (kRelLds) inkernels/attn_core_kernel.h; fusedops_rms_add_rms_x16,ops_rms_x16_ctrl_many, andops_swiglu_x16_rows(test_fuse_gpu); tunedmm.hip/q8.h(test_mm_gpu). - Per-family hot paths: parallel CPU
lsa_block()closing insrc/lsa/hip_lsa_close.c; fused Hy4hy4_rms_hc_post,hy4_head_meta,hy4_scatter_f32, and multi-blockhy4_dfly_pick_fast; multi-blockq4x_top_fastandq4x_df_rope_from; Ink2 loop-control fusion andgpu_stream_waitspin-wait (src/run/hip_gpu.c); streamlined DS4 draft round overlap.
- Multi-block GPU sampling (
- AMD XDNA 2 NPU redesign (
--npu,spikes/npu/RESEARCH.md):- 2 MiB THP & zero-churn async XRT driver (
src/mem/hip_host_slots.c,src/npu/npu_xrt.cpp): 2 MiB-alignedmmap+MADV_HUGEPAGE+MADV_POPULATE_WRITEfor host expert slots >= 2 MiB under--npu(512x fewer IOMMU walks; without--nputhe slots stay plain 4 KiB pages, as0.20.1); pre-allocateda_subsub-BOs, asyncnpu_submit/npu_wait, and suballocated (off != 0) ROCm dma-buf export support at any--max-tokens. - IRON kernel upgrades (
spikes/npu/fused/):aie::rounding_mode::conv_evenacross all kernels (-35% RMSE, -34x bias); 8-col single-passSPLIT_MATSQwen gate+up with compact 2 KiBiq3xxs_grid4.h(iq3xxs573 -> 301 us/ 1.90x,iq4nl-down403 -> 123 us/ 3.28x). - Strict NPU determinism (DS4 & Q4x): static Bresenham expert ownership
npu_owns_expert(e, E, share)+ safe registered tail staging (npu_copy_tail) guarantee 0 differing bits across repeatability, arbitrary prompt splits, and concurrentS=2batching (stamped"NPU2"identity). Added2xskew headroom (DS4_NPU_MAX_BATCH = 192) eliminating DS4 overflow stalls. Live 8K prompts:osmos-evo-1017630 ->646 tok/s (+2.5%,OSMOS_NPU_SHARE_DS = 0.08f);qwen38-ud-iq3_xxs938.1 ->947.0 tok/s (+1.0%,OSMOS_NPU_SHARE_QWEN = 0.06f). - Dense
Q8_0 -> BFP16offload onosmos1.7b(q8-dense-gu/,src/lfm3/,src/run/hip_engine_lfm3.c,tools/npu/build.sh,tools/install/packs.json): 8-colSPLIT_MATS(NR=32, PASSES=2, M=256) computes[0, 1024)FFN gate+up with direct stridedROWMAJORdrain and non-blockingf->npu_stpack overlap. Live 8K prompts:7,038 ->7,118 tok/s mean (peak 7,163.8 tok/s, +1.1–2.7%), 2,047-tokendPPL = +0.0262%/mean KL = 0.000122/ 64/64 identical greedy tokens, and 0 differing bits across splits, batching, andmax_tokens=128. Documented 0-ULP bit-exactQ8_0hardware proof (0 / 262,144bits) and GPUmm_f16roofline trade-off inspikes/npu/RESEARCH.md. Updatedpacks.jsonnpu-ds,npu-qwen, and newnpu-lfm3(wired toosmos1.7b) to thev0.21.0kernel tarballs.
- 2 MiB THP & zero-churn async XRT driver (
- Full deterministic benchmark sweep (
v0.21.0,performanceprofile; 0 hash diffs vsv0.20.0/v0.18.0baselines):decode_bench.py(8 packs, 2K prompt / 128 decode, bit-exact):osmos1.7bplain 101.0 → 544.6 (S=1 up from 95.2),qwen38-ud-iq3_xxsdrafted 40.1 → 109.6 (was 39.7 → 106.7),inkling-2-minidrafted 35.7 → 98.6 (liberated103.3,liberated-s99.2),hy4-flashdrafted 54.0 (was 52.5),osmos-evo-1017drafted 26.5 → 63.5,osmos-evo-inkling(S=1→4) drafted 16.1 → 32.4 (was 15.4 → 30.6).throughput_bench.py(6 packs, 1–8 streams, fresh/in-place/SSD-slot, bit-exact):osmos1.7b96.2 / 171.7 / 272.5 / 361.3 (S=8 wall49.8 → 47.5 s),qwen38-ud-iq3_xxsdrafted 76.1 / 64.8 / 72.3 / 75.7 (S=463.5 → 72.3, S=870.6 → 75.7),inkling-2-minidrafted 37.6 / 39.4 / 52.5 / 57.4 (plain S=850.9 → 52.4),hy4-flashdrafted 29.4 / 31.4 / 32.8 / 35.4 (S=8 wall350.7 → 329.1 s),osmos-evo-inklingdrafted 22.5 / 22.3 / 18.6 (S=119.5 → 22.5, S=220.6 → 22.3).agent_bench.py(4×8 agents, 32/32 turns answered, 28/28 in-place):osmos1.7b75.5 s (was 78.2 s),inkling-2-mini151.4 s (was 162.2 s, -6.7%),qwen38-ud-iq3_xxs181.2 s,hy4-flash359.0 s (was 383.1 s, -6.3%),osmos-evo-1017453.7 s (106.3 GiB budget; p50 TTFT8.25 → 7.85 s).session_bench.py --fast(9 replays: 6 greedy + 3 sampled, 72/72 steps): all 9 replays pass 8/8 parsed, 0 loops, drafted == plain ==0.18.0baseline bit-for-bit.
- Investigated
inkling-2-minihigh-effort looping report: auditedchat_ink2.c(Thinking effort level: 0.2/0.7/0.9/0.99, byte-exact vstransformers),request.c/answer.c/ops_sample, andkv_q8fidelity (KL 1.1e-3, 64/64 top-1 vsllama.cppF16 KV intest_ink2_loop_gpu), and ran live PR-review + spike-test prompts oninkling-2-miniat shipped defaults (temperature: 1.0,kv_q8: true,int8: false) acrosslow(3/3 seeds, 1.7K–2.2K tok),medium(5.7K tok),high(up to 12K tok), and a 2-turn ~9K-context diff with prefix reuse. Unable to reproduce degenerate loops at pack defaults (thoughhigheffort naturally thinks for ~9K–10K tokens before answering, and client overrides such as"temperature": 0or truncatedmax_tokens/ droppedreasoning_contentcan make Inkling-2-Mini loop-prone). Users who hit a reproducible loop are encouraged to open a GitHub issue with the request payload andosmos-apilog. - Tests & verification: added
tests/gpu/test_npu_live_gpu.hip(2 MiB THP, live XDNA 2 async driver, Q4x & LFM3 E2E determinism, suballocated dmabuf, zero ledger leaks) and expandedtest_npu_pack_gpu,test_sample_gpu,test_fuse_gpu, andtest_mm_gpu. Full verification: all host tests, ASan/UBSan/LSan, TSan, 103/103 API tests, 80/80 installer tests, 118/118 GPU tests (NPU=0), liveNPU=1E2E determinism + ledger tests ongfx1151+ XDNA 2, and all 3tools/npu/build.shkernel sets (ds,qwen,lfm3).
osmos [0.20.1]: liberated Inkling-2-Mini packs & upstream `inkling2_loop` support
Adds two new packs for mrsirg97-rgb/inkling-2-mini-liberated-s3bo2a10 (both using 1M context, --kv-q8, temperature: 1.0, int8: false, and the base ink2-mini-mtp-q8.gguf DSpark drafter) and full engine/API support for upstream llama.cpp's inkling2_loop GGUF dialect. Zero regressions on existing packs.
- New packs (
tools/install/packs.json):inkling-2-mini-liberated(rigidinkling-2-mini-liberated, aliasmini-lib,gpu_gib: 10): nativeNVFP4 / MXFP8experts andBF16dense weights converted bit-exact viatools/convert/ink2_ref_gguf.py(--check 0,6,19,20,23: 0 differing values; 8.63 GiB smallest build, 20.46 GiB full resident). Measured (performanceprofile):decode_bench.py2K plain 28.7 / 64.7 / 85.8 tok/s (2.99x) and drafted 33.7 / 80.0 / 102.9 tok/s (3.05x, 66–81% MTP acceptance, 0 hash diffs across S=1/4/8 and drafted == plain);agent_bench.py --fast --plain12/12 turns drafted == plain bit-for-bit (13.3 s wall).inkling-2-mini-liberated-s(rigidinkling-2-mini-liberated-s, aliasmini-lib-s,gpu_gib: 7):Q2_0-hybrid(Q2_0outer layers 0–5 & 18–23,NVFP4looped core layers 6–17,Q8_0dense/embed/head; 12.15 GB file, 5.99 GiB smallest build, 14.10 GiB full resident). Measured (performanceprofile):decode_bench.py2K plain 35.4 / 63.7 / 84.1 tok/s and drafted 41.0 / 74.1 / 96.4 tok/s (70–77% MTP acceptance, 0 hash diffs across S=1/4/8 and drafted == plain);throughput_bench.pydrafted clean decode 46.5 (S=1) / 57.0 tok/s (S=4), in-place first token p50 2.14 s (S=1);agent_bench.py --fast --plain12/12 turns drafted == plain bit-for-bit (11.7 s wall).int8A/B onQ2_0-hybrid: whileint8on led pure 128-tokendecode_bench.py(44.5 / 77.2 / 105.6 vs 41.0 / 74.1 / 96.4 drafted),int8: false(--no-int8) won on realistic multi-turn workloads (throughput_bench.pyS=1 46.5 vs 45.9, S=4 57.0 vs 54.3 tok/s; in-place TTFT 2.14 vs 2.62 s; MTP acceptance 58%/65% vs 56%/62%;agent_bench.py --fast11.7 vs 13.1 s) and avoidsreads apartanswer re-reads and extra int8 activation quantization noise on top ofQ2_0.
- Upstream
inkling2_loopGGUF dialect &attn_rel_bias.weightfix:- Added
INK2_KEYS_UPSTREAM_LOOPininclude/osmos/ink2/weights.h,src/ink2/geo.c,src/ink2/weights.c, andsrc/ink2/hip_ink2_resident.c(physicalblock_count,loop.{count,start,end,gate_rank,varying}with variable loops refused fail-closed, per-layerblk.L.loop_msg_query.weightandloop_{q,k,v,ffn}_ctrl_{down,gain,forget}.weight), dispatchedinkling2_loopinsrc/run/hip_engine.c, and registeredinkling2_loopon Inkling's chat dialect intools/api/dialect.c. - Fixed latent missing transpose of upstream
attn_rel_bias.weight([extent, d_rel]->[d_rel, extent]) insrc/ink2/hip_ink2_resident.c(up_rel_proj(), verifiedmaxdiff = 0against reference).
- Added
- Tests: expanded
tests/test_ink2_mini_weights.c(upstreaminkling2_loopgeometry, fusedQ2_0/NVFP4layers, and 9 fail-closed mutation checks),tests/api/test_api.py(InklingLoopApi), andtools/install/test_install.py(pack set,gpu_gib, sampling, files,rigids & unique aliases).
osmos [0.20.0]: multi-lane throughput — batched decode, batched drafters, and bit-exact multi-stream scaling
Every pack's answers are unchanged, bit for bit: across 1, 2, 4, and 8 concurrent streams, plain and drafted match each
other and the 0.19.0 baselines with 0 hash diffs (throughput_bench.py and decode_bench.py), and all 9 recorded
agent session replays (session_bench.py --fast, 6 greedy + 3 sampled, 72/72 steps) match 0.18.0's baselines and
drafted == plain bit for bit. Zero single-stream regressions — every drafted pack is faster at 1 stream as well.
- Measured performance (
performanceprofile; 1-8 stream clean decode and 4×8 agents vs 0.19.0 / pre-change baseline):- Multi-stream throughput (
throughput_bench.py, clean decode tok/s, 1 / 2 / 4 / 8 streams; baseline in parentheses):osmos1.7b(plain): 90.1 / 160.6 / 257.6 / 343.5 (89.0 / 139.9 / 197.3 / 238.8, +43.9% at S=8; wall 64.6 -> 49.8 s, -22.9%).inkling-2-mini: drafted 36.8 / 40.0 / 52.4 / 57.0 (36.0 / 36.9 / 43.2 / 44.6, +28.0% at S=8; wall 218.3 -> 171.8 s, -21.3%); plain 28.4 / 32.7 / 44.0 / 50.9 (27.9 / 30.5 / 39.4 / 45.0, +13.1%).hy4-flash: drafted 28.7 / 30.3 / 31.5 / 35.1 (27.1 / 27.6 / 26.0 / 29.4, +19.5% at S=8, +21.3% at S=4, +5.9% at S=1; wall 393.0 -> 350.7 s); plain 18.0 / 20.7 / 20.8 / 29.6 (17.6 / 19.7 / 19.6 / 25.9, +14.0%).qwen38-ud-iq3_xxs: drafted 75.9 / 67.6 / 63.5 / 70.6 (75.8 / 63.8 / 65.7 / 64.7, +9.2% at S=8; wall 187.0 -> 178.6 s); plain 30.4 / 32.9 / 41.4 / 56.9 (30.2 / 33.6 / 40.6 / 51.9, +9.7%).osmos-evo-1017: drafted 33.2 / 37.9 / 36.0 / 34.6 (32.5 / 33.6 / 33.3 / 32.1, +12.7% at S=2, +8.0% at S=8); plain 18.3 / 24.3 / 29.6 / 36.4 (18.7 / 23.6 / 29.5 / 34.6, +5.2%).osmos-evo-inkling(1 / 2 / 4 streams): drafted 19.5 (warm) / 20.6 / 18.7 (19.3 / 19.5 / 18.8, +5.5% at S=2); plain 16.0 / 15.7 / 16.6 (15.5 / 14.6 / 15.1, +10.2% at S=4).
- Pure 2K decode scaling (
decode_bench.py, 2K prompt / 128 decode, S=1 -> S=8; Small S=1 -> S=4):osmos1.7bplain 95.2 -> 543.8 tok/s (5.71x);qwen38-ud-iq3_xxsplain 30.0 -> 96.5 (3.22x), drafted 39.7 -> 106.7 (2.69x);inkling-2-miniplain 28.6 -> 81.2 (2.84x), drafted 34.7 -> 96.0 (2.77x);osmos-evo-1017plain 17.3 -> 62.0 (3.58x), drafted 27.4 -> 64.7 (2.37x);hy4-flashplain 14.1 -> 47.4, drafted 18.5 -> 52.5;osmos-evo-inkling(S=1 -> S=4) plain 12.5 -> 26.4 (2.11x), drafted 15.4 -> 30.6 (1.99x).
- Agents (4 at once, 8 turns; vs 0.19.0):
osmos1.7b78.2 s (88.6 s, -11.7%; turn done p50 6.5 vs 8.1 s),inkling-2-mini162.2 s (201.4 s, -19.5%; turn done p50 10.2 vs 18.4 s),qwen38-ud-iq3_xxs178.0 s (187.7 s, -5.2%; turn done p50 9.7 vs 19.0 s),hy4-flash383.1 s (418.7 s, -8.5%; turn done p50 37.3 vs 44.4 s),osmos-evo-1017433.7 s at 109.2 GiB budget (426.0 s at 110.4 GiB; turn done p95 83.9 vs 84.1 s).
- Multi-stream throughput (
- Multi-lane plain decode and shared kernels:
- Unified int8 MoE decode (
kernels/q8.h,kernels/q8.hip,src/model/moe_route.c): every MoE family decodes through one shared int8 path at any batch size (no threshold switch to f16 that alters bits). Pipelinedq8.hinput loads and width-tunedosmos_waves_per_euoccupancy (kGroupWaves,kGateUpWaves, guarded behind#if defined(__HIP__)inkernels/port.hfor CUDA portability) cut Q4x register spills from 842 to 20. - Multi-run attention and matvec (
kernels/attn_core*.h,kernels/mv.h,kernels/mv.hip): addedattn_core_run_many()across heads, MLA, latent, Q35, draft, and Ink2 split kernels (with zero-spillfa_split_many_kernel), plusmv_runmulti-tokenwide_kernelfor batches past 8 rows. - Per-family batched multi-run ops: batched LFM3 conv/RoPE/LSA (
kernels/lfm3.hip,kernels/lsa.hip,src/lfm3/hip_lfm3_step.c); batched Q4x QK-norm/RoPE, DeltaNet recurrence, and QSA indexing (kernels/q4x_*.hip,src/q4x/hip_q4x_layers.c,Q4X_SIDE_STEP16 -> 64); unified Hy4 MLA split/merge, Engram/indexer/residual ops (kernels/hy4.hip,src/hy4/hip_hy4_layer.c); DS4 multi-run latent attention and index scoring (kernels/attn.hip,src/ds4/hip_ds4_attn.c); Ink2 multi-sequence layer execution, batched convs, and batched projections (kernels/ink2.hip,src/ink2/hip_ink2_step.c,src/ink2/hip_ink2_ctrl.c).
- Unified int8 MoE decode (
- Multi-lane batched drafting and deterministic draft budgeting:
- One batched draft pass (
oseq_draft_all): Ink2, Hy4, and DS4 draft up toNactive lanes in one batched forward (src/run/hip_engine*.c,src/{ink2,hy4,ds4}/hip_*_draft.c). - Drafter WMMA and grouped MoE upgrades: Ink2
dmat()now usesink2_mm_takes()(fixing 7x redundant reads of Mini's 1.2 GB BF16 LM head, cutting 8-lane draft pass43 -> 16.8 ms) and batched Markov step kernels (kernels/ink2_mtp.hip); Hy4 DFly2's 5 Q8_0 layers run onmm_tokenswith fusedq_a+kv_aandffn_gate+ffn_up(-21.3%at 8 lanes); DS4 DSpark's Q8_0 dense/LM head run onmm_tokens,wo_aonmm_x16_attn+mm_group, and 128IQ2_XSrouted experts onroute_tok+q8_experts. - Deterministic multi-lane draft policy (
include/osmos/run/draft.h,tools/serve/): addedosmos_whole()andosmos_round_tokens()(unlocking full multi-lane verify budgets on resident Ink2 Mini and Q4x),draft_rank_alloc()(deterministic cumulative-confidence-ranked allocation across lanes, fail-closed on NaN/out-of-range), residency-awaredraft_lane_cum_min()(S=1 untouched; multi-lane0.30resident,0.55/0.70SSD-streamed), and--draft-max/--draft-cumflags onosmos-serve.
- One batched draft pass (
- Benchmarks and tests:
- Added
tools/serve/throughput_bench.py(1/2/4/8-stream seeded multi-conversation scaling with cross-stream/mode hash checks) andtools/serve/decode_bench.py(fast 2K pure-decode scaling & bit-exactness check). - Added
--fast,--plain,--json, and fail-closed--againsttotools/serve/agent_bench.py, and--fast(8-step prefix-compatible regression preset) totools/serve/session_bench.py. - Added
test_multi_runs_gpu,test_engine_draft_all_gpu,test_ink2_batch_gpu, and expandedtest_draftandtest_moe_route. Full verification: all host tests, ASan/UBSan/LSan, TSan, 102/102 API tests, 80/80 installer tests, 117/117 GPU tests ongfx1151, 9/9session_bench.py --fastreplays, and 5/5 full 4×8agent_bench.pyruns.
- Added
osmos [0.19.0]: runtime audit — structural cleanup, correctness fixes, and hot-path optimizations
Every pack's answers are unchanged, token for token: all 6 packs match 0.18.2's speed-harness hashes (drafted == plain),
and all 9 recorded 122-step agent sessions (6 greedy + 3 sampled; 1,098/1,098 steps) match 0.18.0's baselines and
drafted == plain bit for bit.
- Measured performance (
performanceprofile; prior README baseline in parentheses):- Speed (~3K prompt; drafted code / prose; plain code / prose):
qwen38-ud-iq3_xxs963 (954) prompt, 51.5 / 44.2 (51.1 / 43.8) drafted, 30.9 / 31.0 (30.7 / 30.7) plain;osmos-evo-1017398 (377, +5.5%) prompt, 28.5 / 23.8 drafted, 18.6 / 19.1 plain;hy4-flash480 prompt, 27.2 / 25.0 (27.0 / 24.8) drafted, 19.0 / 19.0 (18.8 / 18.8) plain;inkling-2-mini1,254 prompt, 46.0 / 42.6 (45.9 / 42.4) drafted, 29.0 / 29.1 plain;osmos1.7b5,706 prompt, 96.5 / 96.1 (95.3 / 95.4) plain;osmos-evo-inkling370 prompt, 21.3 / 20.2 drafted, 16.3 / 17.2 plain. - Recorded 122-step agent session (
session_bench.py, vs 0.18.0):qwen38-ud-iq3_xxs60.4 / 29.0 (59.5 / 29.0) tok/s;hy4-flash33.5 / 17.7 (33.0 / 17.7);osmos-evo-inkling23.8 / 13.3 (17.7 / 13.7, +34.5% combining 0.18.1's overlapped reads + 0.19.0's cleanups);inkling-2-mini49.7 / 22.5 sampled (49.6 / 22.4), 54.5 / 22.5 greedy;osmos-evo-101741.9 / 19.0 greedy, 35.3 / 19.0 sampled (~500 MiB leaner GPU memory);osmos1.7b82.8 greedy, 71.0 sampled. - Agents (4 at once, 8 turns; vs 0.18.0):
osmos1.7b88.6 s (92.0–93.3 s, -4.4%),qwen38-ud-iq3_xxs187.7 s (191.5–192.0 s, first-token p50 2.28 vs 2.7–2.8 s),inkling-2-mini201.4 s (204.5 s),hy4-flash418.7 s (428.3 s, -9.6 s on identical 7,292 tokens),osmos-evo-1017426.0 s at 110.4 GiB budget (dense build 27.0 vs 28.2 GiB; first-token p50 6.19 vs 6.92 s, turn-done p95 84.1 vs 91.2 s). - TTFT (later starts):
hy4-flash15.5 s (15.7),inkling-2-mini3.9 s (3.9),osmos-evo-inkling19.3 s (19.3),osmos1.7b0.8 s (0.8),qwen38-ud-iq3_xxs14.7 s,osmos-evo-101721.0 s.
- Speed (~3K prompt; drafted code / prose; plain code / prose):
- Shared runtime primitives:
osmos/run/draft.h(draft_accept): NaN-safe speculative cutoff shared across all five drafters, plus Q4x MTP
vocab-size validation and a single-sync pinnedOverflowFlagread across all six families.osmos/mem/moe_stage.h(MoeStage): shared compact async pinned routing-table staging replacing per-family
staging in DS4, Ink2, Hy4, and streamed Q4x.- Family parity: Q4x gathers only kept LM-head rows into dead
b->gabefore projection; LFM3 defers trailing
LSAclose_blocksand respectshonor_prompt; Q35 gainsLsaCloser, batched block closing, dense bypass below
sparse_from, YaRN bounds validation, and exactq35_lsa_rollback.
- Correctness, concurrency, and memory safety:
- API, serve, slots: fixed
engine_run()heap overflow, mutex races one->dead/e->in_fd/max_ctx,
SO_RCVTIMEOEDOMhandling, NULL/empty answer buffers,ctx_of()overflow,request_tools()error propagation,
speculative decode +1 over-generation atmax_ctx - 1,multi.cduplicateridand error handling,
conv_cancel_read()stale prompt clearing, and content-hashed slot filenames inslots_put.c. - Memory, CPU, NPU, model, text: fixed
membrane_endleaked holds,pool.cO(N) pinned scans /now == 0
stale pass / dead-spare eviction order /fstatcaching,cpu/lane.cquantization overflow,cpu/q8.c
pthread_onceinit, DS4/Hy4rowstream_waitandtap_n/vocab_rowschecks,gguf_inttype and bounds checks,
weights.coverlay slice bounds,arena.c/dspark_index.coverflow guards,EINTR/short-read I/O loops,
npu_xrt.cppdmabuf leak and safe BO launch/wait, BPE stack fast-path and OOM propagation,fit.cbracket
inversion guard, andoseq_draft_allerror clearing. - Model families and kernels: fixed Q4x
q4x_kept_view/moe_sidestream race /q4x_npu_takeerror return /
expert type checks /pend_posvalidation; Ink2 reset/rollback/seed state andink2_moe_prepbounds; Hy4 Q8_0
type validation, F32 drafter weights, and error sync; LFM3/Q35 YaRN overflow andlsa_closer_queueerror sync;
mv_fp4alignment gate;MXFP8unaligned-safe loads;attn_coreFA(8,4)and static LDS accounting; NaN-safe
order()/order_key()inattn.hip/hy4.hipandbf16_rninmm_fp4.hip;ops_index_score_rowsFMA dispatch;
q8.hkSelAllcount guard;round.hnon-finiteue8m0_code; wave-shuffleroute.hipscan; and CUDA
compatibility (!osmos_cudaguard,hipDeviceAttributeMultiprocessorCount,__shfl_up). - Review follow-ups:
slots_putdrops the new entry by name when a trim fails (not whatever was moved to the
last index);tokenizer_encode_shapedrefusesraw()'s out-of-memory-1;q4x_npu_takeselects from a
streamed layer's compact tables; DS4rest_entriesstaging overflow refused, not read as no entries; a drafter's
failure ends only the lanes drafted; Ink2 rollback keeps the drafter's context for cuts of a block or less
(mlast_okgates a draft until the next seed).
- API, serve, slots: fixed
- Wasted work and hot-path optimizations:
- GPU kernels: skip idle waves in
attn_core_heads.h; halvev_dot4calls for zero-offset quant formats in
q8.h; gateselect.hcand[]gather onbin_n <= kCandCap; size sparse MLAsplitsbysel_cap * pool;
early-exithy4indexer counts/selection andattn_core_q35.hunused splits; drop 3 barriers inmoe_tiles.hand
a duplicate barrier inattn_core_draft.h; bisecttop_kin raw logit space inops.hipwith oneexpfpass. - Serving and engine: stop draft sampling on the first mismatch; skip
oseq_draft_allwith 0 slack and
osmos_greedywhen all lanes sample; stream-localops_samplewithouthipDeviceSynchronize(); direct host-state
slot save viaoseq_mark_is_state()without a GPU round-trip; read-onlytokenizer_has_special()fast path in
osmos-apito avoid deep JSON clones on clean requests. - Model families and loading: skip non-last DS4 LM head, zero-row
ops_hc_pre_rms, unused prefillMoeStage
tables, redundant compressor kernels, whole-residentfwd_guess, empty 64 MiB repack stage, and layer-0 guess
routers, plus spin-wait in DS4 drafter rounds; hoist Hy4 MLA Q/RoPE out of therunsloop, pairsh_gate+
sh_up, drop ~560 MB unused DFly2head8, skip BF16output.weightupload when Q8_0 head replaces it, lazily
allocatepin_logits, free convertedf->devtensors, and size Engram scratch for one layer; trim Ink2 double
ops_rms_x16_many, full-vocab logits copy, and padded drafter rows; trim Q4xexperts()redundant launch, NPU
down-pack size, MTP seed inject, unused PLE buffers, and padded DFlash rows; clamp the finalresident.carena to
exact remaining bytes (saving ~1.2 GiB on DeepSeek dense builds); reserveFIT_SLACKinexperts_fit_now()for
hipHostRegisterpage-table overhead; keep one open shard fd during upload; single-pass Q8_0 LM head quantization
viaq4x_kv_put(v=NULL).
- GPU kernels: skip idle waves in
- Tests: added
test_draft,test_moe_stage,test_slots, plus regression coverage intest_gguf,test_pool,
test_fit, andtest_resident. Full verification: all host tests, ASan/UBSan/LSan, TSan, 102/102 API tests, 80/80
installer tests, and 114/114 GPU tests ongfx1151.