aien-sovereign-core-mv
AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.
Brought by drakestapleton
aien-sovereign-core-mv / crates / aien-expert-store / src / lib.rs
| 1 | //! Omega Expert Ribbon P1 (sc#629): a content-addressed store for FP8 expert |
| 2 | //! tensors and a bounded, verified read adapter. |
| 3 | //! |
| 4 | //! * [`format`]: the canonical artifact (one projection of one expert: a |
| 5 | //! 4096-byte header, the FP8 weight bytes and the block-128 scale bytes, |
| 6 | //! each 4096-aligned) and the versioned index keyed by |
| 7 | //! (model digest, layer, expert, projection, quantization) with the data |
| 8 | //! digest. The content address is SHA-256 of the canonical artifact bytes. |
| 9 | //! * [`store`]: the on-disk store. Objects and the index are written to a |
| 10 | //! private temporary file, synced, renamed into place and the directory |
| 11 | //! synced, so a crash leaves either the old or the new state. |
| 12 | //! * [`indexer`]: a deterministic, read-only checkpoint-to-artifact indexer |
| 13 | //! for Qwen3-MoE FP8 safetensors checkpoints. The checkpoint is never |
| 14 | //! opened for writing; the artifact keeps the original bytes unchanged. |
| 15 | //! * [`adapter`]: the bounded asynchronous read adapter (queue depth, in-flight |
| 16 | //! bytes, object size, deadline, cancellation) into caller-provided aligned |
| 17 | //! staging buffers. Every object is hashed and compared in constant time |
| 18 | //! before it is handed back as ready; on any failure the staging buffer is |
| 19 | //! scrubbed before the caller gets it back. |
| 20 | //! * [`source`]: the byte sources behind the adapter (buffered and direct file |
| 21 | //! reads behind one interface) and [`fake`], a deterministic in-memory source |
| 22 | //! with injectable faults for tests. |
| 23 | //! |
| 24 | //! Not in this crate: GPU slots, residency policy and decode wiring (sc#630 to |
| 25 | //! sc#632, omega#533). |
| 26 | |
| 27 | pub mod adapter; |
| 28 | pub mod error; |
| 29 | pub mod fake; |
| 30 | pub mod format; |
| 31 | pub mod indexer; |
| 32 | pub mod source; |
| 33 | pub mod staging; |
| 34 | pub mod store; |
| 35 | |
| 36 | pub use adapter::{ |
| 37 | CancelOutcome, Outcome, ReadAdapter, ReadCompletion, ReadLimits, ReadyExpert, Refused, Ticket, |
| 38 | }; |
| 39 | pub use error::{ReadError, StoreError}; |
| 40 | pub use format::{ |
| 41 | ArtifactHeader, ExpertKey, IndexEntry, Projection, QuantFormat, ScaleDtype, ALIGN, FP8_BLOCK, |
| 42 | HEADER_REGION, |
| 43 | }; |
| 44 | pub use source::{BlockReader, BlockSource, FileSource, IoMode}; |
| 45 | pub use staging::StagingBuffer; |
| 46 | pub use store::{ExpertStore, StoreLimits}; |