interplane.Get Omega
Read in your language

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

branch main Branches Tags History

aien-sovereign-core-mv / evidence / motor-chip-20261021 / scripts / expert-union.sh

19 lines · 1172 bytes Raw Blame History
1#!/usr/bin/env bash
2# Expert union per layer across N host goldens (qwen38_check generate: routes[step][layer][k expert ids]).
3# Step 0 of a golden is the prefill (every prompt token's k ids flattened); the union uses the decode steps 1.. only,
4# aligned by decode index. For every such step where all N goldens have a route and every layer: |union of the N rows' experts|.
5# Prints per-N mean union (over steps x layers), the independent-draw expectation 256*(1-(1-8/256)^N), and per-layer means.
6# usage: expert-union.sh gen-a.json gen-b.json ...
7set -eu
8jq -s '
9 (map(.routes | length) | min) as $steps
10 | (.[0].routes[0] | length) as $layers
11 | length as $n
12 | [range(1; $steps) as $s | range(0; $layers) as $l
13 | {s: $s, l: $l, u: ([.[] | .routes[$s][$l][]] | unique | length)}] as $cells
14 | {n: $n, decode_steps: ($steps - 1), layers: $layers,
15 mean_union: (($cells | map(.u) | add) / ($cells | length)),
16 min_union: ($cells | map(.u) | min), max_union: ($cells | map(.u) | max),
17 independent_draws: (256 * (1 - pow(1 - 8/256; $n))),
18 per_layer_mean: [range(0; $layers) as $l | ($cells | map(select(.l == $l) | .u) | add / length)]}
19' "$@"