Commit Graph
31 Commits
Author SHA1 Message Date
Pavlo RatushnyiandClaude Sonnet 5.5 c7abf4fab6 model-format: allow the whole-tensor stream for output.weight and token_embd.weight (native head / embedding owners)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 08:58:13 +02:00
Pavlo Ratushnyi 2d8d362d6b Merge branch 'claude/port-offline' into claude/port-main
# Conflicts:
#	Cargo.toml
#	control-plane/src/lib.rs
#	crates/context/Cargo.toml
#	crates/context/src/lib.rs
#	crates/model-format/src/qwen4exp_expert_source_bank.rs
2026-10-14 16:09:35 +02:00
Pavlo Ratushnyi 0648d296be Merge branch 'claude/port-forward-leaves' into claude/port-main
# Conflicts:
#	crates/model-format/src/lib.rs
2026-10-14 15:47:56 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 b3a9e2238e fix(model-format): clippy -D warnings clean on non-Linux hosts
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:38:35 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7466426ed7 style: cargo fmt model-format and desktop-core
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:37:19 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7847306434 test(model-format): exercise multi-chunk stream safety via a test-only stream buffer seam
Production buffers GGUF spans in 16 MiB chunks (3c20d1a), so 128 KiB tiles
arrive as one chunk. Keep the abort/re-seek/size-mutation/retained-fd checks
by shrinking the stream buffer to 64 KiB per-thread in tests, and assert the
production single-chunk delivery explicitly.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:36:55 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 801a19992d Merge branch 'claude/port-serving' into claude/port-main (conversation cache + async PLE reader); model-format: autotests=false for #[path] test modules
Known: 4 model-format tests expect 64 KiB chunks but streaming uses 16 MiB buffers since 3c20d1a (stale tests, pre-existing).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:35:43 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 910bd947a2 feat(model-format): pinned.cu host half (shared-file arena header, pin/slice registration plan, parallel expert load)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:34:29 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 b3bd6a0936 feat(runtime): read the 16 PLE rows of a token through the async reader
Issue the rows before the embedding read, collect before layer 1, decode
exactly as ple_row does. Reader opens lazily with the original defaults
(1M-row cache, 64 in flight, SSD keep-alive), an O_DIRECT handle on Linux
accepted only after an inode check and aligned probe read, and falls back
to the synchronous path when unavailable. Invalid LELEKA_PLE_* values are
refused.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:34:05 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 13638e294d feat(model-format): native_dense.cpp planning half (eligibility, shard/payload validation, upload plan, Q8_1 scratch)
Literal host port of NativeDense::served_names / keep_unquantized_ple_key and the validation half of NativeDense::load
with the Original's refusal messages; the device upload stays with the runtime.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:32:26 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 44a851648e feat(model-format): expose a positional row-table source for verified shards
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:31:06 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 195b0a99af feat(model-format): add async PLE row reader with page dedup and row cache
Port of ngram/ple_reader: issue/collect tickets, 4 KiB page dedup and
offset-sorted reads over positional reads and worker threads, 8-way
round-robin row cache, sticky errors, injected delay, keep-alive.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:30:18 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 f3bff3842d feat(gguf): header-reader differential, full metadata dump and Python geometry parity
- model inspect-metadata dumps every key/value (bool arrays typed); metadata_entries in model-format
- block_geometry gains Q8_K, IQ1_S, F64, MXFP4, NVFP4; ggml bridge decodes Q8_K, IQ1_S, MXFP4, NVFP4
- general.alignment must be uint32 (the Python reader accepted any width, the Rust reader ignored the rest)
- scripts/offline/diff_gguf_header.py: random GGUF vs unmodified gguf_reader.py, plus stricter-by-design list
- committed golden + integration test (headers and the geometry table)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:25:20 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 0d073e08aa feat(native-pack): match iq_pack.py conversions, add --compat-bf16/--base/--experts-bin and the exhaustive differential
- ple_conv1d inexact F32->F16 is accepted and recorded exact=false, as the oracle does
- conversions.json now carries method/exact/max_abs_err/source_shards like iq_pack.py
- opt-in --compat-bf16 (dequantize + RNE to BF16/F16/F32), --base (index_from_base, extra.bin),
  --experts-bin (+ experts.bin.src.json); receipts list the optional files present
