tokitai-operator 0.1.0

Verified DL kernel compiler: formally-checked GEMM, p-adic, sheaf, contract-carrying ops. Paper-artifact grade.
Documentation
//! Model architecture save/load (gated on `rocm-hip`).
//!
//! Phase 2.10 of the 0.7B MoE training project. The
//! `crate::checkpoint` module saves *parameter values*; this
//! module saves the *architecture* (depth, width, expert count,
//! etc.) as `arch.json` and a SHA-256 fingerprint of the
//! topology for tamper detection.
//!
//! - `arch` — the architecture descriptor (depth, width, etc.).
//! - `save` / `load` — JSON + SHA-256 round-trip.
//! - `dense` — the dense-MLP architecture specialization.
//! - `fingerprint` — the topology fingerprint.
//!
// Phase 2.10 model architecture save/load.
//
// `crate::checkpoint` saves *parameter values*; this module saves the
// *architecture* (size variant, dimensions, expert count, seed,
// model family, router kernel) so that a model can be reconstructed
// from scratch. The two files are complementary: the checkpoint
// tells you what the trained weights are, the arch tells you what
// shape the network had to have.
//
// Five submodules:
//   - `arch`        — `ModelArch` struct, `ModelKind` / `RouterKind`
//                     enums, arch<->model conversion.
//   - `dense`       — `DenseModel` (the 0.7B Dense MLP) and
//                     `QualityModel` (the enum that wraps either
//                     an `MoEModel` or a `DenseModel`).
//   - `save`        — write a `ModelArch` to a JSON file.
//   - `load`        — read a `ModelArch` from a JSON file.
//   - `fingerprint` — stable short hash for cache keys / model registry.
//
// The on-disk schema is intentionally trivial: a single JSON object
// with the arch fields, written via `serde_json::to_writer_pretty`. No
// magic bytes, no version field yet (we use the file extension + the
// fingerprint for version negotiation when we need to bump the schema).

pub mod arch;
pub mod dense;
pub mod fingerprint;
pub mod load;
pub mod save;

pub use arch::{ModelArch, ModelKind, RouterKind};
pub use dense::{DenseConfig, DenseModel, QualityModel, QualityOutput};
pub use fingerprint::arch_fingerprint;
pub use load::load_arch;
pub use save::save_arch;