[ABI][KN][LD][CC][RT][LAB][SP][NT][TM][GW][Proofs][Docs] M0.5: realign workspace to vetta-infer-* microkernel architecture
Dissolve the M0 crates (core/io/proto/telemetry/hip/cli) into the approved service layout abi/kn/ld/cc/rt/lab/sp/nt/tm/gw (docs/ARCHITECTURE.md). - kn: Lean-verified control bus + service registry (bus_lifecycle.lean, 14 thms) and SlabRing/UMA broker; rt: PrefixState + hybrid checkpoint pool. - sp: faithful throughput-aware Adaptive-K port of clover_policy.h (cooldowns, probes, throughput guards) with scenario parity tests. - gw: strata-ctl-compatible wire emitters + serve session FSM (serve_session.lean, 10 thms); abi::serve accepts image= (Vision delta closed). - abi: pure contracts, checked JSON/VTC1/GEN parsers, zero-alloc sampler. - ld/cc: checked safetensors reader + write-once VTC1 writer / O_RDONLY reader. - tm: lock-free telemetry; nt: LyraRpc; lab shares the rt executor core. - Docs: ARCHITECTURE.md decision-complete spec (MoE-only scope, .vbundle, .vplan->CompiledPlan, wire contract, migration map); AGENTS.md Lean rule + tandem/review workflow. Verified live: cargo test --workspace -D warnings = 46/46 PASS; lean proofs = 34 theorems (slab_ring_dma 10, bus_lifecycle 14, serve_session 10), 0 sorryAx, standard axioms only; vetta-infer info on Inkling = 1244 tensors, 18.18 GiB, checked bounds.
This commit is contained in:
1 parent
63b1668a92
commit
7b50f1c07c
49 files changed
+3211
-1208
No files matched your search
@@ -0,0 +1,65 @@
|
||||
//! `vetta-infer` CLI entrypoint (gateway crate).
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
use std::env;
|
||||
use std::process::ExitCode;
|
||||
use vetta_infer_ld::SafetensorsArchive;
|
||||
|
||||
fn usage() {
|
||||
eprintln!("vetta-infer {} — MoE-first microkernel inference engine (Rust + HIP)", env!("CARGO_PKG_VERSION"));
|
||||
eprintln!("Usage:");
|
||||
eprintln!(" vetta-infer info <safetensors-dir> Inspect shards, dtypes, and checked bounds");
|
||||
eprintln!(" vetta-infer version Print version & build info");
|
||||
}
|
||||
|
||||
fn cmd_info(dir: &str) -> Result<(), String> {
|
||||
let t0 = std::time::Instant::now();
|
||||
let ar = SafetensorsArchive::open(dir)?;
|
||||
let dt_ms = t0.elapsed().as_secs_f64() * 1000.0;
|
||||
|
||||
let mut by_dtype: BTreeMap<String, (usize, u64)> = BTreeMap::new();
|
||||
for t in ar.tensors.values() {
|
||||
let entry = by_dtype.entry(t.dtype.clone()).or_insert((0, 0));
|
||||
entry.0 += 1;
|
||||
entry.1 += t.byte_len();
|
||||
}
|
||||
|
||||
let tot_gib = ar.total_tensor_bytes() as f64 / (1024.0 * 1024.0 * 1024.0);
|
||||
println!("dir: {}", ar.dir.display());
|
||||
println!("shards: {}", ar.shards.len());
|
||||
println!("tensors: {} (all bounds checked in {:.1} ms)", ar.tensors.len(), dt_ms);
|
||||
println!("payload: {:.2} GiB", tot_gib);
|
||||
println!("dtypes:");
|
||||
for (dt, (cnt, bytes)) in by_dtype {
|
||||
println!(" {:10} {:6} tensors ({:6.2} GiB)", dt, cnt, bytes as f64 / (1024.0 * 1024.0 * 1024.0));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn main() -> ExitCode {
|
||||
let args: Vec<String> = env::args().skip(1).collect();
|
||||
match args.first().map(|s| s.as_str()) {
|
||||
Some("version") | Some("--version") | Some("-V") => {
|
||||
println!("vetta-infer {} (edition 2024, MoE-first HIP microkernel)", env!("CARGO_PKG_VERSION"));
|
||||
ExitCode::SUCCESS
|
||||
}
|
||||
Some("info") => {
|
||||
let Some(dir) = args.get(1) else {
|
||||
eprintln!("error: missing <safetensors-dir>");
|
||||
usage();
|
||||
return ExitCode::from(2);
|
||||
};
|
||||
match cmd_info(dir) {
|
||||
Ok(()) => ExitCode::SUCCESS,
|
||||
Err(e) => {
|
||||
eprintln!("error: {e}");
|
||||
ExitCode::FAILURE
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
usage();
|
||||
ExitCode::from(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user