- scripts/offline/diff_native_pack.py: 2700+ cases against the unmodified tools/iq_pack.py
- unit tests: real golden expert tables, numpy/gguf-py F16/BF16 rounding vectors
- fix three pre-existing clippy lints in leleka-model-format

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:20:15 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7e24f41e34 feat(runtime): KAR routed-expert weight source wired into Load and the MoE stage
KarExpertSource (pinned base + optional overlay, levels 2..=5) verifies whole
archives on the retained descriptor, validates the 48-layer expert map at load,
stages exact ranges and runs one-drain device expert FFNs; ModelBinding gains a
consuming with_kar_expert_source builder, MoeExpertStage routes experts through
it (shared expert/combine unchanged, MMQ cache refused), and NativeBackendConfig
gets kar_expert_source with identity-mixed mode digest and a Load-time probe.
The pure selection, stager, expert map and CPU reference move to model-format
so they run on macOS; the CUDA program gains a SwiGLU entry and a per-context
cached module. Linux-target type-checked only; nvcc/GPU unverified, PTX unpinned.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 14:55:34 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 664d434fca feat(model-format): KAR level-decode kernel model and nested record descriptor
Adds KarNestedRecord (section layout of a NESTED record, validated with the
inspector's formulas) and a literal CPU transcription of the planned CUDA
level-decode and F32 row-multiply kernels (window planning, packet layout,
thread/block decomposition, plane word and group scale addressing) for runtime
levels 2..=5. Randomized tests compare it with a transcription of the CPU
decode oracle, including partial last groups, word-unaligned ranges, expert
row windows and overlay-style per-archive dials. Verifies the specification
only; no CUDA build or GPU run.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 14:42:42 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7f896a8bb8 import: Original-literal source-port snapshot (frozen 2026-10-12 06:36, uncompiled together, no GPU run)
Snapshot of target/stra169-direct-port-integration/source-port (without target/), now the tracked base for the full Strata Rust port.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 14:38:46 +02:00
Pavlo Ratushnyi 5a06a29b9a Retain PLE and MTP outputs and memoize immutable PTX checks 2026-10-10 10:20:59 +02:00
Pavlo Ratushnyi 3b865b8426 Retain PLE weights and reuse projection scratch on the GPU 2026-10-10 05:21:51 +02:00
Pavlo Ratushnyi 58dbd1799c Retain selected Qwen weights on GPU and dispatch complete matrices 2026-10-10 04:06:45 +02:00
Pavlo Ratushnyi 3c20d1abea Buffer GGUF metadata and weight spans in 16 MiB heap chunks 2026-10-10 03:07:28 +02:00
Pavlo Ratushnyi ff5241fdb2 Verify sealed KAR SHA and section CRC in one scan 2026-10-10 02:53:06 +02:00
Pavlo Ratushnyi cad2a2776f fix(runtime): read bounded MoE row tiles from retained weight spans 2026-10-10 01:28:54 +02:00
Pavlo Ratushnyi 61b14828d0 feat(runtime): bind explicit KAR PLE mode to qualified fixed CUDA assets 2026-10-09 22:00:08 +02:00
Pavlo Ratushnyi 0be23fdbdc fix(model): match verified second shard identity 2026-10-09 20:40:29 +02:00
Pavlo Ratushnyi 74b50fd1ef fix(model): stream verified rank-one float vectors 2026-10-09 20:09:56 +02:00
Pavlo Ratushnyi f92cdfdc38 fix(STRA-156): check indexed splits before metadata
Validate pinned index split summaries and tensor counts before parsing split metadata, then validate that metadata before profile and tokenizer parsing. Model-format tests, rustfmt, and strict Clippy pass.
2026-10-09 11:51:44 +02:00
Pavlo Ratushnyi 33c29240e0 fix(STRA-156): validate split metadata before profile
The binder now validates split metadata from the retained owners before reading Qwen profile, topology, or tokenizer fields. Targeted model-format tests, rustfmt, and strict Clippy pass.
2026-10-09 11:49:20 +02:00
Pavlo Ratushnyi b1300329ff feat(model): bind pinned Qwen topology and bounded tensor rows [skip ci] 2026-10-08 18:47:09 +02:00
Pavlo Ratushnyi 3bfc4a3f03 feat(engine): verify GGUF artifacts through owned Rust file handles
Linux / keyless-cuda-gate (pull_request) Skipped
Linux / verify (pull_request) Successful in 4m48s
Linux / keyless-cuda (pull_request) Skipped
Linux / static-cuda-package (pull_request) Skipped
Linux / hosted-cuda-package (pull_request) Skipped
Linux / linux-cli-container (pull_request) Successful in 3m26s
Linux / linux-static-cli (pull_request) Failing after 7m42s
Linux / release-cli (pull_request) Skipped
2026-10-07 20:33:15 +02:00
Pavlo Ratushnyi c6a3fc7e42 feat(engine): extract Rust GGUF foundation and enforce model capability tuples 2026-10-07 20:33:15 +02:00