Skip to content

Releases

osmos [0.22.3]: `osmos-evo-hy4` - Hy4-flash closer to its release and faster plain, on AngelSlim's Q3_K

Choose a tag to compare

@github-actions github-actions released this 03 Dec 15:12
94a1a1a

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 --fast 31.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, as hy4-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 --serve fetches 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 in test_hy4_probe_gpu); tools/bench/hy4_calib (GPTQ sums, the experts'
    imatrix) and hy4_run DUMP=; the oracle's hy4_forward --release / --ids / --logp-out; tools/convert/patch_gguf.py
    (one replacements writer for every family, was ink2_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

Choose a tag to compare

@github-actions github-actions released this 03 Dec 05:10
688532e

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 of osmos-evo-1017 (the default) or
    any ud-* 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_folder fails 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

Choose a tag to compare

@github-actions github-actions released this 02 Dec 20:36
71478ac

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 of tools/api/main.c):
    • quantization (beside id, 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's osmos- 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 read IQ2_S+..., not its table's IQ4_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_type first: 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, and quantization is
    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's Gguf), gguf_values, and
    gguf_overlay_fits - the overlay rule (each tensor one of the model's, same dims) now one function for
    weights_create and the report; GGUF_ENGRAM_TABLE names the table where four literals did. A report that cannot be
    read (a shard or the overlay missing, an overlay that does not fit, a general.file_type that is not a u32) is
    said on stderr and its fields left out - unknown, as before - and osmos-api serves 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_type raw / 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.py Models, 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's host + sanitizers jobs in an ubuntu:24.04
    container with first shards only (122 API tests, 19 skips by design incl. the three real-pack classes;
    ModelsFirstShard ran; 80/80 installer tests), /v1/models on all 8 installed packs, test_weights /
    test_q4x_weights overlay refusals unchanged on huihui's real patches, test_overlay_q4x_gpu (same bits). Not run:
    the full GPU suite - no engine or kernel change (the weights.c overlay 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

Choose a tag to compare

@github-actions github-actions released this 02 Dec 15:20
bcae02a

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 (performance profile, 128 GB Strix Halo, 0 hash diffs):
    • qwen38-ud-iq3_xxs @ shipped 512K (P=4, auto shared pool vs v0.21.2-equiv 4×512K static KV): KV pool drops 30.88 -> 7.72 GiB (-23.16 GiB, 4.0×), keeping Qwen 100% resident in GPU RAM (97.10 GiB, 9.27 GiB left free) instead of streaming experts off SSD — boosting decode_bench.py S=4 drafted 53.4 -> 84.1 tok/s (+57.5%) and cutting 4-agent agent_bench.py --fast wall 33.4 -> 12.5 s (2.67× faster, -62.6%) (p95 TTFT 10.04 -> 3.31 s, p95 turn done 20.14 -> 5.68 s, 12/12 bit-exact).
    • osmos-evo-inkling @ shipped 512K q8/q8 (P=4 A/B & new S=8): KV pool drops 42.00 -> 10.50 GiB (+31.50 GiB reclaimed straight back into resident experts) — boosting decode_bench.py S=4 drafted 10.3 -> 27.3 tok/s (+165%, 2.65×) and cutting 4-agent agent_bench.py --fast wall 145.2 -> 69.8 s (2.08× faster, -51.9%) (p50 turn done 48.52 -> 20.23 s, 12/12 bit-exact). Unlocks S=8 @ 512K q8/q8 (previously 84 GiB KV OOM): decode_bench.py S=1/2/4/8 plain 13.2 / 20.3 / 26.9 / 23.2, drafted 14.7 / 22.6 / 26.9 / 19.9 tok/s (0 diffs).
    • inkling-2-mini @ shipped 1M q8/q8 (S=1/4/8): previously ~168 GiB OOM at S=8, now shares one 1M pool (~21 GiB) and decodes at 28.9 / 58.1 / 81.9 tok/s plain and 35.5 / 73.1 / 97.9 tok/s drafted (bit-exact vs v0.21.0). Full 4×8 agent_bench.py @ 131K hit 151.2 s (flat vs v0.21.2's 151.1 s, 2.62 GiB shared KV, 32/32 bit-exact).
    • hy4-flash @ shipped 1M (S=1/4/8 & P=4): previously OOM at both P=4 and P=8, now fits in one 10.88 GiB shared 1M pool (96.98 GiB total, 12.75 GiB free), decoding 18.4 / 44.2 / 52.1 tok/s drafted (S=1/4/8, bit-exact vs v0.21.0) and completing 4-agent agent_bench.py --fast in 21.3 s (12/12 drafted == plain).
    • osmos-evo-1017 @ shipped 1M (P=4): shared 1M pool takes 0.87 GiB (109.41 GiB auto budget), 56.6 s agent_bench.py --fast (12/12 drafted == plain).
    • osmos1.7b @ shipped 256K (S=1/2/4/8): throughput_bench.py hit 96.5 / 172.1 / 277.6 / 363.9 tok/s (3.77×), S=8 wall 45.3 s (faster than v0.21.0's 47.5 s @ 32K, 6.6 GiB GPU, 8/8 held + 8/8 SSD slot reuse, 0 hash diffs).
    • Single-stream (S=1) flat & bit-exact: all 10/10 session_bench.py --fast replays across all 6 core packs (9 greedy/sampled vs session-180 + shipped 512K q8/q8 osmos-evo-inkling drafted == 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, and kv_pool_shuffle for non-contiguous page verification), and paged StatePart streaming save/load preserving the existing Slots wire format and FNV-1a checksums verbatim.
    • Added paged block_table + page_size indirection across all six attn_core attention 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), keeping fa_interior_kernel at <= 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.
  • 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 shared KvPool (coupled phys page IDs across layers/indexers/drafter) while keeping O(1) sliding rings, DeltaNet/conv states, and fixed-window drafter rings per sequence; zero ledger leaks across all 8 packs in test_engine_ledger_gpu.
    • Added O(1) lightweight mark_save / mark_load for lfm3 (LM3K, safely joining lsa_closer, un-closing blocks past h.closed, and trimming pages while rejecting YaRN stage crossings), hy4 (HY4K), and ds4 (DS4K), matching ink2, q4x, and q35 and reclaiming tail pages on rollback/mark-load.
  • Engine, osmos-serve, and osmos-api pool 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 (default auto = max(max_ctx, lanes * 512)), --kv-gb G, and osmos.json "kv_tokens" / "kv_gb" (logging NOTE 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 LRU IDLE lanes into Slots; Tier 2 enforces strict FIFO m->wait[0] admission with committed-reading accounting, prefill pacing, and decode page reserve + draft-boundary capping; Tier 3 losslessly preempts the youngest READING lane back to the front of wait[0] (0 tokens emitted); Tier 4 runs pre-flight ensure_decode_pages before emitting tokens and refuses only the youngest ANSWERING victim with ERR <rid> KV cache pool full (never FATAL, siblings finish bit-exact).
  • 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_pages now counts the pages held by ANSWERING lanes that end this round (they go IDLE and are reclaimed before the batch retries) and picks its victim only among lanes that step (kv_pool_test.py tier4_end).
    • Reading lanes could starve each other or preempt older readers: can_read_piece is 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.py readers, 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_full reported 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_gpu window_seeded).
    • Hy4 draft fault leaked tail pages: trimmed when the stream drained, the sequence marked broken otherwise.
    • --kv-tokens parsing shared and bounded: kv_tokens_parse (auto or N|Nk|Nm, 512 to UINT32_MAX) in both tools; osmos-api gains --kv-tokens auto and --kv-gb, refuses both at once, and osmos.json kv_tokens must be an integer in range.
  • Verification: 48/48 host tests (make tests, including test_kv_pool), ASan/LSan/UBSan (make asan), TSan (make tsan), 117/117 API tests (make api-test, including KvTokens / KvGb), 80/80 installer tests (test_install.py), 120/120 GPU tests (make NPU=0 gpu-tests: 113 ran + 7 expected skips, including 336/336 attn_core checks, 8/8 test_engine_ledger_gpu, 7/7 test_engine_state_gpu), live NPU=1 XDNA 2 E2E tests (test_npu_pack_gpu + test_npu_live_gpu Qwen3.8 & LFM3), tools/serve/kv_pool_test.py (all 4 tiers + --kv-gb), turn_test.py across 4 families, parallel_test.py, slot_test.py, fill_test.py, 10/10 session_bench.py --fast replays, 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

Choose a tag to compare

@github-actions github-actions released this 01 Dec 19:31
75d0e1c

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 512K q8/q8 KV (tools/install/packs.json):
    • Updated settings to max_context: 524288, kv_q8: true (temperature: 1.0, wiki_kld: 0.1959).
    • Measured A/B: q8/q8 vs q8/q5 KLD 0.195901 (85.47% top-1) vs 0.196627 (85.76%); 512K q8/q8 recalled 10/10 planted + 1/1 unplanted across 511,199 tokens (12.61 tok/s sustained prose decode at 511.8K, auto-sized 98.0 GiB budget, minAvail 8,159 MiB) vs 256K q8/q5's 8/10 + 1/1; session_bench.py --fast at 512K q8/q8 ran at 34.6 tok/s median drafted decode (17.1 plain, 2.02×), ~356 tok/s step-0 prefill, 8/8 drafted == plain, 0 loops, flat 24.3 GiB GPU memory.
  • 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 existing c.part scratch to fa_tail_kernel (fa_body<..., TAIL=true>), with fail-closed fallback to 1-pass fa_kernel when scratch is unavailable.
    • Dropping rel/rel_proj/cmin/cmax/window/gate state from the interior loop cut 127 VGPR spills -> 0 spills across all 6 instantiations (236–239 VGPRs, 45,824 B LDS), holding full qa[8] and gmr[8]/glr[8] in registers (0 ds_bpermute), raising ST=3 (all 768 threads active on fetch/dequant), disabling sub auto-unroll (#pragma clang loop unroll(disable)), splitting 8-row branchless expf(s - mn) ILP, guarding PV rescaling with if (__any(any_chg)), and ping-ponging bv_c/bv_n LDS loads behind PV WMMAs.
    • Measured (-O2 -ffp-contract=off, performance profile, 0-ULP bit-exact across 101/101 test_attn_core_gpu, 34/34 fa_microbench hashes, and 5/5 real-model ink2_engine logit dumps via cmp):
      • Kernel (fa_microbench, 524K q8q8): Mini 2,057.4 -> 1,141.9 ms (12.78 -> 23.02 TFLOPs, 1.80×), Small 4,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-mini 128K 138.8 -> 125.3 s (1,046.4 tok/s, +10.8%), 256K 398.7 -> 337.8 s (776.1 tok/s, +18.0%), 512K 1,247.1 -> 1,002.6 s (522.9 tok/s, +24.4%, −4.1 min); osmos-evo-inkling 128K 555.7 -> 503.8 s (260.2 tok/s, +10.3%), 256K 1,160.0 -> 1,111.8 s (235.8 tok/s, +4.3%).
  • Correctness & SCOPE.md resource-ownership hardening (13 fixes, failing tests first):
    • Reverse-order DS4 NPU teardown (fwd_npu_destroy before host_slots_destroy in src/ds4/hip_ds4_make.c), plus NULL-safe say(), bounded non-hanging drain of remaining in-flight xrt::run handles on npu_wait() / npu_submit() errors (wedging the context and leaking its buffers in npu_close() if a run outlives the drain instead of freeing memory the NPU may still write), and one-time XCL_BO_SYNC_BO_TO_DEVICE CPU-cache flushes on npu_open() / npu_device() / npu_region() so kernel-zeroed fresh hipMalloc pages (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-safe err in src/model/safetensors.c, routing LFM3 lsa_load() (src/lfm3/hip_lfm3_make.c) through st_create() for full bounds/shape validation; NULL-safe err in src/text/json.c and src/text/chat_ink2.c.
    • Input token bounds checks [0, n_vocab) in src/q4x/hip_q4x_step.c and src/q35/hip_q35_step.c; n && !except, finite temperature > 0, top_p in (0, 1], and static const float ninf in src/run/hip_engine.c.
    • Partial-startup teardown (serve_unbuild + goto cleanup in tools/serve/{main,build}.c) and fail-closed oseq_save() handling in conv_set_aside() (tools/serve/conv.c).
    • Error-path fd/mutex/cond/child cleanup in engine_start() and EINTR-safe write() in engine_run() (tools/api/engine.c); duplicate Origin: refusal (400, tools/api/http.c); explicit ram_gb: 0 / days: 0 forwarding (tools/api/config.c); non-array tools refusal, OOM propagation in request_format() and request_ink2(), non-string LFM3 reasoning_effort refusal, and -O1-safe snprintf truncation cap in tools/api/chat.c; OOM-safe buf_same() in tools/api/loop.c and allocation-free drain on s->gone in tools/api/reply.c.
  • 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 into tools/serve/multi.c (deleted 319-line tools/serve/single.c).
    • Added shared stdlib-only tools/install/gguf_scan.py (used by gguf_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, shared experts_plan / gguf_meta_get_u32 / read_picks helpers, unified single/multi-run attention & kernel launch templates (kernels/), and tools/bench/bench_common.h.
  • 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-inkling 93.9% / 97.0% / 95.0%, hy4-flash 93.3% / 98.0% / 95.0% (153/153 finished HE), inkling-2-mini 92.1% / 96.0% / 80.0%, osmos-evo-1017 90.9% / 99.0% / 85.0% (149/149 finished HE), qwen38-ud-iq3_xxs 90.2% / 97.0% / 85.0% (148/148 finished HE), osmos1.7b 67.1% / 94.0% / 70.0% (508.2 / 481.0 agg tok/s).
    • Max-context multi-needle (10 planted + 1 unplanted) & KL/PPL: hy4-flash 10/10 + 1/1 @ 1,014K (21.45 tok/s), inkling-2-mini 10/10 + 1/1 @ 1,014K (10.68 tok/s, KL 1.11e-3), qwen38-ud-iq3_xxs 10/10 + 1/1 @ 508K (36.45 tok/s, YaRN PPL 2.0278), osmos-evo-inkling 10/10 + 1/1 @ 511K (12.61 tok/s, KL 0.1959), osmos1.7b 9/10 + 1/1 @ 250K (3,776 prefill / 83.70 tok/s decode, KL 0.00034), osmos-evo-1017 7/10 + 1/1 @ 1,013K under effort=high (20.80 tok/s, PPL 1.8758; controlled diagnostics confirmed zero engine/KV/drafter bugs — plain == drafted, ud-iq2_xxs 10/10 at 14.6K & 59.8K, osmos-evo-1017 10/10 at 14.6K & 59.8K under shipped effort=max, 40/40 LIST_ALL, and 4/4 pushback).
  • 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/101 test_attn_core_gpu), live NPU=1 XDNA 2 tests (Qwen/LFM3/DS4), 9/9 session_bench.py --fast replays + post-kernel Inkling Mini (greedy + sampled) & Small (q8/q5 8/8 0 diffs; 512K q8/q8 8/8 drafted == plain), and 4×8 agent_bench.py on inkling-2-mini (32/32 turns bit-exact vs 0.21.0, 28/28 in-place, 151.1 s wall).

osmos [0.21.1]: Inkling-2-Mini DFlash2 drafter, `GET /metrics` Prometheus exposition & loop/KV-eviction observability

Choose a tag to compare

@github-actions github-actions released this 30 Nov 16:31
e3dbc38

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.py with --name and optional dflash2.final_logit_softcapping / dflash2.selector_softcap_mode metadata; converts incoai/Inkling-2-Mini-DFlash2 (model.safetensors, 81 BF16 tensors) into a 0.53 GB Q8_0 GGUF.
    • Extended Q4xDflashGeometry / Q4xDflashTarget, q4x_df_softcap + q4x_df_select(..., post_softcap) (kernels/q4x_dflash.hip), and hip_dflash_core.c for unpadded valid_vocab (200058 vs padded 201024), post-final-norm last tap (final_tap), and before_correction / after_correction logit softcapping (30.0) with calibrated confidence scores.
    • Wired DFlash2 onto Ink2Forward (Ink2Options.dflash, mutually exclusive with mtp) with isolated f16 staging and overflow flags, Ink2's embed_norm on anchor and mask embeddings, padded-to-valid head slicing, and automatic dflash2 GGUF detection in osmos_ink2 (--dspark / osmos.json "drafter").
    • Measured on inkling-2-mini (performance profile, bit-exact drafted == plain):
      • GSM8K + HumanEval + MT-Bench (T=1.0, seed=42, identical 739 tokens): 52.6 tok/s vs DSpark MTP 45.7 tok/s (+15.1%; GSM8K 67.3 vs 58.8, HumanEval 61.6 vs 51.5, MT-Bench 39.3 vs 34.8; 3.21 vs 2.55 tok/round, draft pass 7.73 ms vs 7.49 ms).
      • session_bench.py --fast --sampled (max_context = 1M): 8/8 bit-exact vs 0.18.0 baseline, median decode 81.7 tok/s (MTP 81.6), wall 28.9 s (MTP 29.2 s), GPU memory 27,256 MiB vs MTP 31,136 MiB (-3.9 GiB per sequence at 1M context, because all 5 DFlash2 layers cap rings at 2,080 rows = 81 MiB vs MTP's full-context layer-2 K/V ring = 4,096 MiB; at 4K context in test_engine_ledger_gpu, footprints match closely: built 21,502 vs 21,462 MiB, two sequences 23,918 vs 23,766 MiB).
      • decode_bench.py (S=1,2,4,8 greedy, bit-exact): 35.3 / 46.9 / 59.7 / 66.7 tok/s (DFlash2 runs single-sequence per draft pass via engine_draft_each, as on Qwen3.8; DSpark MTP remains batched for multi-lane S=8).
  • GET /metrics Prometheus exposition in osmos-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-8 using 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) plus osmos_prompt_reuse_total{model_name,via} and osmos_loop_stuck_total{model_name}, built directly from PP and DONE lines already parsed by tools/api/engine.c (no osmos-serve protocol break).
    • Lifetime counters accumulate once under Engine.mu when a run ends, tracking computed tokens reported by PP so requests cancelled while queued do not inflate prefill counters; serves 200 while loading (zeros), refuses non-GET (405), and inherits the existing Origin and loopback Host security checks (403).
  • 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-empty content and, for turns with tool_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; stuck at >= 3), upgraded unchanged_repeats to compare whole multi-call assistant turns (calls[], results[]) as a unit alongside single-call runs, and removed dead LOOP_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, stuck at >= 3; the token ids, and when sampled the temperature, top_p, top_k and 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 in osmos.loop and x-osmos-loop, and stuck=1 is logged to stderr and counted in osmos_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, including slots_room's with no slots folder), NOTE slots: evicted ... and NOTE 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-prompt header on non-streaming), and SSE : osmos-prefill via=... reused=... done=... total=... ms=... comments on multi-chunk prefills (preserving : keep-alive and clean single-chunk SSE streams).
  • 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, and tests/api/test_api.py (Metrics, LoopAndPrefill), and added tests/gpu/test_ink2_dflash_gpu.hip (mutual exclusion, seed/load invariants, greedy/sampled T=1.0 and S=2 bit-exactness).

osmos [0.21.0]: bit-exact single-stream speedups & XDNA 2 NPU redesign

Choose a tag to compare

@github-actions github-actions released this 30 Nov 13:53
f527a7b

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, performance profile; 0.20.1 -> 0.21.0, all 6 packs 8/8 diff: ok bit-for-bit):
    • osmos1.7b (sampled): prompt 5,368 -> 5,649 tok/s (+5.2%), median decode 77.1 -> 92.3 tok/s (+19.8%), wall 11.3 -> 10.0 s (-11.4%).
    • osmos-evo-inkling (drafted, sampled): prompt 344 -> 378 tok/s (+9.7%), median decode 28.6 -> 35.9 tok/s (+25.4%), wall 95.0 -> 84.9 s (-10.6%).
    • hy4-flash (drafted, greedy): prompt 498 -> 554 tok/s (+11.2%), median decode 35.1 -> 35.7 tok/s (+1.9%), wall 46.1 -> 41.8 s (-9.4%).
    • osmos-evo-1017 (drafted, sampled): prompt 205 -> 241 tok/s (+17.4%), median decode 41.1 -> 41.7 tok/s (+1.6%), wall 77.2 -> 72.0 s (-6.8%).
    • inkling-2-mini (drafted, sampled): prompt 1,291 -> 1,393 tok/s (+7.9%), median decode 79.1 -> 81.6 tok/s (+3.2%), wall 29.7 -> 28.3 s (-4.5%).
    • qwen38-ud-iq3_xxs (drafted, greedy): prompt 868 -> 914 tok/s (+5.2%), median decode 67.6 -> 68.8 tok/s (+1.8%), wall 28.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-reduction ops_sample + batched ops_sample_batch() (one launch + one sync for drafted verify blocks; verified bit-exact in test_sample_gpu). Greedy, top_k and top_p: 1 draws are the bits of 0.20.1's; top_p < 1 on a vocabulary past 4,096 now cuts on fixed-point mass (2^-40 steps) instead of a float bisection, so a token at the nucleus' edge can differ from 0.20.1's for the same seed - still deterministic, drafted == plain (every shipped pack's default is top_p: 1).
    • Attention & fused GEMM epilogues: halved prompt stage ST 4 -> 2, Wave32 half-split Q fragments via ds_bpermute (kQHalf), and per-wave LDS relative-bias caching (kRelLds) in kernels/attn_core_kernel.h; fused ops_rms_add_rms_x16, ops_rms_x16_ctrl_many, and ops_swiglu_x16_rows (test_fuse_gpu); tuned mm.hip / q8.h (test_mm_gpu).
    • Per-family hot paths: parallel CPU lsa_block() closing in src/lsa/hip_lsa_close.c; fused Hy4 hy4_rms_hc_post, hy4_head_meta, hy4_scatter_f32, and multi-block hy4_dfly_pick_fast; multi-block q4x_top_fast and q4x_df_rope_from; Ink2 loop-control fusion and gpu_stream_wait spin-wait (src/run/hip_gpu.c); streamlined DS4 draft round overlap.
  • 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-aligned mmap + MADV_HUGEPAGE + MADV_POPULATE_WRITE for host expert slots >= 2 MiB under --npu (512x fewer IOMMU walks; without --npu the slots stay plain 4 KiB pages, as 0.20.1); pre-allocated a_sub sub-BOs, async npu_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_even across all kernels (-35% RMSE, -34x bias); 8-col single-pass SPLIT_MATS Qwen gate+up with compact 2 KiB iq3xxs_grid4.h (iq3xxs 573 -> 301 us / 1.90x, iq4nl-down 403 -> 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 concurrent S=2 batching (stamped "NPU2" identity). Added 2x skew headroom (DS4_NPU_MAX_BATCH = 192) eliminating DS4 overflow stalls. Live 8K prompts: osmos-evo-1017 630 -> 646 tok/s (+2.5%, OSMOS_NPU_SHARE_DS = 0.08f); qwen38-ud-iq3_xxs 938.1 -> 947.0 tok/s (+1.0%, OSMOS_NPU_SHARE_QWEN = 0.06f).
    • Dense Q8_0 -> BFP16 offload on osmos1.7b (q8-dense-gu/, src/lfm3/, src/run/hip_engine_lfm3.c, tools/npu/build.sh, tools/install/packs.json): 8-col SPLIT_MATS (NR=32, PASSES=2, M=256) computes [0, 1024) FFN gate+up with direct strided ROWMAJOR drain and non-blocking f->npu_st pack overlap. Live 8K prompts: 7,038 -> 7,118 tok/s mean (peak 7,163.8 tok/s, +1.1–2.7%), 2,047-token dPPL = +0.0262% / mean KL = 0.000122 / 64/64 identical greedy tokens, and 0 differing bits across splits, batching, and max_tokens=128. Documented 0-ULP bit-exact Q8_0 hardware proof (0 / 262,144 bits) and GPU mm_f16 roofline trade-off in spikes/npu/RESEARCH.md. Updated packs.json npu-ds, npu-qwen, and new npu-lfm3 (wired to osmos1.7b) to the v0.21.0 kernel tarballs.
  • Full deterministic benchmark sweep (v0.21.0, performance profile; 0 hash diffs vs v0.20.0 / v0.18.0 baselines):
    • decode_bench.py (8 packs, 2K prompt / 128 decode, bit-exact): osmos1.7b plain 101.0 → 544.6 (S=1 up from 95.2), qwen38-ud-iq3_xxs drafted 40.1 → 109.6 (was 39.7 → 106.7), inkling-2-mini drafted 35.7 → 98.6 (liberated 103.3, liberated-s 99.2), hy4-flash drafted 54.0 (was 52.5), osmos-evo-1017 drafted 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.7b 96.2 / 171.7 / 272.5 / 361.3 (S=8 wall 49.8 → 47.5 s), qwen38-ud-iq3_xxs drafted 76.1 / 64.8 / 72.3 / 75.7 (S=4 63.5 → 72.3, S=8 70.6 → 75.7), inkling-2-mini drafted 37.6 / 39.4 / 52.5 / 57.4 (plain S=8 50.9 → 52.4), hy4-flash drafted 29.4 / 31.4 / 32.8 / 35.4 (S=8 wall 350.7 → 329.1 s), osmos-evo-inkling drafted 22.5 / 22.3 / 18.6 (S=1 19.5 → 22.5, S=2 20.6 → 22.3).
    • agent_bench.py (4×8 agents, 32/32 turns answered, 28/28 in-place): osmos1.7b 75.5 s (was 78.2 s), inkling-2-mini 151.4 s (was 162.2 s, -6.7%), qwen38-ud-iq3_xxs 181.2 s, hy4-flash 359.0 s (was 383.1 s, -6.3%), osmos-evo-1017 453.7 s (106.3 GiB budget; p50 TTFT 8.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.0 baseline bit-for-bit.
  • Investigated inkling-2-mini high-effort looping report: audited chat_ink2.c (Thinking effort level: 0.2/0.7/0.9/0.99, byte-exact vs transformers), request.c/answer.c/ops_sample, and kv_q8 fidelity (KL 1.1e-3, 64/64 top-1 vs llama.cpp F16 KV in test_ink2_loop_gpu), and ran live PR-review + spike-test prompts on inkling-2-mini at shipped defaults (temperature: 1.0, kv_q8: true, int8: false) across low (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 (though high effort naturally thinks for ~9K–10K tokens before answering, and client overrides such as "temperature": 0 or truncated max_tokens / dropped reasoning_content can make Inkling-2-Mini loop-prone). Users who hit a reproducible loop are encouraged to open a GitHub issue with the request payload and osmos-api log.
  • 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 expanded test_npu_pack_gpu, test_sample_gpu, test_fuse_gpu, and test_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), live NPU=1 E2E determinism + ledger tests on gfx1151 + XDNA 2, and all 3 tools/npu/build.sh kernel sets (ds, qwen, lfm3).

osmos [0.20.1]: liberated Inkling-2-Mini packs & upstream `inkling2_loop` support

Choose a tag to compare

@github-actions github-actions released this 29 Nov 16:13
84042f8

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 (rig id inkling-2-mini-liberated, alias mini-lib, gpu_gib: 10): native NVFP4 / MXFP8 experts and BF16 dense weights converted bit-exact via tools/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 (performance profile): decode_bench.py 2K 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 --plain 12/12 turns drafted == plain bit-for-bit (13.3 s wall).
    • inkling-2-mini-liberated-s (rig id inkling-2-mini-liberated-s, alias mini-lib-s, gpu_gib: 7): Q2_0-hybrid (Q2_0 outer layers 0–5 & 18–23, NVFP4 looped core layers 6–17, Q8_0 dense/embed/head; 12.15 GB file, 5.99 GiB smallest build, 14.10 GiB full resident). Measured (performance profile): decode_bench.py 2K 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.py drafted 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 --plain 12/12 turns drafted == plain bit-for-bit (11.7 s wall).
    • int8 A/B on Q2_0-hybrid: while int8 on led pure 128-token decode_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.py S=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 --fast 11.7 vs 13.1 s) and avoids reads apart answer re-reads and extra int8 activation quantization noise on top of Q2_0.
  • Upstream inkling2_loop GGUF dialect & attn_rel_bias.weight fix:
    • Added INK2_KEYS_UPSTREAM_LOOP in include/osmos/ink2/weights.h, src/ink2/geo.c, src/ink2/weights.c, and src/ink2/hip_ink2_resident.c (physical block_count, loop.{count,start,end,gate_rank,varying} with variable loops refused fail-closed, per-layer blk.L.loop_msg_query.weight and loop_{q,k,v,ffn}_ctrl_{down,gain,forget}.weight), dispatched inkling2_loop in src/run/hip_engine.c, and registered inkling2_loop on Inkling's chat dialect in tools/api/dialect.c.
    • Fixed latent missing transpose of upstream attn_rel_bias.weight ([extent, d_rel] -> [d_rel, extent]) in src/ink2/hip_ink2_resident.c (up_rel_proj(), verified maxdiff = 0 against reference).
  • Tests: expanded tests/test_ink2_mini_weights.c (upstream inkling2_loop geometry, fused Q2_0/NVFP4 layers, and 9 fail-closed mutation checks), tests/api/test_api.py (InklingLoopApi), and tools/install/test_install.py (pack set, gpu_gib, sampling, files, rig ids & unique aliases).

osmos [0.20.0]: multi-lane throughput — batched decode, batched drafters, and bit-exact multi-stream scaling

Choose a tag to compare

@github-actions github-actions released this 29 Nov 13:52
fc2680d

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 (performance profile; 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.7b plain 95.2 -> 543.8 tok/s (5.71x); qwen38-ud-iq3_xxs plain 30.0 -> 96.5 (3.22x), drafted 39.7 -> 106.7 (2.69x); inkling-2-mini plain 28.6 -> 81.2 (2.84x), drafted 34.7 -> 96.0 (2.77x); osmos-evo-1017 plain 17.3 -> 62.0 (3.58x), drafted 27.4 -> 64.7 (2.37x); hy4-flash plain 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.7b 78.2 s (88.6 s, -11.7%; turn done p50 6.5 vs 8.1 s), inkling-2-mini 162.2 s (201.4 s, -19.5%; turn done p50 10.2 vs 18.4 s), qwen38-ud-iq3_xxs 178.0 s (187.7 s, -5.2%; turn done p50 9.7 vs 19.0 s), hy4-flash 383.1 s (418.7 s, -8.5%; turn done p50 37.3 vs 44.4 s), osmos-evo-1017 433.7 s at 109.2 GiB budget (426.0 s at 110.4 GiB; turn done p95 83.9 vs 84.1 s).
  • 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). Pipelined q8.h input loads and width-tuned osmos_waves_per_eu occupancy (kGroupWaves, kGateUpWaves, guarded behind #if defined(__HIP__) in kernels/port.h for 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): added attn_core_run_many() across heads, MLA, latent, Q35, draft, and Ink2 split kernels (with zero-spill fa_split_many_kernel), plus mv_run multi-token wide_kernel for 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_STEP 16 -> 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).
  • Multi-lane batched drafting and deterministic draft budgeting:
    • One batched draft pass (oseq_draft_all): Ink2, Hy4, and DS4 draft up to N active 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 uses ink2_mm_takes() (fixing 7x redundant reads of Mini's 1.2 GB BF16 LM head, cutting 8-lane draft pass 43 -> 16.8 ms) and batched Markov step kernels (kernels/ink2_mtp.hip); Hy4 DFly2's 5 Q8_0 layers run on mm_tokens with fused q_a+kv_a and ffn_gate+ffn_up (-21.3% at 8 lanes); DS4 DSpark's Q8_0 dense/LM head run on mm_tokens, wo_a on mm_x16_attn + mm_group, and 128 IQ2_XS routed experts on route_tok + q8_experts.
    • Deterministic multi-lane draft policy (include/osmos/run/draft.h, tools/serve/): added osmos_whole() and osmos_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-aware draft_lane_cum_min() (S=1 untouched; multi-lane 0.30 resident, 0.55 / 0.70 SSD-streamed), and --draft-max / --draft-cum flags on osmos-serve.
  • Benchmarks and tests:
    • Added tools/serve/throughput_bench.py (1/2/4/8-stream seeded multi-conversation scaling with cross-stream/mode hash checks) and tools/serve/decode_bench.py (fast 2K pure-decode scaling & bit-exactness check).
    • Added --fast, --plain, --json, and fail-closed --against to tools/serve/agent_bench.py, and --fast (8-step prefix-compatible regression preset) to tools/serve/session_bench.py.
    • Added test_multi_runs_gpu, test_engine_draft_all_gpu, test_ink2_batch_gpu, and expanded test_draft and test_moe_route. Full verification: all host tests, ASan/UBSan/LSan, TSan, 102/102 API tests, 80/80 installer tests, 117/117 GPU tests on gfx1151, 9/9 session_bench.py --fast replays, and 5/5 full 4×8 agent_bench.py runs.

osmos [0.19.0]: runtime audit — structural cleanup, correctness fixes, and hot-path optimizations

Choose a tag to compare

@github-actions github-actions released this 28 Nov 04:34
0c6a684

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 (performance profile; prior README baseline in parentheses):
    • Speed (~3K prompt; drafted code / prose; plain code / prose): qwen38-ud-iq3_xxs 963 (954) prompt, 51.5 / 44.2 (51.1 / 43.8) drafted, 30.9 / 31.0 (30.7 / 30.7) plain; osmos-evo-1017 398 (377, +5.5%) prompt, 28.5 / 23.8 drafted, 18.6 / 19.1 plain; hy4-flash 480 prompt, 27.2 / 25.0 (27.0 / 24.8) drafted, 19.0 / 19.0 (18.8 / 18.8) plain; inkling-2-mini 1,254 prompt, 46.0 / 42.6 (45.9 / 42.4) drafted, 29.0 / 29.1 plain; osmos1.7b 5,706 prompt, 96.5 / 96.1 (95.3 / 95.4) plain; osmos-evo-inkling 370 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_xxs 60.4 / 29.0 (59.5 / 29.0) tok/s; hy4-flash 33.5 / 17.7 (33.0 / 17.7); osmos-evo-inkling 23.8 / 13.3 (17.7 / 13.7, +34.5% combining 0.18.1's overlapped reads + 0.19.0's cleanups); inkling-2-mini 49.7 / 22.5 sampled (49.6 / 22.4), 54.5 / 22.5 greedy; osmos-evo-1017 41.9 / 19.0 greedy, 35.3 / 19.0 sampled (~500 MiB leaner GPU memory); osmos1.7b 82.8 greedy, 71.0 sampled.
    • Agents (4 at once, 8 turns; vs 0.18.0): osmos1.7b 88.6 s (92.0–93.3 s, -4.4%), qwen38-ud-iq3_xxs 187.7 s (191.5–192.0 s, first-token p50 2.28 vs 2.7–2.8 s), inkling-2-mini 201.4 s (204.5 s), hy4-flash 418.7 s (428.3 s, -9.6 s on identical 7,292 tokens), osmos-evo-1017 426.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-flash 15.5 s (15.7), inkling-2-mini 3.9 s (3.9), osmos-evo-inkling 19.3 s (19.3), osmos1.7b 0.8 s (0.8), qwen38-ud-iq3_xxs 14.7 s, osmos-evo-1017 21.0 s.
  • 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 pinned OverflowFlag read 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->ga before projection; LFM3 defers trailing
      LSA close_blocks and respects honor_prompt; Q35 gains LsaCloser, batched block closing, dense bypass below
      sparse_from, YaRN bounds validation, and exact q35_lsa_rollback.
  • Correctness, concurrency, and memory safety:
    • API, serve, slots: fixed engine_run() heap overflow, mutex races on e->dead / e->in_fd / max_ctx,
      SO_RCVTIMEO EDOM handling, NULL/empty answer buffers, ctx_of() overflow, request_tools() error propagation,
      speculative decode +1 over-generation at max_ctx - 1, multi.c duplicate rid and error handling,
      conv_cancel_read() stale prompt clearing, and content-hashed slot filenames in slots_put.c.
    • Memory, CPU, NPU, model, text: fixed membrane_end leaked holds, pool.c O(N) pinned scans / now == 0
      stale pass / dead-spare eviction order / fstat caching, cpu/lane.c quantization overflow, cpu/q8.c
      pthread_once init, DS4/Hy4 rowstream_wait and tap_n/vocab_rows checks, gguf_int type and bounds checks,
      weights.c overlay slice bounds, arena.c/dspark_index.c overflow guards, EINTR/short-read I/O loops,
      npu_xrt.cpp dmabuf leak and safe BO launch/wait, BPE stack fast-path and OOM propagation, fit.c bracket
      inversion guard, and oseq_draft_all error clearing.
    • Model families and kernels: fixed Q4x q4x_kept_view / moe_side stream race / q4x_npu_take error return /
      expert type checks / pend_pos validation; Ink2 reset/rollback/seed state and ink2_moe_prep bounds; Hy4 Q8_0
      type validation, F32 drafter weights, and error sync; LFM3/Q35 YaRN overflow and lsa_closer_queue error sync;
      mv_fp4 alignment gate; MXFP8 unaligned-safe loads; attn_core FA(8,4) and static LDS accounting; NaN-safe
      order()/order_key() in attn.hip/hy4.hip and bf16_rn in mm_fp4.hip; ops_index_score_rows FMA dispatch;
      q8.h kSelAll count guard; round.h non-finite ue8m0_code; wave-shuffle route.hip scan; and CUDA
      compatibility (!osmos_cuda guard, hipDeviceAttributeMultiprocessorCount, __shfl_up).
    • Review follow-ups: slots_put drops the new entry by name when a trim fails (not whatever was moved to the
      last index); tokenizer_encode_shaped refuses raw()'s out-of-memory -1; q4x_npu_take selects from a
      streamed layer's compact tables; DS4 rest_entries staging 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_ok gates a draft until the next seed).
  • Wasted work and hot-path optimizations:
    • GPU kernels: skip idle waves in attn_core_heads.h; halve v_dot4 calls for zero-offset quant formats in
      q8.h; gate select.h cand[] gather on bin_n <= kCandCap; size sparse MLA splits by sel_cap * pool;
      early-exit hy4 indexer counts/selection and attn_core_q35.h unused splits; drop 3 barriers in moe_tiles.h and
      a duplicate barrier in attn_core_draft.h; bisect top_k in raw logit space in ops.hip with one expf pass.
    • Serving and engine: stop draft sampling on the first mismatch; skip oseq_draft_all with 0 slack and
      osmos_greedy when all lanes sample; stream-local ops_sample without hipDeviceSynchronize(); direct host-state
      slot save via oseq_mark_is_state() without a GPU round-trip; read-only tokenizer_has_special() fast path in
      osmos-api to avoid deep JSON clones on clean requests.
    • Model families and loading: skip non-last DS4 LM head, zero-row ops_hc_pre_rms, unused prefill MoeStage
      tables, redundant compressor kernels, whole-resident fwd_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 the runs loop, pair sh_gate +
      sh_up, drop ~560 MB unused DFly2 head8, skip BF16 output.weight upload when Q8_0 head replaces it, lazily
      allocate pin_logits, free converted f->dev tensors, and size Engram scratch for one layer; trim Ink2 double
      ops_rms_x16_many, full-vocab logits copy, and padded drafter rows; trim Q4x experts() redundant launch, NPU
      down-pack size, MTP seed inject, unused PLE buffers, and padded DFlash rows; clamp the final resident.c arena to
      exact remaining bytes (saving ~1.2 GiB on DeepSeek dense builds); reserve FIT_SLACK in experts_fit_now() for
      hipHostRegister page-table overhead; keep one open shard fd during upload; single-pass Q8_0 LM head quantization
      via q4x_kv_put(v=NULL).
  • Tests: added test_draft, test_moe_stage, test_slots, plus regression coverage in test_gguf, test_pool,
    test_fit, and test_resident. Full verification: all host tests, ASan/UBSan/LSan, TSan, 102/102 API tests, 80/80
    installer tests, and 114/114 GPU tests on gfx1151.