Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-bridge/patches/c1f06601d0cc72b9 # omega-bridge Omega-first language interoperability: checked conversion backends and native language bindings Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers ## GitHub aien-dev/omega-bridge#47 (code only) closed derived `c1f06601d0cc72b9` #47 Imported from GitHub aien-dev/omega-bridge#47 (code only) GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed). Base `1958a1895279c0d4869bab39eaa20f070b174a6c` · Head `9ae3cb58a98482e2eda10c75e389d01d4e103394` ### Apply it ``` git checkout -b patch-c1f06601d0cc72b9 1958a1895279c0d4869bab39eaa20f070b174a6c curl -fsSL https://interplane.io/drakestapleton/omega-bridge/patches/c1f06601d0cc72b9.patch | git am ``` Raw patch (mbox) · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/omega-bridge 47 9ae3cb58a98482e2eda10c75e389d01d4e103394 ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"omega-bridge","number":47,"url":"https://github.com/aien-dev/omega-bridge/pull/47","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:40:00Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/docs/MAX-INTEGRATION.md b/docs/MAX-INTEGRATION.md index f0f6096..5238398 100644 --- a/docs/MAX-INTEGRATION.md +++ b/docs/MAX-INTEGRATION.md @@ -22,6 +22,22 @@ Pinned MAX: `max/v26.7.0` = `527d069ee11a41ac5320af1f9402db0a66b2b868` contract/ISA and a 416-byte TEST-class C2 receipt; tampering, stale epochs and wrong ids are refused. +## CPU route: Omega kernel as a MAX custom op — EXERCISED(host CPU) + +On the Spark's Grace aarch64 host, MAX 26.7.0 runs the seeded Omega unit +`max-cpu/omatmul.om` (bf16 → f32 matmul) **inside a MAX graph** as the CPU custom +op `omega_matmul`. The library comes from the unchanged `tools/native` path; the +only non-Omega code is one Mojo glue file (`max-cpu/kernels/__init__.mojo`, +`OwnedDLHandle` + dlsym) and the Python harness. `max-cpu/run.sh` reproduces it: +15 numeric cases PASS within the Wolfram-derived f32 bound and bit-identical to +`ops.matmul`; wrong-symbol, plain-`external_call`, shape-refusal (Omega results +1/2/3, plus a graph-construction refusal) and index-mutant negatives all fail as +required. At 256x256x256 the scalar Omega op is 112x slower than `ops.matmul` +(warm p50 49.4 ms vs 0.44 ms). This is a host-CPU result only; it says nothing +about GB10 and is not a hardware qualification. Evidence, pins, the six Omega +gaps and a MAX 26.7.0 kernel-cache observation: +[evidence/MAX-CPU/README.md](../evidence/MAX-CPU/README.md). + ## What is not proven, and why - **No GB10 run exists.** The chip is reserved by the coordinator @@ -64,7 +80,8 @@ context the module lands in; (c) deterministic error for a wrong arch/entry; loads a cubin, not only PTX. Until that exists or the release exposes the main HAL path, this repository -does **not** claim in-graph native execution. The separate-process harness is the +does **not** claim in-graph native GPU execution (the CPU route above is a separate, +host-only result). The separate-process harness is the supported demonstration, and it is ready to run the moment a GPU window is authorized. diff --git a/evidence/MAX-CPU/README.md b/evidence/MAX-CPU/README.md new file mode 100644 index 0000000..6895de9 --- /dev/null +++ b/evidence/MAX-CPU/README.md @@ -0,0 +1,206 @@ +# MAX CPU route: an Omega kernel as a MAX 26.7.0 graph custom op + +Status: **EXERCISED(host CPU)** on the DGX Spark's Grace aarch64 host, 2026-10-30/31. This is a +host-CPU run, not a hardware qualification and not a GPU result. Nothing here opened the GPU: +every graph is built on `DeviceRef.CPU()` and the session is `InferenceSession(devices=[CPU()])`. + +## What runs + +`max-cpu/omatmul.om` (seeded Omega, OM-2) computes `C[M,N] = A[M,K] @ B[K,N]` with bf16 inputs +widened exactly to f32 and an in-order f32 accumulation. `tools/native` (the bridge's existing +native path, unchanged) compiles it into `libomega_native.so`, exporting `omega2_omatmul`. +`max-cpu/kernels/__init__.mojo` registers the MAX custom op `omega_matmul` (`type="cpu"`); its only +work is to resolve `omega2_omatmul` with `OwnedDLHandle()` (dlopen(NULL) + dlsym over the library +the harness loads `RTLD_GLOBAL`), call it on the tensors' buffers, and raise on a nonzero status or +result. `max-cpu/omega_max.py` builds the MAX graphs, checks the numbers and measures. + +Graph (`both`/`omega`): f32 inputs A and B (already bf16-rounded by the harness) are cast to bf16 +in the graph (exact), flattened and concatenated into `ab`; the shape `s = int64[3]` is a graph +input; `C = ops.custom("omega_matmul", ...)`. Variants: `omega_nocat` takes the concatenated bf16 +buffer as a graph input; `concat` is the cast + concat alone; `matmul` is MAX's own `ops.matmul` on +the same f32 values. + +## Pins + +| Item | Value | +|---|---| +| MAX | `max`, `max-core`, `max-mojo-libs`, `modular` 26.7.0 = modular/modular `527d069ee11a41ac5320af1f9402db0a66b2b868` (max/v26.7.0) | +| Mojo | `mojo`, `mojo-compiler` 1.2.0 | +| Python / numpy | 3.12.3 / 2.5.4 (venv `~/workspace/maxinterop/venv`) | +| omc stage 1 | `git -C ~/workspace/omega show 55f9b0af:seed/out/omc`, sha256 `734f0a39319fbfa930bcc62cb30dbf06d47d78e126372b74f5baf478e6126b61` | +| omc stage 2 | `ec07d25d:seed/out/omc`, sha256 `499236398aabc652e2dae27fe4bdc4c5db3d3726314356e0dbef23e3345803ec` | +| Unit ident | `raw/idents.txt`: `unit=omatmul abi=2 profile=OM-2 src=214493520a48…` (mutant `src=8e2a67f1bd70…`) | +| C compiler | gcc 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1), driven by `tools/native` | +| Bridge base | omega-bridge `1958a1895279c0d4869bab39eaa20f070b174a6c` (origin/main) | + +## Reproduce + +```sh +TMPDIR=/dev/shm taskset -c 10-14 nice -n 19 ionice -c3 max-cpu/run.sh # ~11 min +TMPDIR=/dev/shm taskset -c 10-14 nice -n 19 ionice -c3 max-cpu/mogg-cache-repro.sh # after run.sh +``` + +`run.sh` extracts both omc stages from git objects and checks their sha256, builds the library and +the mutant, writes the glue variants (each substitution must match exactly once), and gives every +MAX process an **empty `MODULAR_CACHE_DIR`** (see the cache observation below). It exits 0 and +prints `OMEGA MAX CPU: PASS` only when every control passes and every negative fails as required. +Run of record: exit 0, wall time 667 s; console output: + +``` +check OMEGA_MAX_CHECK: PASS +neg-shape OMEGA_MAX_NEG_SHAPE: PASS +neg-wrongsym OMEGA_MAX_NEG_LOAD: PASS +neg-extcall OMEGA_MAX_NEG_LOAD: PASS +neg-mutant OMEGA_MAX_CHECK: FAIL +OMEGA MAX CPU: PASS (controls green, negatives red as expected) +``` + +Raw output: `raw/check.log`, `raw/check.json`, `raw/neg-shape.{log,json}`, `raw/neg-wrongsym.log`, +`raw/neg-extcall.log`, `raw/neg-mutant.{log,json}`, `raw/build-lib.log`, `raw/build-mutant.log`, +`raw/measure/summary.tsv` plus one JSON per series with every latency (`lat_ns`), `raw/measure.log`, +`raw/mogg-cache-repro.log` and `raw/mogg-cache-repro/`. The first run's two red harness logs +(`run1-harness-red/`) are kept: the harness compared only the last line of MAX's multi-line error +and expected the JIT's stderr text in the exception; both were harness defects, fixed before the +run of record, and the kernel and glue were unchanged. + +## Numeric check (control) + +Shapes (M,K,N): (1,1,1), (3,5,7), (16,16,8), (33,17,9), (64,128,32), (256,256,256); cases random +(bf16-rounded normal), zeros, identity (K = N), and large (inputs scaled by 2^60, 16x16x8). The +reference is numpy float64 of the same bf16 values. Pass bound, elementwise: +`|C - ref| <= tol(K) * (|A| @ |B|)` with `tol(K) = 2*gamma(K-1, 2^-24)`, the standard bound for an +f32 recursive sum of exact products, doubled. + +`WolframLanguageEvaluator: g[n_,u_]:=n u/(1-n u); u32=2^-24; u64=2^-53; Table[{k, N[g[k-1,u32]+g[k-1,u64],17], N[2 g[k-1,u32],17]}, {k,{1,5,16,17,128,256}}]` +-> K=1: 0, 0; K=5: 2.384186363890841e-7, 4.768372718899898e-7; K=16: 8.940704726574863e-7, +1.788140941984304e-6; K=17: 9.536752276781760e-7, 1.907350451803638e-6; K=128: +7.569847202727132e-6, 1.513969437725460e-5; K=256: 1.519941546475356e-5, 3.039883087288574e-5. + +Result (`raw/check.log`): all 15 cases PASS. The largest bound ratio was 0.067 (33x17x9 random); +256x256x256 random max abs error 1.75e-05, ratio 0.00677. Against MAX's own `ops.matmul` on the +same inputs, every case was **bit-identical** (`ratio_max=0 maxerr_max=0`). + +## Negative controls + +| Control | Expectation | Observed (raw log) | +|---|---|---| +| wrong symbol: glue asks for `omega2_omatmul_missing` | load/execute error naming it | `symbol not found: omega2_omatmul_missing` → PASS (`neg-wrongsym.log`) | +| plain `external_call["omega2_omatmul", UInt32]` glue (lib loaded `RTLD_GLOBAL` first) | model setup fails | stderr `JIT session error: Symbols not found: [ omega2_omatmul ]`, exception `Failed to materialize symbols` → PASS (`neg-extcall.log`) | +| shape [16,15,8] on a 16x16x8 buffer | Omega result 2 | `omega_matmul refused: status 0 result 2` | +| shape [5000,16,8] | result 1 | `... result 1` | +| shape [0,16,8] | result 1 | `... result 1` | +| shape [12,16,12] (ab matches, c does not) | result 3 | `... result 3` | +| valid call after the four refusals | correct numbers | ratio 0.0336, PASS | +| graph construction `ops.matmul` [16,16]x[15,8] | refused before compile | `Failed to create op 'MatmulOp'` → PASS (`neg-shape.log`) | +| mutant: `ai = mul i k` → `ai = mul i n` (A row stride N) | numeric check FAILs | FAIL on 3x5x7, 16x16x8, 16x16x8 large, 33x17x9, 64x128x32 (ratios up to 1.41e+07); shapes with K = N or zero data still pass, as they must (`neg-mutant.log`) | + +The mutant was meant to be a transposed C write (`C[j*M+i]`), but every form of it fails to compile +with omc error 12 (more than 16 live values) because `brow` is already at the limit; the A-stride +mutant is the one-token index fault that compiles. + +Why `external_call` fails: in the pinned source only `mojo run` passes `libraryPaths` to the +ExecutionEngine; the MAX kernel JIT does not resolve symbols from the process image, and +`LD_PRELOAD` gave the same error. The Mojo FFI docs at the pin (c-ffi.mdx, Limitations) say +`external_call()` cannot load dynamic libraries and point to `OwnedDLHandle`. + +## Measurements (EXERCISED(host CPU), `taskset -c 10-14`) + +`measure-all` starts one child process per series. `cold_ns` runs from process start to the end +of the first execute (import, graph build, compile, load, first call); `fresh` = empty +`MODULAR_CACHE_DIR`, `warm` = the same directory reused by a second process. Then 20 warm-up +calls and 300 timed calls (`perf_counter_ns`, including the copy-out to numpy). Peak RSS is +`ru_maxrss` of the child. Source: `raw/measure/summary.tsv`. KiB → MiB: +`WolframLanguageEvaluator: N[{1292596, 595448, …, 595948}/1024, 5]` -> `{1262.3, 581.49, …, 581.98}`. + +| op | shape | cache | cold s | p50 µs | p99 µs | peak RSS MiB | +|---|---|---|---|---|---|---| +| omega | 16x16x8 | fresh | 12.65 | 72.5 | 282.2 | 1262 | +| omega | 16x16x8 | warm | 3.56 | 156.3 | 471.1 | 581 | +| omega_nocat | 16x16x8 | fresh | 11.46 | 105.3 | 463.3 | 1239 | +| omega_nocat | 16x16x8 | warm | 3.57 | 49.4 | 266.8 | 580 | +| concat only | 16x16x8 | fresh | 12.51 | 34.3 | 261.9 | 1262 | +| concat only | 16x16x8 | warm | 3.54 | 36.1 | 51.5 | 581 | +| ops.matmul | 16x16x8 | fresh | 30.53 | 36.5 | 451.8 | 1406 | +| ops.matmul | 16x16x8 | warm | 3.61 | 35.4 | 270.5 | 580 | +| omega | 256x256x256 | fresh | 12.76 | 49386.6 | 50393.1 | 1263 | +| omega | 256x256x256 | warm | 3.56 | 49399.2 | 49896.5 | 582 | +| omega_nocat | 256x256x256 | fresh | 11.11 | 49246.7 | 49523.3 | 1239 | +| omega_nocat | 256x256x256 | warm | 3.58 | 49235.3 | 49566.0 | 582 | +| concat only | 256x256x256 | fresh | 12.52 | 172.4 | 3015.6 | 1263 | +| concat only | 256x256x256 | warm | 3.61 | 157.2 | 1031.9 | 582 | +| ops.matmul | 256x256x256 | fresh | 28.40 | 320.0 | 1901.8 | 1408 | +| ops.matmul | 256x256x256 | warm | 3.47 | 439.3 | 1997.3 | 582 | + +Quantile cross-check: all 32 p50/p99 values of `summary.tsv` were recomputed from the raw +`lat_ns` with `WolframLanguageEvaluator: Quantile[#, q, {{1,-1},{0,1}}]` for q = 1/2, 99/100 +(numpy's linear rule) and agree exactly, e.g. omega 256 warm -> `{4.9399161*^7, 4.989648293*^7}`, +matmul 256 warm -> `{439308.5, 1.99725278*^6}`. + +Reading: +- At 256x256x256 the Omega op is 112x (warm) to 154x (fresh) slower than `ops.matmul`: + `WolframLanguageEvaluator: N[{49399161/439308.5, 49386625/319987}]` -> `{112.447…, 154.339…}`. + Throughput `N[2*256^3/49399161]` -> 0.679 GFLOP/s for Omega versus `N[2*256^3/439308.5]` -> + 76.4 GFLOP/s for MAX. The Omega unit is a scalar, single-threaded triple loop with bounds-checked + loads; MAX's kernel is tiled, vectorised and multi-threaded across the five pinned cores. +- The in-graph concat is not the cost: omega_nocat / omega at 256 warm is + `N[49235279/49399161]` -> 0.997, and the concat alone is `N[157226/49399161]` -> 0.32% of the + Omega op. +- At 16x16x8 every series is within a few tens of µs of the per-execute floor (concat alone ≈ + `ops.matmul` ≈ 35 µs p50) and the fresh/warm spread (72 vs 156 µs for the same graph) shows + that this size measures dispatch noise, not the kernel. +- A warm cache cuts cold start from 11–31 s to about 3.5 s and peak RSS from about 1.24–1.41 GiB + to about 0.58 GiB; the first `ops.matmul` compile is the slowest (28–31 s). + +## MAX 26.7.0 observation: stale compiled kernel after a glue edit + +Not filed upstream (human-only). Repro (`max-cpu/mogg-cache-repro.sh`, log `raw/mogg-cache-repro.log`): + +1. Package dir `P/kernels` holds the `external_call` glue (sha256 `6684216a…`); run with + `MODULAR_CACHE_DIR=A` → `Failed to materialize symbols` (expected). +2. Replace `P/kernels/__init__.mojo` with the working `OwnedDLHandle` glue (sha256 `6159e31a…`), + same cache `A` → **the same failure**, `JIT session error: Symbols not found: [ omega2_omatmul ]`. +3. Same new glue, empty cache `B` → runs. +4. The new glue copied to a **different path** `Q/kernels`, cache `A` → **the same failure**. + +The `__kernel_` names in the materialisation error are byte-identical in steps 1, 2 and 4 +(md5 of the sorted name list `09abc084…` in all three). Step 2 adds five cache entries (one +`.max_cache/mof/mef`, one `.mogg_cache`, three `.mojo_cache/mojo/transform`; +`raw/mogg-cache-repro/cacheA-after-{1,2}.txt`), yet the stale kernel object is still linked. The +first observation used the default `~/.cache/modular` and took the same shape. +`[INFERENCE]` The key under which MAX 26.7.0 caches a compiled custom-op kernel ignores both the +Mojo source contents and the package path, depending only on what reaches the kernel names +(op name, signature, graph). Workaround used here: an empty `MODULAR_CACHE_DIR` per run. + +## Host dependencies + +| Dependency | Version | Role | Omega replacement | +|---|---|---|---| +| MAX engine + graph API | 26.7.0 | graph build, compile, schedule, tensors, `ops.matmul` reference | none at this boundary: the goal is to run Omega *under* MAX | +| Mojo glue `max-cpu/kernels/__init__.mojo` | Mojo 1.2.0 | registers the custom op, dlsym + call | none while MAX accepts custom ops only as Mojo `@compiler.register` structs | +| Python harness `max-cpu/omega_max.py` | CPython 3.12.3 | graph driver, checks, timing | none for the MAX Python API; oracle could move to an Omega f64 unit | +| numpy | 2.5.4 | bf16 rounding of inputs, float64 reference, quantiles | an Omega f64 reference unit (verification oracle) | +| gcc | 13.3.0 | compiles the bridge's emitted C (`tools/native`) | gap 6 below: native object/shared-library output from omc | +| glibc `dlopen`/`dlsym` | system (Ubuntu 24.04) | `OwnedDLHandle()` resolves `omega2_omatmul` | same as gap 6 | +| omc stage 1 / stage 2 | sha256 above | Omega compiler | first party | + +## Omega gaps met, as omega-mv extension proposals + +1. **More function-mode parameter slots, or descriptor parameters.** OM-2 function mode has six + slots and an unsized view takes two, so A, B and C cannot be three views plus a shape. + Proposal: raise the slot count to at least 8, or admit a `struct` parameter whose fields are + view descriptors. Today A and B travel concatenated, which forces an in-graph concat. +2. **Floating element types in unsized views.** Views carry integer cells only, so f32 data moves + as `uint` bit patterns and every load needs `bitcast`. Proposal: `view f32 *` / `edit f32 *` + (and f16/bf16 once gap 3 lands) with the same bounds checks. +3. **bf16 (and f16) as types.** bf16 is widened by `shl 16` + `bitcast f32` by hand; there is no + narrowing conversion with round-to-nearest-even. Proposal: `bf16`/`f16` scalar types with + exact widening and RNE narrowing, so outputs could also be bf16. +4. **The 16-live-value limit has no spill (error 12).** It forced the dot product into a helper + function and made a one-expression transposed-index mutant uncompilable. Proposal: spill to + frame slots instead of refusing; keep error 12 only for a hard frame-size limit. +5. **The per-loop 1,000,000-pass cap.** A flat loop over M*N*K stops at 100^3; the kernel nests + loops to stay under it. Proposal: a declared bound (`for p ulong k max 4096`) checked once at + entry, replacing the fixed per-loop cap for loops with a proven bound. +6. **No native object or C ABI export from omc (FR-7).** The callable symbol comes from the + bridge's emitted C compiled by gcc. Proposal: omc emits an ELF relocatable or shared object + with the bridge's `omega2_` ABI directly, removing gcc from the build path. diff --git a/evidence/MAX-CPU/raw/build-lib.log b/evidence/MAX-CPU/raw/build-lib.log new file mode 100644 index 0000000..31a1574 --- /dev/null +++ b/evidence/MAX-CPU/raw/build-lib.log @@ -0,0 +1 @@ +tools/native: 1 unit(s) -> /dev/shm/omega-max-cpu/lib/libomega_native.so + omega_native.{c,h,py,rs,zig,go} + omega_api.h, omega_api_decl.h, omega_api_defs.c (+ work/) diff --git a/evidence/MAX-CPU/raw/build-mutant.log b/evidence/MAX-CPU/raw/build-mutant.log new file mode 100644 index 0000000..3923e5d --- /dev/null +++ b/evidence/MAX-CPU/raw/build-mutant.log @@ -0,0 +1 @@ +tools/native: 1 unit(s) -> /dev/shm/omega-max-cpu/lib-mutant/libomega_native.so + omega_native.{c,h,py,rs,zig,go} + omega_api.h, omega_api_decl.h, omega_api_defs.c (+ work/) diff --git a/evidence/MAX-CPU/raw/check.json b/evidence/MAX-CPU/raw/check.json new file mode 100644 index 0000000..bbd5664 --- /dev/null +++ b/evidence/MAX-CPU/raw/check.json @@ -0,0 +1,245 @@ +{ + "lib": "/dev/shm/omega-max-cpu/lib/libomega_native.so", + "rows": [ + { + "shape": [ + 1, + 1, + 1 + ], + "case": "random", + "load_s": 33.2615035570052, + "tol_ref": 0.0, + "tol_max": 0.0, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 1, + 1, + 1 + ], + "case": "zeros", + "load_s": 33.2615035570052, + "tol_ref": 0.0, + "tol_max": 0.0, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 1, + 1, + 1 + ], + "case": "identity", + "load_s": 33.2615035570052, + "tol_ref": 0.0, + "tol_max": 0.0, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 3, + 5, + 7 + ], + "case": "random", + "load_s": 28.922642798017478, + "tol_ref": 2.384186363890841e-07, + "tol_max": 4.768372718899898e-07, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 3, + 5, + 7 + ], + "case": "zeros", + "load_s": 28.922642798017478, + "tol_ref": 2.384186363890841e-07, + "tol_max": 4.768372718899898e-07, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 16, + 16, + 8 + ], + "case": "random", + "load_s": 27.02427357598208, + "tol_ref": 8.940704726574863e-07, + "tol_max": 1.788140941984304e-06, + "ratio_ref": 0.04517529780314637, + "maxerr_ref": 4.76837158203125e-07, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 16, + 16, + 8 + ], + "case": "zeros", + "load_s": 27.02427357598208, + "tol_ref": 8.940704726574863e-07, + "tol_max": 1.788140941984304e-06, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 16, + 16, + 8 + ], + "case": "large", + "load_s": 27.02427357598208, + "tol_ref": 8.940704726574863e-07, + "tol_max": 1.788140941984304e-06, + "ratio_ref": 0.04517529780314637, + "maxerr_ref": 6.338253001141147e+29, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 33, + 17, + 9 + ], + "case": "random", + "load_s": 35.78041400498478, + "tol_ref": 9.53675227678176e-07, + "tol_max": 1.907350451803638e-06, + "ratio_ref": 0.06695263274564199, + "maxerr_ref": 4.76837158203125e-07, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 33, + 17, + 9 + ], + "case": "zeros", + "load_s": 35.78041400498478, + "tol_ref": 9.53675227678176e-07, + "tol_max": 1.907350451803638e-06, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 64, + 128, + 32 + ], + "case": "random", + "load_s": 43.17163815701497, + "tol_ref": 7.569847202727132e-06, + "tol_max": 1.51396943772546e-05, + "ratio_ref": 0.009072796680636935, + "maxerr_ref": 6.67572021484375e-06, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 64, + 128, + 32 + ], + "case": "zeros", + "load_s": 43.17163815701497, + "tol_ref": 7.569847202727132e-06, + "tol_max": 1.51396943772546e-05, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 256, + 256, + 256 + ], + "case": "random", + "load_s": 41.92570396600058, + "tol_ref": 1.519941546475356e-05, + "tol_max": 3.039883087288574e-05, + "ratio_ref": 0.006772649166662281, + "maxerr_ref": 1.745671033859253e-05, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 256, + 256, + 256 + ], + "case": "zeros", + "load_s": 41.92570396600058, + "tol_ref": 1.519941546475356e-05, + "tol_max": 3.039883087288574e-05, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 256, + 256, + 256 + ], + "case": "identity", + "load_s": 41.92570396600058, + "tol_ref": 1.519941546475356e-05, + "tol_max": 3.039883087288574e-05, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + } + ] +} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/check.log b/evidence/MAX-CPU/raw/check.log new file mode 100644 index 0000000..7841bcc --- /dev/null +++ b/evidence/MAX-CPU/raw/check.log @@ -0,0 +1,16 @@ +1x1x1 random ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +1x1x1 zeros ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +1x1x1 identity ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +3x5x7 random ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +3x5x7 zeros ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +16x16x8 random ratio_ref=0.0452 maxerr_ref=4.77e-07 ratio_max=0 maxerr_max=0 PASS +16x16x8 zeros ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +16x16x8 large ratio_ref=0.0452 maxerr_ref=6.34e+29 ratio_max=0 maxerr_max=0 PASS +33x17x9 random ratio_ref=0.067 maxerr_ref=4.77e-07 ratio_max=0 maxerr_max=0 PASS +33x17x9 zeros ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +64x128x32 random ratio_ref=0.00907 maxerr_ref=6.68e-06 ratio_max=0 maxerr_max=0 PASS +64x128x32 zeros ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +256x256x256 random ratio_ref=0.00677 maxerr_ref=1.75e-05 ratio_max=0 maxerr_max=0 PASS +256x256x256 zeros ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +256x256x256 identity ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +OMEGA_MAX_CHECK: PASS diff --git a/evidence/MAX-CPU/raw/idents.txt b/evidence/MAX-CPU/raw/idents.txt new file mode 100644 index 0000000..0dc8e75 --- /dev/null +++ b/evidence/MAX-CPU/raw/idents.txt @@ -0,0 +1,2 @@ +#define OMEGA2_IDENT_omatmul "omega-ident 1 unit=omatmul abi=2 profile=OM-2 src=214493520a48487f44ec1c3dc7ac23771b15fe87bd587ed0e882b4a407f6c7a8 omc=499236398aabc652e2dae27fe4bdc4c5db3d3726314356e0dbef23e3345803ec" +#define OMEGA2_IDENT_omatmul "omega-ident 1 unit=omatmul abi=2 profile=OM-2 src=8e2a67f1bd70985f6a64cfdd522b03e64e4078f2d25f865fd3e94f492f95d16b omc=499236398aabc652e2dae27fe4bdc4c5db3d3726314356e0dbef23e3345803ec" diff --git a/evidence/MAX-CPU/raw/measure.log b/evidence/MAX-CPU/raw/measure.log new file mode 100644 index 0000000..566d8fa --- /dev/null +++ b/evidence/MAX-CPU/raw/measure.log @@ -0,0 +1,34 @@ +omega 16x16x8 cache=fresh cold_ms=12646.9 p50_us=72.46 p99_us=282.21 maxrss_kib=1292596 +omega 16x16x8 cache=warm cold_ms=3559.4 p50_us=156.27 p99_us=471.05 maxrss_kib=595448 +omega_nocat 16x16x8 cache=fresh cold_ms=11456.4 p50_us=105.31 p99_us=463.31 maxrss_kib=1268388 +omega_nocat 16x16x8 cache=warm cold_ms=3567.1 p50_us=49.41 p99_us=266.76 maxrss_kib=594384 +concat 16x16x8 cache=fresh cold_ms=12509.6 p50_us=34.26 p99_us=261.90 maxrss_kib=1292260 +concat 16x16x8 cache=warm cold_ms=3539.2 p50_us=36.14 p99_us=51.46 maxrss_kib=595036 +matmul 16x16x8 cache=fresh cold_ms=30533.1 p50_us=36.49 p99_us=451.76 maxrss_kib=1440164 +matmul 16x16x8 cache=warm cold_ms=3607.1 p50_us=35.35 p99_us=270.48 maxrss_kib=594344 +omega 256x256x256 cache=fresh cold_ms=12756.9 p50_us=49386.62 p99_us=50393.12 maxrss_kib=1293288 +omega 256x256x256 cache=warm cold_ms=3563.9 p50_us=49399.16 p99_us=49896.48 maxrss_kib=595872 +omega_nocat 256x256x256 cache=fresh cold_ms=11110.3 p50_us=49246.71 p99_us=49523.32 maxrss_kib=1268816 +omega_nocat 256x256x256 cache=warm cold_ms=3580.5 p50_us=49235.28 p99_us=49566.03 maxrss_kib=595808 +concat 256x256x256 cache=fresh cold_ms=12517.9 p50_us=172.41 p99_us=3015.57 maxrss_kib=1293072 +concat 256x256x256 cache=warm cold_ms=3609.5 p50_us=157.23 p99_us=1031.95 maxrss_kib=596380 +matmul 256x256x256 cache=fresh cold_ms=28395.9 p50_us=319.99 p99_us=1901.82 maxrss_kib=1441448 +matmul 256x256x256 cache=warm cold_ms=3467.1 p50_us=439.31 p99_us=1997.25 maxrss_kib=595948 +op shape cache cold_ns iters p50_ns p99_ns maxrss_kib +omega 16x16x8 fresh 12646882241 300 72464.5 282208.4099999998 1292596 +omega 16x16x8 warm 3559380767 300 156273.5 471051.8499999999 595448 +omega_nocat 16x16x8 fresh 11456389175 300 105313.0 463306.57 1268388 +omega_nocat 16x16x8 warm 3567137625 300 49409.0 266763.48 594384 +concat 16x16x8 fresh 12509559143 300 34256.0 261898.49 1292260 +concat 16x16x8 warm 3539189563 300 36136.5 51457.47 595036 +matmul 16x16x8 fresh 30533144903 300 36488.5 451759.36 1440164 +matmul 16x16x8 warm 3607070291 300 35352.0 270482.36 594344 +omega 256x256x256 fresh 12756905723 300 49386625.0 50393115.14 1293288 +omega 256x256x256 warm 3563896709 300 49399161.0 49896482.93 595872 +omega_nocat 256x256x256 fresh 11110332432 300 49246711.0 49523323.61 1268816 +omega_nocat 256x256x256 warm 3580450816 300 49235279.0 49566034.21 595808 +concat 256x256x256 fresh 12517941577 300 172410.0 3015567.269999997 1293072 +concat 256x256x256 warm 3609521349 300 157226.0 1031949.899999994 596380 +matmul 256x256x256 fresh 28395886859 300 319987.0 1901823.0099999956 1441448 +matmul 256x256x256 warm 3467098976 300 439308.5 1997252.7799999986 595948 + diff --git a/evidence/MAX-CPU/raw/measure/concat-16x16x8-fresh.json b/evidence/MAX-CPU/raw/measure/concat-16x16x8-fresh.json new file mode 100644 index 0000000..cc7b6c6 --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/concat-16x16x8-fresh.json @@ -0,0 +1 @@ +{"op": "concat", "shape": [16, 16, 8], "cache": "fresh", "cold_ns": 12509559143, "iters": 300, "warmup": 20, "lat_ns": [33888, 241394, 39553, 46640, 242802, 33409, 30944, 233858, 29136, 246467, 32320, 27456, 122978, 112545, 33008, 26608, 229666, 31537, 242834, 31872, 40465, 246610, 32689, 40896, 231298, 34160, 34993, 237474, 26384, 245987, 32384, 32832, 34641, 251154, 34608, 247699, 34448, 34864, 238195, 28512, 144113, 93441, 36369, 241138, 32352, 38257, 240898, 35712, 38257, 261890, 43857, 36032, 40128, 37473, 34304, 32784, 24177, 31424, 36096, 26449, 32512, 28368, 45201, 34640, 30224, 26864, 30225, 27552, 30976, 22784, 25889, 29216, 18688, 34785, 28160, 22896, 34000, 39665, 47600, 59633, 45968, 25728, 46721, 29008, 45809, 37200, 26352, 48257, 49440, 29232, 26945, 22576, 48672, 165922, 44640, 43649, 28880, 23200, 267715, 50080, 251939, 39376, 42561, 244722, 39792, 43985, 292899, 52704, 259747, 35056, 252162, 34369, 40976, 253299, 41456, 52641, 242482, 28928, 246786, 32881, 245202, 36416, 49105, 32672, 155922, 31648, 45168, 32192, 26144, 26128, 48609, 41664, 20448, 21809, 38704, 37600, 36673, 43936, 24656, 36785, 28528, 39184, 34657, 39648, 49361, 45808, 58721, 38080, 49984, 33409, 48624, 44129, 24912, 45824, 42929, 32192, 26464, 46545, 36304, 44881, 32320, 24464, 45425, 43024, 26704, 43953, 37984, 27952, 31969, 26048, 48160, 25809, 43168, 34464, 37633, 48144, 23408, 39185, 48288, 23729, 37280, 47216, 25137, 50272, 27312, 49345, 23472, 26912, 19232, 29521, 32128, 29504, 29281, 31280, 25648, 36305, 25952, 34464, 23984, 27617, 37920, 42656, 28753, 33888, 34208, 37729, 33008, 28432, 21808, 32721, 33760, 35616, 34945, 35952, 34592, 36769, 36496, 38209, 32880, 22944, 23232, 24417, 32400, 27248, 25664, 32481, 35648, 38576, 30113, 20832, 22880, 36464, 32817, 29312, 33376, 32609, 28976, 34160, 32913, 28144, 24912, 32112, 35329, 29584, 39200, 32801, 25136, 19904, 23984, 29073, 37936, 27232, 29185, 35776, 27680, 27633, 39184, 31408, 28849, 21808, 36096, 31040, 37345, 23632, 41184, 43201, 38304, 30576, 26769, 27424, 36672, 30833, 25408, 26496, 26208, 29153, 30992, 25360, 33985, 27824, 35600, 39345, 20960, 22880, 23248, 25536, 33857, 34432, 38801, 32064, 23536, 22976, 22720, 20753, 34448, 23856, 28705, 26016, 39776, 262739], "p50_ns_numpy": 34256.0, "p99_ns_numpy": 261898.49, "maxrss_kib": 1292260, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/concat-16x16x8-warm.json b/evidence/MAX-CPU/raw/measure/concat-16x16x8-warm.json new file mode 100644 index 0000000..24acb4d --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/concat-16x16x8-warm.json @@ -0,0 +1 @@ +{"op": "concat", "shape": [16, 16, 8], "cache": "warm", "cold_ns": 3539189563, "iters": 300, "warmup": 20, "lat_ns": [28449, 45648, 25312, 27185, 21024, 21488, 40496, 24721, 23808, 22880, 20464, 41441, 33264, 40272, 25921, 20528, 21824, 34720, 29697, 32496, 31136, 36673, 27104, 23616, 41009, 51504, 38592, 41185, 41248, 24448, 31953, 22800, 32256, 39265, 50960, 28064, 44481, 40176, 25537, 41952, 31104, 28208, 35073, 39296, 39777, 47136, 51457, 47072, 26592, 27169, 24704, 43856, 45953, 34592, 30480, 40033, 44112, 45297, 37744, 31104, 26080, 39457, 43744, 35553, 44928, 23776, 21793, 29568, 24432, 40496, 39713, 28352, 42465, 37200, 32224, 44273, 40992, 29776, 25601, 41824, 42144, 46305, 162049, 42161, 27376, 29584, 33345, 42384, 33664, 34193, 44896, 39760, 23489, 35168, 37264, 41569, 37328, 32176, 35073, 38112, 34193, 38752, 40240, 43649, 38080, 29664, 27073, 27280, 38400, 43345, 37648, 41792, 42561, 37872, 22336, 39009, 42288, 38513, 41200, 41744, 39921, 31168, 28224, 26385, 42576, 25776, 37569, 37520, 26688, 34977, 24320, 36304, 42513, 41488, 41184, 24881, 26096, 44160, 41921, 38640, 34304, 39793, 28288, 38016, 40929, 37296, 22304, 33585, 38944, 43665, 37664, 35808, 40129, 27888, 35040, 29505, 41536, 43200, 44193, 36576, 28144, 25777, 24688, 22912, 37712, 38865, 36688, 20608, 26497, 26240, 26176, 43553, 27616, 28944, 38977, 42880, 32512, 27313, 26080, 24752, 24160, 24592, 36353, 33024, 47169, 41728, 38448, 36209, 28768, 26000, 32161, 35936, 25920, 28656, 32353, 29200, 26800, 28625, 44304, 39008, 29409, 27744, 38448, 42529, 36592, 30464, 27713, 25664, 24624, 37136, 40769, 37936, 22976, 33185, 29408, 43504, 39057, 22752, 27952, 30113, 40912, 42944, 43937, 46624, 38145, 40144, 44336, 42769, 42800, 26561, 45424, 40800, 40673, 40176, 34465, 36928, 22128, 43825, 34512, 28128, 34561, 28000, 27184, 25824, 40001, 28080, 37920, 45313, 47008, 29504, 33025, 39728, 44737, 37152, 22000, 26128, 25409, 38832, 38560, 38753, 29472, 39680, 41777, 38032, 31889, 27616, 44048, 23216, 47089, 34096, 47057, 23568, 23056, 23936, 43441, 46912, 45809, 42064, 47137, 23040, 34560, 44577, 43184, 47552, 24705, 35056, 30112, 47505, 55648, 23504, 32817, 30256, 44401, 24336, 33536, 36064, 45025, 43040, 30433, 24432], "p50_ns_numpy": 36136.5, "p99_ns_numpy": 51457.47, "maxrss_kib": 595036, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/concat-256x256x256-fresh.json b/evidence/MAX-CPU/raw/measure/concat-256x256x256-fresh.json new file mode 100644 index 0000000..d10bd5d --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/concat-256x256x256-fresh.json @@ -0,0 +1 @@ +{"op": "concat", "shape": [256, 256, 256], "cache": "fresh", "cold_ns": 12517941577, "iters": 300, "warmup": 20, "lat_ns": [364435, 887593, 91169, 247682, 69873, 451636, 78481, 160337, 445973, 79488, 245843, 71168, 441317, 87713, 248946, 68161, 245746, 80865, 249762, 80081, 236946, 61617, 248498, 249378, 96625, 243363, 72928, 249587, 76193, 1118362, 190834, 259539, 195825, 264659, 200978, 266194, 190818, 266787, 75137, 71856, 167778, 76337, 768695, 86801, 257666, 70657, 76689, 154529, 571046, 79888, 83457, 173810, 63825, 236738, 161297, 793416, 169106, 120849, 85713, 823288, 84816, 119793, 471253, 83697, 62256, 179186, 83537, 887704, 73649, 920553, 3012413, 89521, 240114, 56065, 237410, 72800, 232835, 93505, 274130, 122449, 269011, 74129, 3440593, 80992, 125842, 278082, 72977, 282387, 277570, 138594, 382195, 72433, 268931, 138417, 266755, 393203, 75361, 235746, 65761, 123825, 67425, 274338, 121265, 291602, 2740315, 1005577, 92161, 259363, 92609, 106001, 285234, 140914, 264610, 93409, 273027, 107665, 277922, 133858, 272802, 68273, 179058, 267090, 65089, 274786, 265507, 141761, 3327840, 91153, 94001, 274131, 70144, 270739, 274083, 101745, 136897, 201698, 62720, 127586, 105841, 162897, 287107, 295235, 281570, 93377, 281795, 272115, 103089, 268450, 71585, 177378, 195090, 60144, 122049, 275011, 250978, 73425, 117665, 276659, 267874, 83153, 129377, 275699, 199410, 274707, 74256, 275699, 72337, 269698, 81505, 157906, 189057, 277827, 278339, 71344, 147570, 63424, 129650, 105841, 195665, 74640, 117265, 272243, 279875, 278114, 245123, 83328, 115010, 125009, 287523, 64688, 269123, 194706, 83024, 274899, 89665, 2027939, 263539, 148177, 268419, 67553, 168145, 180898, 73281, 111313, 264754, 258115, 260482, 142417, 90913, 91233, 133954, 192865, 271731, 266627, 266786, 265811, 175521, 265379, 3752756, 91793, 251874, 191202, 69249, 123281, 114721, 147953, 291187, 716615, 87105, 248322, 196978, 78257, 80737, 295058, 85377, 925305, 74017, 402820, 78928, 429877, 65792, 276499, 82065, 573525, 997754, 77344, 72753, 171010, 684582, 66673, 74337, 259170, 234626, 74561, 691991, 67600, 76513, 75537, 369427, 72929, 276163, 649158, 72689, 73168, 184626, 73025, 269042, 79969, 255107, 85425, 905640, 82977, 307011, 93521, 224626, 187394, 64624, 102785, 74129, 2850923, 91521, 129361, 67857, 719079, 988522, 83552, 397348, 82625, 75809, 367219, 83233, 271939, 139025, 78273, 421044, 1002057, 85809, 406948, 89713, 417316], "p50_ns_numpy": 172410.0, "p99_ns_numpy": 3015567.269999997, "maxrss_kib": 1293072, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/concat-256x256x256-warm.json b/evidence/MAX-CPU/raw/measure/concat-256x256x256-warm.json new file mode 100644 index 0000000..d3308aa --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/concat-256x256x256-warm.json @@ -0,0 +1 @@ +{"op": "concat", "shape": [256, 256, 256], "cache": "warm", "cold_ns": 3609521349, "iters": 300, "warmup": 20, "lat_ns": [243282, 67825, 127809, 162738, 152161, 159682, 78161, 231826, 194674, 146017, 87937, 91745, 134897, 197858, 149697, 89457, 65057, 154545, 155426, 76161, 78640, 155074, 114753, 115665, 195922, 150193, 78833, 73313, 307379, 85761, 72976, 223330, 393780, 77009, 79057, 139393, 94529, 413028, 74177, 238578, 77233, 97249, 152433, 155826, 72112, 85793, 304963, 80353, 81137, 235346, 228402, 156914, 73024, 241587, 248322, 232450, 96337, 241154, 233411, 90849, 242226, 70865, 434004, 68464, 162178, 226034, 225746, 231442, 79073, 236642, 64241, 240162, 225939, 232690, 205410, 244466, 226082, 432228, 70913, 240946, 235555, 235554, 72305, 240418, 94961, 861064, 89073, 235714, 181074, 79409, 495652, 87201, 244387, 73248, 116577, 69921, 404420, 83137, 240674, 70465, 118193, 151841, 66289, 330035, 74865, 72993, 245074, 72897, 247218, 81985, 112145, 79281, 689398, 64033, 245490, 72609, 123089, 158178, 150481, 82321, 73713, 157633, 115169, 113745, 191922, 66289, 631478, 85537, 250162, 88625, 106753, 152177, 65073, 244978, 707831, 73153, 74001, 370595, 69281, 124785, 157538, 81312, 341524, 71968, 119265, 244691, 67120, 492853, 90001, 84705, 145489, 61953, 611030, 77792, 256579, 73649, 122865, 159793, 148162, 86961, 74064, 994874, 82353, 244130, 76961, 113297, 69184, 418164, 83009, 236370, 68689, 605430, 104305, 243010, 63185, 587094, 83296, 242803, 135361, 533717, 443076, 556374, 993433, 996842, 1004473, 1006698, 991530, 999225, 1001546, 994249, 997498, 1008553, 806824, 194002, 997242, 995145, 993865, 116529, 610630, 283474, 648374, 91729, 263203, 89169, 161873, 77249, 675126, 80017, 246979, 74272, 114769, 79777, 401108, 693031, 70576, 244643, 80208, 1866818, 198882, 261139, 173345, 260451, 188482, 253042, 169042, 258274, 229010, 248915, 178674, 254034, 69889, 239698, 239218, 241875, 236898, 79441, 144993, 85217, 1025338, 96417, 255410, 65777, 238002, 84177, 191330, 158385, 144609, 97569, 663495, 76160, 85153, 275475, 238050, 109425, 90577, 238642, 74545, 801800, 75409, 2921756, 89728, 258963, 78593, 115601, 1686528, 99185, 176050, 254402, 190530, 277587, 189073, 260083, 84369, 230354, 91777, 232578, 237122, 86561, 273027, 66736, 65377, 256210, 79521, 249107, 83120, 93313, 194018, 992794, 78336, 89761, 147714, 262066, 254019, 57552, 291731, 92305, 261810, 90033, 250595, 111985], "p50_ns_numpy": 157226.0, "p99_ns_numpy": 1031949.899999994, "maxrss_kib": 596380, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/matmul-16x16x8-fresh.json b/evidence/MAX-CPU/raw/measure/matmul-16x16x8-fresh.json new file mode 100644 index 0000000..e014f20 --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/matmul-16x16x8-fresh.json @@ -0,0 +1 @@ +{"op": "matmul", "shape": [16, 16, 8], "cache": "fresh", "cold_ns": 30533144903, "iters": 300, "warmup": 20, "lat_ns": [248434, 37889, 241522, 31744, 35665, 236370, 45456, 28833, 24016, 201042, 34912, 244418, 36769, 31984, 28976, 22081, 46384, 240098, 32177, 26896, 22368, 240243, 37472, 28800, 23136, 449877, 41424, 35696, 28369, 26816, 25776, 445732, 50721, 249170, 36049, 32080, 25616, 243795, 33360, 25664, 243666, 37057, 28480, 239234, 33473, 30048, 241570, 32945, 26848, 22672, 240275, 37552, 27920, 22704, 241667, 30848, 24800, 243779, 39216, 33488, 30369, 245490, 35504, 32993, 249234, 35840, 31809, 29536, 28384, 445268, 32465, 44288, 31616, 247907, 41728, 25936, 25889, 451732, 245522, 37697, 74032, 33297, 35920, 25472, 39777, 25872, 38704, 24177, 37536, 486245, 43296, 43249, 250546, 40304, 40017, 24992, 33984, 49713, 35376, 27664, 37409, 261970, 47121, 256178, 37489, 32768, 26064, 24976, 391716, 48305, 244626, 34960, 38097, 45136, 31296, 52609, 27552, 20176, 43681, 30608, 24912, 24145, 241234, 35328, 32769, 256386, 37616, 25553, 60336, 35329, 40288, 42016, 25057, 33008, 50768, 31985, 36608, 29264, 35889, 49728, 31344, 25233, 33008, 41424, 264835, 50912, 31281, 36048, 247634, 37681, 250914, 40961, 251394, 59329, 368707, 50417, 46928, 349331, 46001, 245826, 57505, 255282, 49697, 255298, 42065, 250994, 36992, 37953, 33968, 49441, 27488, 24064, 37376, 64353, 32032, 26721, 36256, 50144, 35089, 38864, 24656, 24609, 251282, 39264, 26225, 250146, 246482, 63441, 254194, 36225, 29856, 44113, 460196, 52976, 32081, 24928, 20272, 239027, 31216, 242882, 32704, 29953, 143265, 32096, 65953, 25264, 241635, 48064, 28256, 24513, 24544, 51680, 256035, 51440, 31329, 240082, 53248, 31329, 240898, 151217, 265539, 30672, 28673, 454468, 36256, 58161, 66464, 46737, 24528, 38321, 29472, 25136, 42016, 28001, 23072, 28672, 21824, 51041, 24944, 24128, 35777, 40704, 47905, 26832, 20528, 30080, 23665, 42320, 38640, 22945, 22144, 22000, 22608, 67633, 26656, 23872, 24929, 49072, 37985, 21312, 30560, 23472, 41841, 25152, 28000, 37521, 24656, 40336, 28176, 23553, 21776, 53712, 42241, 26928, 38032, 25905, 48624, 24432, 21057, 28400, 22288, 22928, 48161, 24960, 36976, 26145, 41856, 136193, 46545, 37328, 35296, 47841, 40160, 36369, 24320, 22432, 50385, 38320, 35328, 34113], "p50_ns_numpy": 36488.5, "p99_ns_numpy": 451759.36, "maxrss_kib": 1440164, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/matmul-16x16x8-warm.json b/evidence/MAX-CPU/raw/measure/matmul-16x16x8-warm.json new file mode 100644 index 0000000..5067626 --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/matmul-16x16x8-warm.json @@ -0,0 +1 @@ +{"op": "matmul", "shape": [16, 16, 8], "cache": "warm", "cold_ns": 3607070291, "iters": 300, "warmup": 20, "lat_ns": [29872, 29728, 31553, 24192, 23776, 39856, 32737, 25984, 169810, 52832, 27344, 59553, 25536, 21537, 26672, 20832, 44384, 29377, 34208, 44192, 47537, 50192, 43185, 23984, 34848, 28097, 40496, 23664, 24385, 40320, 32640, 35041, 246962, 37472, 32801, 37024, 24048, 242771, 34960, 42496, 255715, 93201, 44176, 24528, 39073, 25520, 38192, 40369, 22976, 37024, 24912, 25633, 56448, 30113, 43696, 68033, 32432, 23344, 35553, 25408, 47840, 21376, 38241, 23184, 35344, 42656, 29968, 28208, 23009, 46128, 29472, 23889, 36736, 23888, 46081, 25680, 24576, 169362, 25936, 23120, 29649, 34448, 75537, 46784, 25856, 27953, 57152, 204290, 29280, 245059, 38224, 34801, 249346, 34112, 43489, 38048, 28480, 36993, 28496, 58945, 28480, 28192, 38480, 25633, 37520, 35360, 36625, 29600, 24000, 42289, 29248, 20832, 22240, 23089, 21392, 26384, 22000, 37057, 30160, 60880, 26848, 40352, 41345, 29504, 30848, 40481, 29392, 39680, 33825, 32784, 27488, 39712, 29905, 33184, 240930, 269491, 58337, 458116, 63537, 252274, 71009, 248946, 42337, 249666, 42576, 237795, 32608, 244402, 37793, 40112, 247218, 56529, 252386, 51041, 38016, 30288, 28001, 27808, 458356, 32801, 34848, 29696, 244915, 78848, 42577, 236610, 39169, 51344, 192466, 39088, 247379, 33264, 51280, 40257, 36176, 26592, 37505, 241906, 40817, 34800, 24048, 241122, 62033, 255778, 35825, 21360, 235122, 29345, 64288, 34752, 44577, 240818, 29760, 31249, 29200, 244194, 35905, 31232, 270467, 38576, 31520, 272003, 68929, 248770, 36048, 29873, 21584, 248274, 34289, 59744, 35521, 39872, 30384, 43073, 28800, 28448, 41953, 23424, 37888, 29601, 39984, 24912, 22192, 27105, 29504, 48144, 30881, 24672, 26368, 25505, 51280, 27696, 37569, 25392, 24224, 54993, 45280, 36800, 37777, 55440, 25825, 23264, 40016, 48657, 25776, 42336, 31505, 23232, 53072, 35617, 24608, 24192, 26032, 46897, 38032, 24817, 27520, 23040, 52273, 26768, 23024, 23984, 24720, 47153, 38640, 29761, 22992, 57152, 31937, 22416, 27184, 48961, 43968, 22208, 44081, 30576, 48657, 29248, 22512, 43744, 29953, 48816, 28577, 22368, 45568, 48801, 31264, 20912, 39233, 30032, 40384, 40065, 41232, 31584, 130514, 33152, 25344, 22528, 25553, 51440], "p50_ns_numpy": 35352.0, "p99_ns_numpy": 270482.36, "maxrss_kib": 594344, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/matmul-256x256x256-fresh.json b/evidence/MAX-CPU/raw/measure/matmul-256x256x256-fresh.json new file mode 100644 index 0000000..792c3a4 --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/matmul-256x256x256-fresh.json @@ -0,0 +1 @@ +{"op": "matmul", "shape": [256, 256, 256], "cache": "fresh", "cold_ns": 28395886859, "iters": 300, "warmup": 20, "lat_ns": [456661, 439540, 463364, 434245, 357123, 434596, 436340, 445221, 434788, 446324, 456948, 342148, 436404, 437012, 443428, 434500, 442453, 440644, 363171, 438677, 439748, 447940, 440372, 443957, 436436, 348435, 448260, 436373, 446452, 435252, 446916, 437684, 343475, 436724, 432196, 445908, 436997, 244466, 431652, 433924, 437572, 429845, 262914, 431780, 433364, 445765, 437668, 249362, 434372, 435637, 441556, 429876, 255234, 436085, 435780, 440164, 450228, 445077, 434148, 354211, 3235535, 364980, 310115, 356707, 315523, 311475, 356595, 314067, 314867, 3264016, 440372, 318611, 307859, 317715, 324083, 308419, 315427, 317923, 2386231, 701383, 697142, 642566, 627126, 635399, 1205627, 707671, 962393, 964025, 703271, 730327, 652646, 636854, 939849, 851577, 654582, 830776, 717735, 638854, 630406, 721223, 931849, 638054, 1140283, 844152, 927977, 654150, 603558, 609174, 1228379, 436788, 315972, 318787, 289074, 315683, 314531, 312515, 356500, 315155, 314371, 315747, 315363, 314435, 281699, 315171, 315059, 314131, 364691, 318323, 321363, 316867, 317635, 248771, 384387, 322932, 295634, 320132, 315843, 359667, 320035, 320291, 321635, 321091, 320611, 320387, 324644, 305827, 314819, 284626, 320755, 322195, 322819, 318996, 316115, 373027, 318595, 314403, 316899, 315843, 317571, 271939, 366883, 319412, 310754, 315684, 318451, 318211, 316467, 317763, 317859, 315347, 314963, 359491, 316803, 316243, 317331, 310723, 318963, 321044, 321891, 321795, 319635, 318499, 318259, 319651, 270610, 318788, 317411, 318515, 1896930, 451220, 315331, 317139, 316595, 315939, 361220, 315539, 316355, 319811, 273843, 316403, 321891, 317411, 367571, 322595, 323571, 312451, 317331, 318996, 317747, 319587, 275362, 314211, 361012, 319379, 317155, 317475, 318323, 317603, 318147, 317155, 346611, 315427, 311635, 355012, 314883, 314147, 290307, 312979, 314723, 314147, 314435, 314451, 260562, 372164, 315827, 314643, 317971, 316243, 316051, 316739, 319939, 315731, 354931, 314131, 322772, 320899, 320595, 322003, 301139, 321443, 319747, 322499, 317923, 316979, 320675, 321219, 322595, 259715, 373539, 313859, 314659, 314131, 313171, 313859, 313971, 313395, 314195, 270867, 312275, 359908, 320243, 322467, 311443, 315811, 318227, 313347, 256162, 370100, 315747, 318195, 316931, 314515, 313459, 323283, 324483, 322099, 317699, 323059, 319715, 282787, 321283, 313011, 324547, 317315, 315043, 316899, 317827, 316531, 284563, 315939], "p50_ns_numpy": 319987.0, "p99_ns_numpy": 1901823.0099999956, "maxrss_kib": 1441448, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/matmul-256x256x256-warm.json b/evidence/MAX-CPU/raw/measure/matmul-256x256x256-warm.json new file mode 100644 index 0000000..b9354fb --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/matmul-256x256x256-warm.json @@ -0,0 +1 @@ +{"op": "matmul", "shape": [256, 256, 256], "cache": "warm", "cold_ns": 3467098976, "iters": 300, "warmup": 20, "lat_ns": [617542, 432677, 411636, 591877, 419252, 425684, 420516, 329283, 406580, 420004, 451493, 419428, 301123, 409204, 416532, 621957, 589638, 595702, 783383, 585542, 580533, 812040, 788456, 813800, 779719, 603862, 883896, 600198, 600310, 1409437, 947193, 430533, 408179, 713031, 2135237, 3497105, 3392257, 1138971, 723767, 619429, 709927, 666487, 696022, 1392958, 993305, 665367, 1134986, 726263, 745608, 738471, 633894, 1272316, 766695, 825144, 642070, 901465, 617926, 604230, 602981, 603990, 605126, 635974, 822424, 619542, 678614, 935385, 636006, 638998, 615765, 605526, 522405, 720087, 642054, 1022906, 617238, 435012, 305891, 315203, 314179, 313923, 297971, 251410, 590294, 639078, 356676, 433604, 437076, 262338, 634998, 466565, 249474, 512677, 628518, 370084, 297171, 355923, 342195, 313523, 244483, 445428, 835832, 440548, 432772, 427700, 430869, 421348, 427588, 428980, 439252, 433940, 273571, 256450, 360196, 256834, 616822, 418836, 260899, 636038, 444708, 432052, 307587, 435700, 433108, 442948, 431380, 252306, 1995859, 472917, 251410, 280371, 253970, 630294, 441685, 440244, 452756, 439221, 264962, 815688, 419572, 255426, 580118, 635926, 361747, 435365, 458004, 465396, 247747, 394420, 610517, 382372, 409252, 417492, 253411, 255810, 609398, 418452, 431812, 479381, 264370, 456212, 995802, 1004554, 636646, 358483, 248322, 607942, 445397, 429492, 430660, 256706, 597366, 637446, 339027, 250115, 612998, 447684, 430100, 432420, 253747, 575893, 643270, 354916, 442308, 435796, 446548, 439365, 452388, 437524, 336691, 275443, 620214, 427460, 248722, 427077, 1000617, 999978, 634566, 360707, 431076, 438405, 438180, 435780, 251074, 425669, 450836, 441604, 437684, 440388, 447973, 353043, 250403, 264834, 370228, 361267, 250083, 497268, 635798, 365300, 251154, 360484, 313875, 312499, 256226, 253907, 404115, 315299, 254546, 274179, 258306, 250082, 255667, 383012, 315939, 304131, 319635, 314115, 315443, 257010, 1017866, 835016, 453060, 439684, 265219, 432660, 471829, 452116, 445268, 451141, 443524, 300243, 432180, 451252, 443300, 448101, 451348, 447796, 326131, 427733, 433860, 451652, 436244, 246691, 433556, 437924, 454804, 453077, 459764, 450596, 309891, 433940, 443877, 468980, 449893, 456820, 435332, 303491, 429012, 436388, 454325, 448148, 456004, 434644, 335892, 427060, 446436, 452980, 447589, 460948, 466229, 298834, 432645, 441364, 450724, 433476, 443461, 437812, 352371, 427156, 440996, 449525], "p50_ns_numpy": 439308.5, "p99_ns_numpy": 1997252.7799999986, "maxrss_kib": 595948, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/omega-16x16x8-fresh.json b/evidence/MAX-CPU/raw/measure/omega-16x16x8-fresh.json new file mode 100644 index 0000000..5925e11 --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/omega-16x16x8-fresh.json @@ -0,0 +1 @@ +{"op": "omega", "shape": [16, 16, 8], "cache": "fresh", "cold_ns": 12646882241, "iters": 300, "warmup": 20, "lat_ns": [66897, 132369, 112209, 49920, 155361, 89185, 246466, 425044, 76337, 59825, 59488, 67425, 162849, 73201, 59361, 56608, 50145, 52896, 49329, 141169, 162482, 76224, 266339, 271587, 262306, 266419, 72752, 250419, 63104, 248803, 250066, 126113, 128530, 245970, 254434, 254515, 111985, 65233, 204833, 60593, 144513, 104081, 53169, 156097, 91201, 65441, 156065, 61153, 95761, 157490, 155345, 99777, 55025, 159345, 59153, 208626, 56992, 100305, 154914, 155777, 89457, 249026, 265971, 257010, 251891, 253378, 65025, 247874, 257187, 261810, 162834, 90417, 249746, 257843, 65920, 67409, 58256, 61649, 52912, 52465, 76113, 45520, 48369, 63024, 48945, 63712, 51633, 51008, 61009, 51136, 48449, 59296, 49169, 47840, 58529, 48304, 48017, 60976, 56145, 53296, 54545, 62785, 49040, 46305, 46240, 41648, 49921, 49872, 50529, 49600, 57313, 256770, 120721, 134866, 247378, 275411, 266866, 72177, 56193, 53968, 79505, 52528, 59905, 59217, 51376, 54865, 49408, 51153, 60096, 264067, 104481, 281970, 268547, 68225, 203010, 65680, 113345, 141138, 78800, 256995, 65681, 249010, 196498, 57088, 61937, 251618, 63633, 62369, 59376, 50321, 51296, 50561, 54528, 53281, 51296, 54817, 55488, 55457, 54864, 53105, 49760, 49409, 52080, 51681, 55920, 53569, 50352, 54369, 48848, 111521, 55921, 51568, 50465, 51952, 58449, 52704, 55809, 51152, 62401, 50113, 47616, 61841, 48880, 48961, 65440, 48097, 49216, 66305, 44128, 42881, 40384, 42576, 45137, 58976, 52865, 48736, 62849, 52161, 49456, 58865, 48704, 52097, 269378, 305811, 255523, 262098, 261331, 220098, 65600, 247027, 269138, 258355, 155345, 101057, 247875, 272114, 273395, 261634, 257731, 71792, 67617, 248850, 193537, 63313, 259330, 63345, 248835, 61984, 252547, 267746, 251043, 62720, 252003, 211282, 60816, 249731, 62848, 248402, 270867, 104273, 262659, 62688, 64369, 51920, 58113, 52384, 51905, 51792, 120882, 132257, 83393, 62736, 250003, 253058, 271091, 266194, 254595, 257650, 254419, 126001, 124817, 244722, 251299, 256834, 63377, 77329, 254594, 273619, 256514, 271091, 251394, 60305, 247058, 260195, 64400, 262915, 88641, 249714, 252130, 273123, 268179, 254802, 265155, 255154, 251234, 253667, 249474, 101841, 147458, 245906, 251778, 271427, 502421, 262082, 204850, 51585, 65937, 157937, 65121, 90849], "p50_ns_numpy": 72464.5, "p99_ns_numpy": 282208.4099999998, "maxrss_kib": 1292596, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/omega-16x16x8-warm.json b/evidence/MAX-CPU/raw/measure/omega-16x16x8-warm.json new file mode 100644 index 0000000..eeee906 --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/omega-16x16x8-warm.json @@ -0,0 +1 @@ +{"op": "omega", "shape": [16, 16, 8], "cache": "warm", "cold_ns": 3559380767, "iters": 300, "warmup": 20, "lat_ns": [264338, 70081, 257762, 317203, 262643, 274114, 272323, 261826, 70769, 70065, 470932, 140338, 256514, 73793, 276067, 262450, 134257, 60465, 71617, 72080, 68465, 61857, 55824, 279443, 282290, 269395, 92113, 259618, 258979, 70577, 78272, 169218, 244402, 250515, 256802, 75777, 182466, 247106, 258227, 259026, 266675, 259458, 286131, 70816, 54977, 63585, 68672, 51473, 57520, 49697, 50800, 52241, 51856, 53809, 50432, 52177, 51296, 52961, 52768, 50801, 50656, 52529, 218114, 53297, 58080, 55953, 53440, 52369, 45184, 46241, 54784, 57025, 49664, 50705, 52400, 53393, 51808, 56257, 52848, 50993, 63520, 55121, 57056, 67809, 51600, 49713, 68113, 51712, 63681, 55632, 53457, 66352, 52417, 53280, 55457, 49760, 48865, 54080, 499829, 80561, 399444, 278435, 262386, 294643, 312627, 266722, 260755, 257250, 119826, 136337, 247122, 258947, 260642, 93089, 164242, 244162, 256707, 258882, 72577, 182897, 246611, 256882, 260227, 264818, 259091, 258834, 275779, 64897, 61808, 67809, 50592, 68545, 52897, 72048, 51505, 51696, 59489, 51472, 56833, 56528, 51441, 52512, 56401, 57488, 54673, 50720, 51873, 51760, 55521, 269459, 265234, 270771, 273570, 293523, 276323, 262258, 282963, 252066, 254755, 270738, 257762, 257154, 240419, 70448, 247715, 257586, 256867, 164193, 92689, 247939, 270306, 259315, 126081, 71265, 66464, 244643, 251490, 269491, 94576, 163938, 237954, 250243, 270130, 74353, 249378, 255875, 257986, 241875, 249490, 256163, 271522, 253779, 253282, 249346, 257699, 254290, 257443, 254930, 491317, 314163, 266962, 260578, 64273, 259298, 254131, 256146, 253826, 271827, 255154, 247171, 231730, 271251, 255762, 205698, 54321, 102497, 112241, 57984, 97665, 152162, 197026, 53696, 104481, 145457, 185170, 64657, 92913, 155953, 57121, 100177, 155601, 157346, 88769, 67056, 272035, 434180, 482917, 62064, 264275, 455876, 63889, 146257, 100145, 100161, 149858, 198242, 51584, 105393, 149265, 197778, 52177, 105505, 142913, 197122, 52193, 104673, 147889, 200194, 57425, 101520, 156594, 160322, 87472, 71233, 164466, 73328, 78753, 158482, 59344, 97729, 158690, 56000, 100225, 153298, 253314, 263683, 255746, 267715, 260242, 261731, 257858, 236322, 62625, 250546, 266579, 258354, 162610, 278851, 276978, 89169, 262003, 260722, 260035, 261922, 260643, 273634, 263187, 258514, 246371, 271506], "p50_ns_numpy": 156273.5, "p99_ns_numpy": 471051.8499999999, "maxrss_kib": 595448, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/omega-256x256x256-fresh.json b/evidence/MAX-CPU/raw/measure/omega-256x256x256-fresh.json new file mode 100644 index 0000000..c6e0101 --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/omega-256x256x256-fresh.json @@ -0,0 +1 @@ +{"op": "omega", "shape": [256, 256, 256], "cache": "fresh", "cold_ns": 12756905723, "iters": 300, "warmup": 20, "lat_ns": [49585835, 49420857, 49486922, 49555082, 49366169, 49262903, 49646779, 49533595, 49738268, 49350200, 49323128, 49748621, 49405497, 49344344, 49464682, 49375400, 49311800, 49293368, 49602587, 49284024, 49565978, 49576267, 49548874, 49282824, 49462106, 49614939, 49407721, 49577658, 49448138, 49558330, 49465738, 49589866, 49293400, 49291016, 49391833, 49264680, 49207879, 49278359, 49225352, 49564410, 49416905, 49556795, 49478937, 49372313, 49307256, 49549322, 49892046, 49512634, 49272280, 49491753, 49319512, 49416601, 49396584, 49624011, 49397928, 49461082, 49605883, 49610411, 49403961, 49739740, 49615419, 49406649, 49406681, 49432057, 49461113, 49261704, 49265960, 49338552, 49634379, 49335640, 49245848, 49294472, 49261287, 49228264, 49305112, 49291320, 49471529, 49646619, 49309016, 49404297, 49477434, 49283960, 49227863, 49221991, 49589019, 49582139, 49435113, 49397209, 49511242, 49588379, 49382616, 49506010, 49395481, 49314856, 49374089, 49360696, 49432202, 49289992, 49250583, 49820365, 49456409, 49515818, 49454298, 49332344, 49533658, 49425801, 49225544, 49401161, 49268647, 49502778, 49580539, 49872029, 49486106, 49341560, 49484570, 49389801, 49276776, 49943502, 49282375, 49336761, 49264615, 49575259, 49626635, 49399673, 49518010, 49265512, 49369752, 49338185, 49487993, 49469098, 49577403, 49514618, 49318360, 49384104, 49384665, 49965087, 49256439, 49533594, 49390425, 49367193, 49783580, 49448714, 49251511, 49249272, 49287143, 49576715, 49426169, 51861857, 49450377, 49269624, 49350008, 49240231, 49322393, 49279447, 49315897, 49343928, 49395065, 49321768, 49441417, 49351545, 49385704, 49374937, 49386313, 49743932, 49462906, 49468841, 49315240, 49319928, 49262280, 49306680, 49395545, 49256423, 49222360, 49336104, 49329944, 49307416, 49258104, 49338776, 49282920, 49649595, 49368857, 49440393, 49717132, 49359544, 49270423, 49773341, 49675051, 49294680, 49383353, 49369096, 49353049, 49252503, 49222216, 49230615, 49227687, 49211815, 49252328, 49505114, 49439289, 49417833, 49412729, 49781389, 49526986, 49707052, 49726108, 49738156, 49370056, 49294936, 50007023, 49318168, 49411401, 49386937, 49371577, 49539162, 49550586, 50811239, 50391026, 49346872, 49481322, 49371369, 49395481, 49337336, 49283512, 49336536, 49304616, 49367017, 49534298, 49257047, 49257896, 49252151, 49249064, 50599940, 49501402, 49389353, 49281816, 49276983, 49593147, 49496730, 49339368, 49433161, 49349368, 49377961, 49402825, 49313928, 49492169, 49234200, 49253015, 49336825, 49487177, 49367497, 49262951, 49993279, 49373481, 49266679, 49387929, 49439001, 49280712, 49461322, 49411161, 49392265, 49522826, 49227783, 49657499, 49335177, 49524746, 49345864, 49338296, 49434874, 49461385, 49435737, 49314744, 49300296, 49210135, 49323385, 49415865, 49218007, 49545738, 49349513, 49263495, 49646731, 49349049, 49322856, 49241047, 49934750, 49290632, 49369849, 49276824, 49511834, 49375064, 49498682, 49339560, 49589995, 49264888, 49843773, 49361928, 49359896, 49265128, 49252919, 49426873, 49343561], "p50_ns_numpy": 49386625.0, "p99_ns_numpy": 50393115.14, "maxrss_kib": 1293288, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/omega-256x256x256-warm.json b/evidence/MAX-CPU/raw/measure/omega-256x256x256-warm.json new file mode 100644 index 0000000..09f5bd1 --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/omega-256x256x256-warm.json @@ -0,0 +1 @@ +{"op": "omega", "shape": [256, 256, 256], "cache": "warm", "cold_ns": 3563896709, "iters": 300, "warmup": 20, "lat_ns": [49366616, 49388681, 49444441, 49564795, 49496954, 49582298, 49393865, 49668268, 49408073, 49426249, 49516474, 49492809, 49511161, 49367769, 49652363, 49468778, 49601963, 49292808, 49284551, 49360009, 49699180, 49274791, 49278552, 49499738, 49351624, 49370953, 49384265, 49390185, 49307432, 49737516, 49394921, 49436153, 49798557, 49509817, 49451450, 49306664, 49333400, 49375529, 49399817, 49500746, 49531066, 49251223, 49618027, 49294248, 49593867, 49551418, 49262504, 49480121, 49600219, 49603131, 49306312, 49654315, 49459130, 49407369, 49434793, 49381977, 49659579, 49495082, 49322200, 49263720, 49373128, 49500554, 49466554, 49264439, 49360937, 49535946, 49575099, 49426793, 49395721, 49285624, 49339896, 49502010, 49559882, 49417417, 49399993, 49314312, 49316008, 49314872, 49346393, 49355768, 49249080, 49771468, 49246616, 49337128, 49620763, 49543370, 49287096, 49260039, 49662524, 50014223, 49505930, 49448777, 49346088, 49383673, 49443913, 49439466, 49278871, 49367289, 49336952, 49467050, 49679387, 49529466, 49268216, 49579451, 49723404, 49341208, 49351529, 49522314, 49684763, 49621227, 49262344, 49324584, 49946174, 49328904, 49676780, 49279240, 49382504, 49603451, 49594043, 49541130, 49201623, 49302472, 49446073, 49381593, 49471946, 49826557, 49461545, 49358969, 49291400, 49358440, 49403513, 49325784, 49536058, 49313208, 49551883, 49430777, 49269512, 49686027, 49610987, 49632987, 49319800, 49585291, 49273544, 49788412, 49392217, 49335624, 49272040, 49671756, 49895981, 49322505, 49288807, 49377097, 49343640, 49475546, 49270248, 49276359, 49377209, 49741516, 49467514, 49357592, 49561195, 49315800, 49510586, 49343160, 49797357, 49269479, 49395929, 49665964, 49461977, 49396265, 49773277, 49389544, 49454810, 49606763, 49309704, 49454921, 49324424, 49338457, 49488233, 49447514, 49312744, 49600011, 49223223, 49329272, 49327480, 49699900, 49443961, 49339545, 49338488, 49236343, 49352617, 49386632, 49364697, 49341864, 49236296, 49460137, 49266696, 49348552, 49431257, 49395865, 49326104, 49425529, 49476538, 49427913, 49292808, 49299528, 49536858, 49323000, 49398025, 49331273, 49723468, 49304647, 49330505, 49653867, 49445593, 49516490, 49527898, 49439434, 49721724, 49519258, 49563882, 49415881, 49697372, 49341896, 49271656, 49329880, 49531770, 49305576, 49499482, 49783725, 49284183, 49752301, 49388809, 49531242, 49275767, 49465258, 49317720, 49248936, 49247975, 49235543, 49225704, 49547194, 49446585, 49411305, 49568971, 49396920, 49477626, 49424761, 49324088, 49468826, 49365721, 49558442, 49441593, 49736284, 49219224, 49290471, 49766493, 49415369, 49370664, 49324345, 49721756, 49620779, 49543530, 49278264, 49468537, 49237767, 49454666, 49273543, 49286568, 49267192, 49483178, 49387992, 49463977, 49805885, 49865373, 49447529, 49493146, 49292024, 49240999, 49231144, 49261191, 49370553, 49355384, 49827645, 49398505, 49834525, 49384985, 49315240, 49628987, 50083104, 49265175, 49643547, 49313049, 49255879, 49324408, 49595467, 49354488, 49271176, 49314664, 49240696], "p50_ns_numpy": 49399161.0, "p99_ns_numpy": 49896482.93, "maxrss_kib": 595872, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/omega_nocat-16x16x8-fresh.json b/evidence/MAX-CPU/raw/measure/omega_nocat-16x16x8-fresh.json new file mode 100644 index 0000000..489cad8 --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/omega_nocat-16x16x8-fresh.json @@ -0,0 +1 @@ +{"op": "omega_nocat", "shape": [16, 16, 8], "cache": "fresh", "cold_ns": 11456389175, "iters": 300, "warmup": 20, "lat_ns": [262978, 62273, 248338, 56257, 263763, 59792, 245138, 93313, 370196, 53616, 35233, 260498, 54065, 238530, 73569, 251202, 57729, 34576, 260899, 51456, 262451, 189089, 260259, 56848, 44465, 274643, 62784, 261619, 57440, 37409, 255202, 42992, 35521, 244658, 58401, 254866, 58641, 37152, 277267, 57392, 253187, 59616, 38001, 245106, 58097, 247442, 269779, 79552, 59649, 249714, 40977, 247586, 63905, 39824, 247890, 106625, 247683, 59392, 247603, 58592, 262691, 58912, 261715, 58880, 247523, 56336, 255827, 57712, 246579, 61312, 247907, 57952, 247123, 56736, 270115, 58160, 248307, 61456, 247251, 57520, 250227, 57504, 243907, 54816, 469829, 53696, 35457, 239218, 250050, 69985, 251266, 69105, 274739, 85040, 66529, 260995, 64080, 62481, 49888, 54065, 60224, 54129, 55680, 43905, 46528, 46865, 45888, 60193, 45264, 48993, 62960, 268947, 72785, 148513, 103633, 60081, 259282, 57601, 248786, 58689, 260018, 95873, 43632, 241955, 179153, 266339, 63089, 39664, 247618, 59889, 243266, 190802, 49409, 251474, 55105, 250482, 59361, 252114, 60753, 249618, 55840, 251650, 59473, 249522, 58080, 249619, 68593, 258754, 59953, 461684, 87729, 77105, 463300, 57969, 254850, 57105, 252978, 76897, 460084, 54865, 250962, 52449, 461764, 58529, 251922, 183698, 468884, 86465, 57905, 457764, 56417, 251650, 52049, 251890, 65137, 250802, 52032, 251187, 55200, 256387, 53584, 252995, 75249, 256082, 50528, 252835, 60065, 252402, 54720, 257555, 54816, 252162, 63201, 39952, 247586, 52769, 252722, 65425, 36512, 243282, 59697, 257539, 254130, 62273, 263970, 63169, 263794, 251603, 203458, 46624, 245442, 246771, 253090, 206978, 49249, 245490, 246770, 248499, 208754, 49184, 263875, 249106, 60689, 45008, 252307, 75168, 176002, 248242, 250979, 37008, 244547, 258146, 55281, 269426, 41281, 262434, 150753, 98337, 249219, 250978, 250051, 290450, 88961, 86017, 165394, 249010, 52321, 246978, 251330, 267011, 56656, 243731, 52976, 95825, 157298, 46032, 111617, 139746, 305123, 263602, 275795, 73328, 256546, 57793, 253202, 64305, 281986, 267347, 42240, 463957, 163857, 265699, 55872, 104001, 149362, 268002, 46321, 248210, 49233, 259426, 208818, 51089, 101377, 161265, 54449, 97841, 155921, 45489, 160961, 85217, 66721, 116017, 64992, 92849, 160578, 53760, 99473, 153314, 47312, 161442], "p50_ns_numpy": 105313.0, "p99_ns_numpy": 463306.57, "maxrss_kib": 1268388, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/omega_nocat-16x16x8-warm.json b/evidence/MAX-CPU/raw/measure/omega_nocat-16x16x8-warm.json new file mode 100644 index 0000000..92a467c --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/omega_nocat-16x16x8-warm.json @@ -0,0 +1 @@ +{"op": "omega_nocat", "shape": [16, 16, 8], "cache": "warm", "cold_ns": 3567137625, "iters": 300, "warmup": 20, "lat_ns": [55441, 62656, 78737, 60465, 57872, 40497, 55360, 47137, 41088, 40592, 60289, 41216, 54529, 38288, 45025, 45616, 47697, 57184, 60593, 48800, 55825, 48512, 48993, 51040, 44545, 51296, 48433, 59136, 46049, 47936, 57649, 47328, 45617, 58400, 50225, 46224, 59585, 46096, 59457, 59840, 47729, 45680, 57201, 48112, 45265, 59088, 77985, 45904, 46705, 45936, 47041, 56064, 45953, 46128, 58929, 46048, 45761, 66816, 49745, 260722, 56177, 46048, 49473, 44976, 47809, 43456, 43616, 45457, 45360, 56577, 48016, 46321, 64480, 53681, 49232, 58529, 47872, 55569, 56865, 47168, 47120, 50497, 43648, 45313, 44192, 65105, 47312, 43633, 56912, 43969, 43648, 44049, 65104, 47473, 43888, 58049, 45840, 44272, 50497, 44928, 44129, 50752, 47153, 45472, 44385, 58928, 48625, 47088, 59505, 46688, 44641, 43952, 62065, 261970, 62737, 255378, 51825, 252370, 260515, 49952, 252995, 47696, 249714, 64241, 42688, 274851, 55889, 249186, 61441, 252098, 46176, 249667, 45936, 249315, 46656, 35329, 246450, 49744, 263379, 40832, 60753, 67968, 53697, 50432, 267603, 69201, 70480, 57873, 47888, 49409, 54720, 47665, 53584, 53633, 48640, 49473, 53600, 47345, 45536, 52833, 45696, 47377, 47200, 56401, 46864, 52369, 57664, 46705, 46464, 57201, 47136, 44817, 61504, 52065, 48160, 54929, 46608, 48593, 58944, 49105, 51056, 54785, 51184, 43409, 56528, 48049, 44432, 59713, 46592, 43968, 44001, 71137, 50800, 45265, 268978, 55713, 47024, 259987, 58320, 261523, 49040, 40369, 259042, 53665, 42656, 42736, 254179, 58784, 261043, 55712, 39825, 44064, 49409, 50096, 58241, 255474, 54449, 249842, 78545, 251890, 55089, 251490, 51121, 266386, 71729, 256786, 48449, 255458, 53041, 261378, 54897, 66160, 51201, 53873, 67120, 50353, 47440, 47057, 48848, 47025, 57280, 53969, 49152, 57953, 47760, 263667, 62000, 50513, 46816, 266755, 67712, 261571, 53744, 48497, 48736, 51217, 46464, 52785, 50768, 46065, 48272, 46577, 45792, 49473, 47184, 47248, 46865, 48944, 46257, 48640, 45537, 51040, 46161, 53072, 50561, 47024, 46145, 53104, 47089, 46096, 45296, 45713, 45760, 45201, 47392, 46417, 45584, 46785, 48320, 46577, 47312, 47568, 47521, 48736, 47937, 53872, 47793, 49552, 55761, 48048], "p50_ns_numpy": 49409.0, "p99_ns_numpy": 266763.48, "maxrss_kib": 594384, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/omega_nocat-256x256x256-fresh.json b/evidence/MAX-CPU/raw/measure/omega_nocat-256x256x256-fresh.json new file mode 100644 index 0000000..01a6f04 --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/omega_nocat-256x256x256-fresh.json @@ -0,0 +1 @@ +{"op": "omega_nocat", "shape": [256, 256, 256], "cache": "fresh", "cold_ns": 11110332432, "iters": 300, "warmup": 20, "lat_ns": [49296024, 49173415, 49278679, 49196151, 49236856, 49303383, 49268056, 49336536, 49326313, 49319256, 49213047, 49175414, 49313928, 49222232, 49233143, 49313944, 49228215, 49286984, 49280488, 49194071, 49209479, 49213975, 49329288, 49299528, 49200823, 49336232, 49234152, 49218647, 49182630, 49176903, 49266168, 49242455, 50043487, 49203063, 49226759, 49331321, 49252183, 49328200, 49303688, 49213143, 49217320, 49329544, 49303608, 49303912, 49240695, 49241239, 49377705, 49181975, 49220503, 49220471, 49277352, 49312872, 49313448, 49247623, 49289688, 49387337, 49327672, 49362201, 49229127, 49313656, 49209575, 49219367, 49223207, 49219431, 49215080, 49309512, 49228247, 49235623, 49325512, 49302872, 49359801, 49265287, 49323064, 49258072, 49279160, 49338568, 49407337, 49522826, 49572587, 49615562, 49228232, 49250087, 49158151, 49272023, 49269560, 49248727, 49268456, 49242231, 49243096, 49143190, 49144455, 49147542, 49265160, 49160630, 49251704, 49230807, 49221031, 49229639, 49303112, 49258568, 49178775, 49377864, 49262856, 49354040, 49386425, 49417625, 49304312, 49303656, 49193751, 49311768, 49452713, 49383881, 49304248, 49384169, 49365048, 49504122, 49398073, 49460665, 49271864, 49398985, 49276360, 49300584, 49269751, 49212167, 49170119, 49282840, 49272039, 49295384, 49307784, 49262904, 49256711, 49265880, 49164726, 49192967, 49250968, 49178647, 49169958, 49201831, 49173079, 49245799, 49184775, 49275560, 49349800, 49351401, 49231511, 49285016, 49186710, 49292264, 49175479, 49296264, 49167655, 49261111, 49253624, 49193750, 49162199, 49148375, 49276231, 49279448, 49272248, 49178550, 49276168, 49261352, 49276119, 49273112, 49245479, 49167335, 49290168, 49265191, 49267864, 49252888, 49198294, 49147447, 49169591, 49183078, 49165607, 49245015, 49169751, 49149383, 49146166, 49160807, 49165318, 49165943, 49265159, 49163671, 49275592, 49199319, 49200519, 49263895, 49180743, 49192295, 49188519, 49187879, 49190678, 49158647, 49296600, 49285192, 49450409, 49421289, 49426041, 49355561, 49303720, 49211607, 49413945, 49248247, 49185511, 49273656, 49243527, 49269160, 49262871, 49251576, 49176518, 49305272, 49171703, 49154599, 49153958, 49131990, 49135751, 49229991, 49160998, 49441066, 49289576, 49262103, 49172039, 49264135, 49164007, 49154262, 49192743, 49208087, 49154631, 49160215, 49168726, 49175911, 49153734, 49242120, 49202007, 49217255, 49254391, 49214039, 49179815, 49332504, 49235608, 49194823, 49305464, 49181414, 49231576, 49232807, 49300808, 49271591, 49242040, 49211415, 49175687, 49196199, 49263351, 49284904, 49305624, 49299176, 49194455, 49296872, 49279943, 49477786, 49396873, 49284215, 49521547, 49516314, 49174470, 49169239, 49195207, 49193607, 49378312, 49196967, 49165655, 49251991, 49187927, 49200295, 49176871, 49188711, 49189799, 49187606, 49182583, 49203655, 49464506, 49347816, 49385449, 49391017, 49349112, 49197111, 49179431, 49263015, 49266968, 49171703, 49196358, 49176183, 49147287, 49148166, 49270136, 49139558, 49199015, 49165143, 49195463, 49166646], "p50_ns_numpy": 49246711.0, "p99_ns_numpy": 49523323.61, "maxrss_kib": 1268816, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/omega_nocat-256x256x256-warm.json b/evidence/MAX-CPU/raw/measure/omega_nocat-256x256x256-warm.json new file mode 100644 index 0000000..1906942 --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/omega_nocat-256x256x256-warm.json @@ -0,0 +1 @@ +{"op": "omega_nocat", "shape": [256, 256, 256], "cache": "warm", "cold_ns": 3580450816, "iters": 300, "warmup": 20, "lat_ns": [49378889, 49294392, 49327320, 49242727, 49389193, 49235191, 49341449, 49268151, 49351225, 49274039, 49248295, 49350568, 49259864, 49312328, 49314680, 49417321, 49269031, 49235367, 49354856, 49324056, 49238488, 49368888, 49357177, 49326552, 49339864, 49336968, 49287064, 49321384, 49276232, 49396985, 49356792, 49321544, 49314440, 49271768, 49446057, 49262152, 49262135, 49251960, 49212055, 49232423, 49181095, 49896846, 49182294, 49349545, 49230583, 49326024, 49269432, 49210151, 49214663, 49183207, 49238967, 49299224, 49211703, 49127062, 49563115, 49213735, 49171542, 49143703, 49140982, 49135783, 49139670, 49198279, 49197607, 49274055, 49190567, 49145655, 49243543, 49164983, 49292488, 49177350, 49225863, 49194247, 49168951, 49184503, 49175047, 49245767, 49254871, 49161495, 49266696, 49161638, 49116214, 49148775, 49170518, 49159127, 49190391, 49185975, 49184342, 49167847, 49191607, 49281576, 49171158, 49163063, 49145622, 49239912, 49171190, 49162231, 49172039, 49260295, 49249544, 49274903, 49156983, 49272823, 49351193, 49424681, 49205943, 49191383, 49316120, 49310616, 49264951, 49264007, 49259464, 49281527, 49232984, 49135206, 49261255, 49162343, 49166695, 49205047, 49256407, 49263304, 49256519, 49234247, 49223863, 49281255, 49233896, 49167430, 49156375, 49171606, 49174455, 49188679, 49183335, 49140134, 49129575, 49170166, 49275784, 49194903, 49196247, 49184918, 49191895, 49188263, 49280824, 49264791, 49257736, 49268760, 49252151, 49249719, 49248584, 49158182, 49193735, 49316184, 49191495, 49301000, 49301816, 49262552, 49268967, 49272104, 49178919, 49280807, 49188759, 49175479, 49254183, 49286008, 49203015, 49495082, 49305880, 49246823, 49190967, 49200855, 49226519, 49202359, 49206679, 49179447, 49308136, 49281368, 49248071, 49207719, 49323624, 49277096, 49266247, 49332345, 49281335, 49301576, 49314008, 49515626, 49327240, 49219128, 49311368, 49221815, 49211719, 49185207, 49192759, 49196918, 49182311, 49184791, 49279384, 49390361, 49176566, 49219703, 49332441, 49239031, 49183079, 49185655, 49194966, 49224488, 49209575, 49206039, 49211239, 49316952, 49342072, 49174407, 49284295, 49255368, 49240295, 49166903, 49212423, 49197223, 49198967, 49258567, 49313768, 49290616, 49290120, 49236231, 49315464, 49204743, 49203287, 49355129, 49270487, 49198311, 49281480, 49206999, 49240423, 49125671, 49209463, 49137222, 49255240, 49236967, 49245143, 49289016, 49157815, 49249095, 49198247, 49152582, 49141879, 49269687, 49186135, 49257448, 49259783, 49169767, 49246007, 49158759, 49264151, 49166951, 49177879, 49264295, 49260424, 49218231, 49224247, 49194391, 49203431, 49310360, 49163559, 49194502, 49220040, 49199142, 49215863, 49375864, 49194023, 49200279, 49180855, 49192407, 49223927, 49218663, 49195287, 49455849, 49384041, 49407161, 49521994, 49446713, 49477914, 49370585, 49227447, 49177991, 49810684, 49502410, 49219703, 49563563, 49168054, 49230888, 49171702, 50251553, 49366953, 49466889, 49233368, 49232231, 49180055, 49175990, 49158759, 49152662, 49376553, 49312952], "p50_ns_numpy": 49235279.0, "p99_ns_numpy": 49566034.21, "maxrss_kib": 595808, "affinity": [10, 11, 12, 13, 14]} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/measure/summary.tsv b/evidence/MAX-CPU/raw/measure/summary.tsv new file mode 100644 index 0000000..9b1f78e --- /dev/null +++ b/evidence/MAX-CPU/raw/measure/summary.tsv @@ -0,0 +1,17 @@ +op shape cache cold_ns iters p50_ns p99_ns maxrss_kib +omega 16x16x8 fresh 12646882241 300 72464.5 282208.4099999998 1292596 +omega 16x16x8 warm 3559380767 300 156273.5 471051.8499999999 595448 +omega_nocat 16x16x8 fresh 11456389175 300 105313.0 463306.57 1268388 +omega_nocat 16x16x8 warm 3567137625 300 49409.0 266763.48 594384 +concat 16x16x8 fresh 12509559143 300 34256.0 261898.49 1292260 +concat 16x16x8 warm 3539189563 300 36136.5 51457.47 595036 +matmul 16x16x8 fresh 30533144903 300 36488.5 451759.36 1440164 +matmul 16x16x8 warm 3607070291 300 35352.0 270482.36 594344 +omega 256x256x256 fresh 12756905723 300 49386625.0 50393115.14 1293288 +omega 256x256x256 warm 3563896709 300 49399161.0 49896482.93 595872 +omega_nocat 256x256x256 fresh 11110332432 300 49246711.0 49523323.61 1268816 +omega_nocat 256x256x256 warm 3580450816 300 49235279.0 49566034.21 595808 +concat 256x256x256 fresh 12517941577 300 172410.0 3015567.269999997 1293072 +concat 256x256x256 warm 3609521349 300 157226.0 1031949.899999994 596380 +matmul 256x256x256 fresh 28395886859 300 319987.0 1901823.0099999956 1441448 +matmul 256x256x256 warm 3467098976 300 439308.5 1997252.7799999986 595948 diff --git a/evidence/MAX-CPU/raw/mogg-cache-repro.log b/evidence/MAX-CPU/raw/mogg-cache-repro.log new file mode 100644 index 0000000..3134f8b --- /dev/null +++ b/evidence/MAX-CPU/raw/mogg-cache-repro.log @@ -0,0 +1,6 @@ +1-extcall-cacheA got: setup for model om_omega_16x16x8 returned error: Failed to materialize symbols: { (e9 +2-fixed-cacheA got: setup for model om_omega_16x16x8 returned error: Failed to materialize symbols: { (e9 +3-fixed-cacheB-fresh got: ran +4-fixed-otherpath-cacheA got: setup for model om_omega_16x16x8 returned error: Failed to materialize symbols: { (e9 +6159e31aaa0743900543ba356c5156da29bb284f82932f51a0387ff07bc08e02 /dev/shm/omega-max-cpu/mogg-repro/pkg/kernels/__init__.mojo +6684216a1467cac78b6fcbab550f593b0e4d33d7078763c3abc8bb303f948fd2 /dev/shm/omega-max-cpu/extcall/kernels/__init__.mojo diff --git a/evidence/MAX-CPU/raw/mogg-cache-repro/1-extcall-cacheA.log b/evidence/MAX-CPU/raw/mogg-cache-repro/1-extcall-cacheA.log new file mode 100644 index 0000000..d8de975 --- /dev/null +++ b/evidence/MAX-CPU/raw/mogg-cache-repro/1-extcall-cacheA.log @@ -0,0 +1,5 @@ +JIT session error: Symbols not found: [ omega2_omatmul ] +kernels=/dev/shm/omega-max-cpu/mogg-repro/pkg/kernels +want 'Failed to materialize symbols' +got: setup for model om_omega_16x16x8 returned error: Failed to materialize symbols: { (e90983f5dd6e1ffd, { __kernel_6b9331666371684a7dd0784eae03ae3b, __kernel_e732968522176bb9b6944c8b8ed68aa0, mgp_buffer_constant, __kernel_533740d011cd087faf040ca33252b085, __kernel_9d2dc342c9d9544105e7d67621a848b8, __kernel_1be5131368383a2cb534e23e78edd3b7, __kernel_1b2c0abe58bc92f837d49b13aec8ba6d, __kernel_05bbea54493150d81bee7f9b5706111d }) } +OMEGA_MAX_NEG_LOAD: PASS diff --git a/evidence/MAX-CPU/raw/mogg-cache-repro/2-fixed-cacheA.log b/evidence/MAX-CPU/raw/mogg-cache-repro/2-fixed-cacheA.log new file mode 100644 index 0000000..9d5a661 --- /dev/null +++ b/evidence/MAX-CPU/raw/mogg-cache-repro/2-fixed-cacheA.log @@ -0,0 +1,5 @@ +JIT session error: Symbols not found: [ omega2_omatmul ] +kernels=/dev/shm/omega-max-cpu/mogg-repro/pkg/kernels +want 'Failed to materialize symbols' +got: setup for model om_omega_16x16x8 returned error: Failed to materialize symbols: { (e90983f5dd6e1ffd, { __kernel_e732968522176bb9b6944c8b8ed68aa0, __kernel_1b2c0abe58bc92f837d49b13aec8ba6d, mgp_buffer_constant, __kernel_05bbea54493150d81bee7f9b5706111d, __kernel_6b9331666371684a7dd0784eae03ae3b, __kernel_9d2dc342c9d9544105e7d67621a848b8, __kernel_1be5131368383a2cb534e23e78edd3b7, __kernel_533740d011cd087faf040ca33252b085 }) } +OMEGA_MAX_NEG_LOAD: PASS diff --git a/evidence/MAX-CPU/raw/mogg-cache-repro/3-fixed-cacheB-fresh.log b/evidence/MAX-CPU/raw/mogg-cache-repro/3-fixed-cacheB-fresh.log new file mode 100644 index 0000000..085fed9 --- /dev/null +++ b/evidence/MAX-CPU/raw/mogg-cache-repro/3-fixed-cacheB-fresh.log @@ -0,0 +1,4 @@ +kernels=/dev/shm/omega-max-cpu/mogg-repro/pkg/kernels +want 'Failed to materialize symbols' +got: ran +OMEGA_MAX_NEG_LOAD: FAIL diff --git a/evidence/MAX-CPU/raw/mogg-cache-repro/4-fixed-otherpath-cacheA.log b/evidence/MAX-CPU/raw/mogg-cache-repro/4-fixed-otherpath-cacheA.log new file mode 100644 index 0000000..6120670 --- /dev/null +++ b/evidence/MAX-CPU/raw/mogg-cache-repro/4-fixed-otherpath-cacheA.log @@ -0,0 +1,5 @@ +JIT session error: Symbols not found: [ omega2_omatmul ] +kernels=/dev/shm/omega-max-cpu/mogg-repro/other/kernels +want 'Failed to materialize symbols' +got: setup for model om_omega_16x16x8 returned error: Failed to materialize symbols: { (e90983f5dd6e1ffd, { mgp_buffer_constant, __kernel_e732968522176bb9b6944c8b8ed68aa0, __kernel_6b9331666371684a7dd0784eae03ae3b, __kernel_533740d011cd087faf040ca33252b085, __kernel_1be5131368383a2cb534e23e78edd3b7, __kernel_1b2c0abe58bc92f837d49b13aec8ba6d, __kernel_05bbea54493150d81bee7f9b5706111d, __kernel_9d2dc342c9d9544105e7d67621a848b8 }) } +OMEGA_MAX_NEG_LOAD: PASS diff --git a/evidence/MAX-CPU/raw/mogg-cache-repro/cacheA-after-1.txt b/evidence/MAX-CPU/raw/mogg-cache-repro/cacheA-after-1.txt new file mode 100644 index 0000000..8408ee1 --- /dev/null +++ b/evidence/MAX-CPU/raw/mogg-cache-repro/cacheA-after-1.txt @@ -0,0 +1,11 @@ +cacheA/.max_cache/mof/mef/26.7.0/ekQvuESPoz6515xUm3sd2zFv7QtscZ7X2f2J_q5geQU +cacheA/.mogg_cache/40ca5228723a2c59/26.7.0/MDViYmVhNTQ0OTMxNTBkODFiZWU3ZjliNTcwNjExMWQ +cacheA/.mogg_cache/40ca5228723a2c59/26.7.0/MWIyYzBhYmU1OGJjOTJmODM3ZDQ5YjEzYWVjOGJhNmQ +cacheA/.mogg_cache/40ca5228723a2c59/26.7.0/MWJlNTEzMTM2ODM4M2EyY2I1MzRlMjNlNzhlZGQzYjc +cacheA/.mogg_cache/40ca5228723a2c59/26.7.0/NmI5MzMxNjY2MzcxNjg0YTdkZDA3ODRlYWUwM2FlM2I +cacheA/.mogg_cache/40ca5228723a2c59/26.7.0/NTMzNzQwZDAxMWNkMDg3ZmFmMDQwY2EzMzI1MmIwODU +cacheA/.mogg_cache/40ca5228723a2c59/26.7.0/OWQyZGMzNDJjOWQ5NTQ0MTA1ZTdkNjc2MjFhODQ4Yjg +cacheA/.mogg_cache/40ca5228723a2c59/26.7.0/ZTczMjk2ODUyMjE3NmJiOWI2OTQ0YzhiOGVkNjhhYTA +cacheA/.mojo_cache/mojo/transform/1.2.00d90e8e1b89ca880f90162e41a6f61c0-production/MTM0ZjEwMzMzZGQyMzBmZDM1NDNjMmJmZWJkN2U5N2Y +cacheA/.mojo_cache/mojo/transform/1.2.00d90e8e1b89ca880f90162e41a6f61c0-production/NWJlNzQ5YjgyZmI0MDIxODZjNjJjNjZkNmY0NTY0ODU +cacheA/.mojo_cache/mojo/transform/1.2.00d90e8e1b89ca880f90162e41a6f61c0-production/NzgwYzI1M2FkOGY4ODRjM2YzNGRiNTg4YzNlYzZjZjg diff --git a/evidence/MAX-CPU/raw/mogg-cache-repro/cacheA-after-2.txt b/evidence/MAX-CPU/raw/mogg-cache-repro/cacheA-after-2.txt new file mode 100644 index 0000000..485ccf0 --- /dev/null +++ b/evidence/MAX-CPU/raw/mogg-cache-repro/cacheA-after-2.txt @@ -0,0 +1,16 @@ +cacheA/.max_cache/mof/mef/26.7.0/0seo-uKg2QWlvj0EdPMpN1nGmxkWV92TvFq3LmyM3-s +cacheA/.max_cache/mof/mef/26.7.0/ekQvuESPoz6515xUm3sd2zFv7QtscZ7X2f2J_q5geQU +cacheA/.mogg_cache/40ca5228723a2c59/26.7.0/MDViYmVhNTQ0OTMxNTBkODFiZWU3ZjliNTcwNjExMWQ +cacheA/.mogg_cache/40ca5228723a2c59/26.7.0/MWIyYzBhYmU1OGJjOTJmODM3ZDQ5YjEzYWVjOGJhNmQ +cacheA/.mogg_cache/40ca5228723a2c59/26.7.0/MWJlNTEzMTM2ODM4M2EyY2I1MzRlMjNlNzhlZGQzYjc +cacheA/.mogg_cache/40ca5228723a2c59/26.7.0/NmI5MzMxNjY2MzcxNjg0YTdkZDA3ODRlYWUwM2FlM2I +cacheA/.mogg_cache/40ca5228723a2c59/26.7.0/NTMzNzQwZDAxMWNkMDg3ZmFmMDQwY2EzMzI1MmIwODU +cacheA/.mogg_cache/40ca5228723a2c59/26.7.0/OTdkZDkyMjgwMzhiMTJmMDYzNmI5YjU3YTNhNTBiYjQ +cacheA/.mogg_cache/40ca5228723a2c59/26.7.0/OWQyZGMzNDJjOWQ5NTQ0MTA1ZTdkNjc2MjFhODQ4Yjg +cacheA/.mogg_cache/40ca5228723a2c59/26.7.0/ZTczMjk2ODUyMjE3NmJiOWI2OTQ0YzhiOGVkNjhhYTA +cacheA/.mojo_cache/mojo/transform/1.2.00d90e8e1b89ca880f90162e41a6f61c0-production/MTA4ZTQwYWEzOGY5NWU2NDc5MmFmYjkzYTRkNzBmMWQ +cacheA/.mojo_cache/mojo/transform/1.2.00d90e8e1b89ca880f90162e41a6f61c0-production/MTM0ZjEwMzMzZGQyMzBmZDM1NDNjMmJmZWJkN2U5N2Y +cacheA/.mojo_cache/mojo/transform/1.2.00d90e8e1b89ca880f90162e41a6f61c0-production/MzYxOGZjNTUxZTIyZjgzM2JlMmEwYTQ2YTkxMDc0NzM +cacheA/.mojo_cache/mojo/transform/1.2.00d90e8e1b89ca880f90162e41a6f61c0-production/NWJlNzQ5YjgyZmI0MDIxODZjNjJjNjZkNmY0NTY0ODU +cacheA/.mojo_cache/mojo/transform/1.2.00d90e8e1b89ca880f90162e41a6f61c0-production/NzgwYzI1M2FkOGY4ODRjM2YzNGRiNTg4YzNlYzZjZjg +cacheA/.mojo_cache/mojo/transform/1.2.00d90e8e1b89ca880f90162e41a6f61c0-production/ODA1NWNiZWU2M2I1YWIzNTg4YWY2MWU5MDQ1MzMzZTU diff --git a/evidence/MAX-CPU/raw/neg-extcall.log b/evidence/MAX-CPU/raw/neg-extcall.log new file mode 100644 index 0000000..2d44ae7 --- /dev/null +++ b/evidence/MAX-CPU/raw/neg-extcall.log @@ -0,0 +1,5 @@ +JIT session error: Symbols not found: [ omega2_omatmul ] +kernels=/dev/shm/omega-max-cpu/extcall/kernels +want 'Failed to materialize symbols' +got: setup for model om_omega_16x16x8 returned error: Failed to materialize symbols: { (ac32e635ea223012, { mgp_buffer_constant, __kernel_e732968522176bb9b6944c8b8ed68aa0, __kernel_1be5131368383a2cb534e23e78edd3b7, __kernel_533740d011cd087faf040ca33252b085, __kernel_1b2c0abe58bc92f837d49b13aec8ba6d, __kernel_6b9331666371684a7dd0784eae03ae3b, __kernel_05bbea54493150d81bee7f9b5706111d, __kernel_9d2dc342c9d9544105e7d67621a848b8 }) } +OMEGA_MAX_NEG_LOAD: PASS diff --git a/evidence/MAX-CPU/raw/neg-mutant.json b/evidence/MAX-CPU/raw/neg-mutant.json new file mode 100644 index 0000000..aa72ac3 --- /dev/null +++ b/evidence/MAX-CPU/raw/neg-mutant.json @@ -0,0 +1,245 @@ +{ + "lib": "/dev/shm/omega-max-cpu/lib-mutant/libomega_native.so", + "rows": [ + { + "shape": [ + 1, + 1, + 1 + ], + "case": "random", + "load_s": 33.18681114498759, + "tol_ref": 0.0, + "tol_max": 0.0, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 1, + 1, + 1 + ], + "case": "zeros", + "load_s": 33.18681114498759, + "tol_ref": 0.0, + "tol_max": 0.0, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 1, + 1, + 1 + ], + "case": "identity", + "load_s": 33.18681114498759, + "tol_ref": 0.0, + "tol_max": 0.0, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 3, + 5, + 7 + ], + "case": "random", + "load_s": 29.470864246977726, + "tol_ref": 2.384186363890841e-07, + "tol_max": 4.768372718899898e-07, + "ratio_ref": 14123535.801890196, + "maxerr_ref": 3.211482048034668, + "ratio_max": 7061767.914098662, + "maxerr_max": 3.211482048034668, + "result": "FAIL" + }, + { + "shape": [ + 3, + 5, + 7 + ], + "case": "zeros", + "load_s": 29.470864246977726, + "tol_ref": 2.384186363890841e-07, + "tol_max": 4.768372718899898e-07, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 16, + 16, + 8 + ], + "case": "random", + "load_s": 29.13271914701909, + "tol_ref": 8.940704726574863e-07, + "tol_max": 1.788140941984304e-06, + "ratio_ref": 1665955.7812995366, + "maxerr_ref": 13.617825508117676, + "ratio_max": 832977.892201309, + "maxerr_max": 13.617825508117676, + "result": "FAIL" + }, + { + "shape": [ + 16, + 16, + 8 + ], + "case": "zeros", + "load_s": 29.13271914701909, + "tol_ref": 8.940704726574863e-07, + "tol_max": 1.788140941984304e-06, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 16, + 16, + 8 + ], + "case": "large", + "load_s": 29.13271914701909, + "tol_ref": 8.940704726574863e-07, + "tol_max": 1.788140941984304e-06, + "ratio_ref": 1665955.7812995366, + "maxerr_ref": 1.8101194907103962e+37, + "ratio_max": 832977.892201309, + "maxerr_max": 1.8101194907103962e+37, + "result": "FAIL" + }, + { + "shape": [ + 33, + 17, + 9 + ], + "case": "random", + "load_s": 29.32036009299918, + "tol_ref": 9.53675227678176e-07, + "tol_max": 1.907350451803638e-06, + "ratio_ref": 1741198.1685967492, + "maxerr_ref": 17.248628616333008, + "ratio_max": 870599.0697071122, + "maxerr_max": 17.248628616333008, + "result": "FAIL" + }, + { + "shape": [ + 33, + 17, + 9 + ], + "case": "zeros", + "load_s": 29.32036009299918, + "tol_ref": 9.53675227678176e-07, + "tol_max": 1.907350451803638e-06, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 64, + 128, + 32 + ], + "case": "random", + "load_s": 28.917970139998943, + "tol_ref": 7.569847202727132e-06, + "tol_max": 1.51396943772546e-05, + "ratio_ref": 91290.39945158098, + "maxerr_ref": 55.392067551612854, + "ratio_max": 45645.198906754085, + "maxerr_max": 55.39206790924072, + "result": "FAIL" + }, + { + "shape": [ + 64, + 128, + 32 + ], + "case": "zeros", + "load_s": 28.917970139998943, + "tol_ref": 7.569847202727132e-06, + "tol_max": 1.51396943772546e-05, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 256, + 256, + 256 + ], + "case": "random", + "load_s": 27.873068246000912, + "tol_ref": 1.519941546475356e-05, + "tol_max": 3.039883087288574e-05, + "ratio_ref": 0.006772649166662281, + "maxerr_ref": 1.745671033859253e-05, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 256, + 256, + 256 + ], + "case": "zeros", + "load_s": 27.873068246000912, + "tol_ref": 1.519941546475356e-05, + "tol_max": 3.039883087288574e-05, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + }, + { + "shape": [ + 256, + 256, + 256 + ], + "case": "identity", + "load_s": 27.873068246000912, + "tol_ref": 1.519941546475356e-05, + "tol_max": 3.039883087288574e-05, + "ratio_ref": 0.0, + "maxerr_ref": 0.0, + "ratio_max": 0.0, + "maxerr_max": 0.0, + "result": "PASS" + } + ] +} \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/neg-mutant.log b/evidence/MAX-CPU/raw/neg-mutant.log new file mode 100644 index 0000000..66ad193 --- /dev/null +++ b/evidence/MAX-CPU/raw/neg-mutant.log @@ -0,0 +1,16 @@ +1x1x1 random ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +1x1x1 zeros ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +1x1x1 identity ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +3x5x7 random ratio_ref=1.41e+07 maxerr_ref=3.21 ratio_max=7.06e+06 maxerr_max=3.21 FAIL +3x5x7 zeros ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +16x16x8 random ratio_ref=1.67e+06 maxerr_ref=13.6 ratio_max=8.33e+05 maxerr_max=13.6 FAIL +16x16x8 zeros ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +16x16x8 large ratio_ref=1.67e+06 maxerr_ref=1.81e+37 ratio_max=8.33e+05 maxerr_max=1.81e+37 FAIL +33x17x9 random ratio_ref=1.74e+06 maxerr_ref=17.2 ratio_max=8.71e+05 maxerr_max=17.2 FAIL +33x17x9 zeros ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +64x128x32 random ratio_ref=9.13e+04 maxerr_ref=55.4 ratio_max=4.56e+04 maxerr_max=55.4 FAIL +64x128x32 zeros ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +256x256x256 random ratio_ref=0.00677 maxerr_ref=1.75e-05 ratio_max=0 maxerr_max=0 PASS +256x256x256 zeros ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +256x256x256 identity ratio_ref=0 maxerr_ref=0 ratio_max=0 maxerr_max=0 PASS +OMEGA_MAX_CHECK: FAIL diff --git a/evidence/MAX-CPU/raw/neg-shape.json b/evidence/MAX-CPU/raw/neg-shape.json new file mode 100644 index 0000000..8c8cd91 --- /dev/null +++ b/evidence/MAX-CPU/raw/neg-shape.json @@ -0,0 +1,52 @@ +[ + { + "shape": [ + 16, + 15, + 8 + ], + "want": "omega_matmul refused: status 0 result 2", + "got": "An error occurred in kernel entry point named \"__custom__omega_matmul_async\":\nAn error occurred in kernel named \"__custom__omega_matmul\":\nomega_matmul refused: status 0 result 2\n\nFusion info:\n custom__omega_matmul : (!mo.tensor<[384], bf16>, !mo.tensor<[3], si64>) -> !mo.tensor<[16, 8], f32>\n\n\nTo see the Python source location of this op, run again with the `max-debug.source-tracebacks` config key enabled (for example, `Graph.debug.source_tracebacks = True` or `MODULAR_DEBUG=source-tracebacks`).", + "result": "PASS" + }, + { + "shape": [ + 5000, + 16, + 8 + ], + "want": "omega_matmul refused: status 0 result 1", + "got": "An error occurred in kernel entry point named \"__custom__omega_matmul_async\":\nAn error occurred in kernel named \"__custom__omega_matmul\":\nomega_matmul refused: status 0 result 1\n\nFusion info:\n custom__omega_matmul : (!mo.tensor<[384], bf16>, !mo.tensor<[3], si64>) -> !mo.tensor<[16, 8], f32>\n\n\nTo see the Python source location of this op, run again with the `max-debug.source-tracebacks` config key enabled (for example, `Graph.debug.source_tracebacks = True` or `MODULAR_DEBUG=source-tracebacks`).", + "result": "PASS" + }, + { + "shape": [ + 0, + 16, + 8 + ], + "want": "omega_matmul refused: status 0 result 1", + "got": "An error occurred in kernel entry point named \"__custom__omega_matmul_async\":\nAn error occurred in kernel named \"__custom__omega_matmul\":\nomega_matmul refused: status 0 result 1\n\nFusion info:\n custom__omega_matmul : (!mo.tensor<[384], bf16>, !mo.tensor<[3], si64>) -> !mo.tensor<[16, 8], f32>\n\n\nTo see the Python source location of this op, run again with the `max-debug.source-tracebacks` config key enabled (for example, `Graph.debug.source_tracebacks = True` or `MODULAR_DEBUG=source-tracebacks`).", + "result": "PASS" + }, + { + "shape": [ + 12, + 16, + 12 + ], + "want": "omega_matmul refused: status 0 result 3", + "got": "An error occurred in kernel entry point named \"__custom__omega_matmul_async\":\nAn error occurred in kernel named \"__custom__omega_matmul\":\nomega_matmul refused: status 0 result 3\n\nFusion info:\n custom__omega_matmul : (!mo.tensor<[384], bf16>, !mo.tensor<[3], si64>) -> !mo.tensor<[16, 8], f32>\n\n\nTo see the Python source location of this op, run again with the `max-debug.source-tracebacks` config key enabled (for example, `Graph.debug.source_tracebacks = True` or `MODULAR_DEBUG=source-tracebacks`).", + "result": "PASS" + }, + { + "after_refusals": "valid call", + "ratio_ref": 0.03355616799862188, + "result": "PASS" + }, + { + "graph": "ops.matmul [16,16]x[15,8]", + "got": "Failed to create op 'MatmulOp':", + "result": "PASS" + } +] \ No newline at end of file diff --git a/evidence/MAX-CPU/raw/neg-shape.log b/evidence/MAX-CPU/raw/neg-shape.log new file mode 100644 index 0000000..f81bd6d --- /dev/null +++ b/evidence/MAX-CPU/raw/neg-shape.log @@ -0,0 +1,39 @@ +shape=[16, 15, 8] want 'omega_matmul refused: status 0 result 2' got: An error occurred in kernel entry point named "__custom__omega_matmul_async": +An error occurred in kernel named "__custom__omega_matmul": +omega_matmul refused: status 0 result 2 + +Fusion info: + custom__omega_matmul : (!mo.tensor<[384], bf16>, !mo.tensor<[3], si64>) -> !mo.tensor<[16, 8], f32> + + +To see the Python source location of this op, run again with the `max-debug.source-tracebacks` config key enabled (for example, `Graph.debug.source_tracebacks = True` or `MODULAR_DEBUG=source-tracebacks`). -> PASS +shape=[5000, 16, 8] want 'omega_matmul refused: status 0 result 1' got: An error occurred in kernel entry point named "__custom__omega_matmul_async": +An error occurred in kernel named "__custom__omega_matmul": +omega_matmul refused: status 0 result 1 + +Fusion info: + custom__omega_matmul : (!mo.tensor<[384], bf16>, !mo.tensor<[3], si64>) -> !mo.tensor<[16, 8], f32> + + +To see the Python source location of this op, run again with the `max-debug.source-tracebacks` config key enabled (for example, `Graph.debug.source_tracebacks = True` or `MODULAR_DEBUG=source-tracebacks`). -> PASS +shape=[0, 16, 8] want 'omega_matmul refused: status 0 result 1' got: An error occurred in kernel entry point named "__custom__omega_matmul_async": +An error occurred in kernel named "__custom__omega_matmul": +omega_matmul refused: status 0 result 1 + +Fusion info: + custom__omega_matmul : (!mo.tensor<[384], bf16>, !mo.tensor<[3], si64>) -> !mo.tensor<[16, 8], f32> + + +To see the Python source location of this op, run again with the `max-debug.source-tracebacks` config key enabled (for example, `Graph.debug.source_tracebacks = True` or `MODULAR_DEBUG=source-tracebacks`). -> PASS +shape=[12, 16, 12] want 'omega_matmul refused: status 0 result 3' got: An error occurred in kernel entry point named "__custom__omega_matmul_async": +An error occurred in kernel named "__custom__omega_matmul": +omega_matmul refused: status 0 result 3 + +Fusion info: + custom__omega_matmul : (!mo.tensor<[384], bf16>, !mo.tensor<[3], si64>) -> !mo.tensor<[16, 8], f32> + + +To see the Python source location of this op, run again with the `max-debug.source-tracebacks` config key enabled (for example, `Graph.debug.source_tracebacks = True` or `MODULAR_DEBUG=source-tracebacks`). -> PASS +valid call after refusals ratio_ref=0.0336 PASS +graph construction ops.matmul [16,16]x[15,8]: Failed to create op 'MatmulOp': -> PASS +OMEGA_MAX_NEG_SHAPE: PASS diff --git a/evidence/MAX-CPU/raw/neg-wrongsym.log b/evidence/MAX-CPU/raw/neg-wrongsym.log new file mode 100644 index 0000000..bf65b50 --- /dev/null +++ b/evidence/MAX-CPU/raw/neg-wrongsym.log @@ -0,0 +1,12 @@ +kernels=/dev/shm/omega-max-cpu/wrongsym/kernels +want 'symbol not found: omega2_omatmul_missing' +got: An error occurred in kernel entry point named "__custom__omega_matmul_async": +An error occurred in kernel named "__custom__omega_matmul": +symbol not found: omega2_omatmul_missing + +Fusion info: + custom__omega_matmul : (!mo.tensor<[384], bf16>, !mo.tensor<[3], si64>) -> !mo.tensor<[16, 8], f32> + + +To see the Python source location of this op, run again with the `max-debug.source-tracebacks` config key enabled (for example, `Graph.debug.source_tracebacks = True` or `MODULAR_DEBUG=source-tracebacks`). +OMEGA_MAX_NEG_LOAD: PASS diff --git a/evidence/MAX-CPU/run1-harness-red/neg-extcall.log b/evidence/MAX-CPU/run1-harness-red/neg-extcall.log new file mode 100644 index 0000000..50d3fd7 --- /dev/null +++ b/evidence/MAX-CPU/run1-harness-red/neg-extcall.log @@ -0,0 +1,5 @@ +JIT session error: Symbols not found: [ omega2_omatmul ] +kernels=/dev/shm/omega-max-cpu/extcall/kernels +want 'Symbols not found' +got: setup for model om_omega_16x16x8 returned error: Failed to materialize symbols: { (ac32e635ea223012, { __kernel_1be5131368383a2cb534e23e78edd3b7, __kernel_1b2c0abe58bc92f837d49b13aec8ba6d, __kernel_533740d011cd087faf040ca33252b085, mgp_buffer_constant, __kernel_9d2dc342c9d9544105e7d67621a848b8, __kernel_6b9331666371684a7dd0784eae03ae3b, __kernel_05bbea54493150d81bee7f9b5706111d, __kernel_e732968522176bb9b6944c8b8ed68aa0 }) } +OMEGA_MAX_NEG_LOAD: FAIL diff --git a/evidence/MAX-CPU/run1-harness-red/neg-shape.log b/evidence/MAX-CPU/run1-harness-red/neg-shape.log new file mode 100644 index 0000000..537cdf0 --- /dev/null +++ b/evidence/MAX-CPU/run1-harness-red/neg-shape.log @@ -0,0 +1,7 @@ +shape=[16, 15, 8] want 'result 2' got: To see the Python source location of this op, run again with the `max-debug.source-tracebacks` config key enabled (for example, `Graph.debug.source_tracebacks = True` or `MODULAR_DEBUG=source-tracebacks`). -> FAIL +shape=[5000, 16, 8] want 'result 1' got: To see the Python source location of this op, run again with the `max-debug.source-tracebacks` config key enabled (for example, `Graph.debug.source_tracebacks = True` or `MODULAR_DEBUG=source-tracebacks`). -> FAIL +shape=[0, 16, 8] want 'result 1' got: To see the Python source location of this op, run again with the `max-debug.source-tracebacks` config key enabled (for example, `Graph.debug.source_tracebacks = True` or `MODULAR_DEBUG=source-tracebacks`). -> FAIL +shape=[12, 16, 12] want 'result 3' got: To see the Python source location of this op, run again with the `max-debug.source-tracebacks` config key enabled (for example, `Graph.debug.source_tracebacks = True` or `MODULAR_DEBUG=source-tracebacks`). -> FAIL +valid call after refusals ratio_ref=0.0336 PASS +graph construction ops.matmul [16,16]x[15,8]: Failed to create op 'MatmulOp': -> PASS +OMEGA_MAX_NEG_SHAPE: FAIL diff --git a/max-cpu/README.md b/max-cpu/README.md new file mode 100644 index 0000000..c44ce5d --- /dev/null +++ b/max-cpu/README.md @@ -0,0 +1,8 @@ +# max-cpu: Omega kernel as a MAX CPU custom op + +- `omatmul.om` — the kernel (seeded Omega, OM-2), built by `tools/native`. +- `kernels/__init__.mojo` — MAX custom-op glue `omega_matmul` (`OwnedDLHandle` + dlsym). +- `omega_max.py` — graphs, numeric check, negative controls, measurements. +- `run.sh` — the single reproduce target; `mogg-cache-repro.sh` — the MAX cache observation. + +Status EXERCISED(host CPU). Evidence, pins, results and gaps: [../evidence/MAX-CPU/README.md](../evidence/MAX-CPU/README.md). diff --git a/max-cpu/kernels/__init__.mojo b/max-cpu/kernels/__init__.mojo new file mode 100644 index 0000000..9a78c47 --- /dev/null +++ b/max-cpu/kernels/__init__.mojo @@ -0,0 +1,52 @@ +# MAX CPU custom op "omega_matmul": glue only. The matmul is the Omega unit max-cpu/omatmul.om, +# compiled by tools/native into libomega_native.so (export omega2_omatmul, native ABI v2, +# docs/NATIVE-ABI.md). +# +# c output float32 [M, N] written by Omega as f32 bit patterns +# ab input bfloat16 [M*K + K*N] A row-major, then B row-major (one view: six-slot limit) +# shape input int64 [3] [M, K, N] +# +# Symbol resolution: the caller loads libomega_native.so with RTLD_GLOBAL before the graph runs +# (max-cpu/omega_max.py). MAX 26.7's kernel JIT does not search the process image, so a plain +# external_call["omega2_omatmul", ...] fails at model load with "Symbols not found" +# (max-cpu/run.sh keeps that as a control). The call therefore resolves the same C symbol through +# dlopen(NULL)/dlsym (OwnedDLHandle() with no path), and a missing symbol raises. +# +# Omega refuses a bad shape with a nonzero result and leaves C untouched; the bridge refuses a bad +# pointer or length with a nonzero status. Either is raised here, so MAX fails the execution +# instead of returning C. + +import extensibility +from extensibility import InputTensor, OutputTensor +from std.ffi import OwnedDLHandle, external_call + + +@extensibility.register("omega_matmul", type="cpu") +struct OmegaMatmul: + @staticmethod + def execute[ + target: StaticString, + ]( + c: OutputTensor[dtype=DType.float32, rank=2, ...], + ab: InputTensor[dtype=DType.bfloat16, rank=1, ...], + shape: InputTensor[dtype=DType.int64, rank=1, ...], + ) raises: + comptime assert target == "cpu", "omega_matmul is a CPU op" + var result: UInt64 = 0 + var process = OwnedDLHandle() + var status = process.get_function[UInt32]("omega2_omatmul")( + Pointer(to=result), + ab.unsafe_ptr[DType.uint16](), + UInt64(ab.size()), + c.unsafe_ptr[DType.uint32](), + UInt64(c.size()), + shape.unsafe_ptr[DType.uint64](), + UInt64(shape.size()), + ) + if status != 0 or result != 0: + raise Error( + "omega_matmul refused: status " + + String(status) + + " result " + + String(result) + ) diff --git a/max-cpu/mogg-cache-repro.sh b/max-cpu/mogg-cache-repro.sh new file mode 100755 index 0000000..b543280 --- /dev/null +++ b/max-cpu/mogg-cache-repro.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# MAX 26.7.0 observation: a custom-op kernel compiled from one Mojo source is reused after that +# source changes, when the package path and MODULAR_CACHE_DIR stay the same. Needs max-cpu/run.sh +# to have built $BUILD first (lib/ and extcall/kernels). Prints one line per step; exit 0 always +# reports what it saw, it does not gate anything. +# TMPDIR=/dev/shm taskset -c 10-14 nice -n 19 ionice -c3 max-cpu/mogg-cache-repro.sh +set -eu +cd "$(dirname "$0")/.." +MAXPY=${MAXPY:-$HOME/workspace/maxinterop/venv/bin/python} +BUILD=${BUILD:-/dev/shm/omega-max-cpu} +R=$BUILD/mogg-repro +L=$BUILD/lib/libomega_native.so +rm -rf "$R" +mkdir -p "$R/pkg/kernels" "$R/other/kernels" +step() { # step NAME CACHE KERNELS: prints the error or "ran" + MODULAR_CACHE_DIR=$3 "$MAXPY" max-cpu/omega_max.py neg-load --lib "$L" --kernels "$2" \ + --want 'Failed to materialize symbols' >"$R/$1.log" 2>&1 || true + printf '%-26s %s\n' "$1" "$(grep '^got:' "$R/$1.log" | cut -c1-90)" +} +cp "$BUILD/extcall/kernels/__init__.mojo" "$R/pkg/kernels/" +step 1-extcall-cacheA "$R/pkg/kernels" "$R/cacheA" +find "$R/cacheA" -type f | sed "s|$R/||" | sort >"$R/cacheA-after-1.txt" +cp max-cpu/kernels/__init__.mojo "$R/pkg/kernels/" # the fixed glue, same path +step 2-fixed-cacheA "$R/pkg/kernels" "$R/cacheA" +find "$R/cacheA" -type f | sed "s|$R/||" | sort >"$R/cacheA-after-2.txt" +step 3-fixed-cacheB-fresh "$R/pkg/kernels" "$R/cacheB" +cp max-cpu/kernels/__init__.mojo "$R/other/kernels/" # the fixed glue, another path +step 4-fixed-otherpath-cacheA "$R/other/kernels" "$R/cacheA" +sha256sum "$R/pkg/kernels/__init__.mojo" "$BUILD/extcall/kernels/__init__.mojo" +diff "$R/cacheA-after-1.txt" "$R/cacheA-after-2.txt" >/dev/null && echo "cacheA: no new files in step 2" diff --git a/max-cpu/omatmul.om b/max-cpu/omatmul.om new file mode 100644 index 0000000..3d0eaa1 --- /dev/null +++ b/max-cpu/omatmul.om @@ -0,0 +1,51 @@ +note omatmul.om: the Omega kernel behind the MAX CPU custom op "omega_matmul" (max-cpu/README.md). +note C[M,N] = A[M,K] @ B[K,N], row-major. A and B arrive as bfloat16 bit patterns in ONE view ab +note (A's M*K elements, then B's K*N): bf16 to f32 is exact (the 16 bits become the high half), each +note product of two bf16 values is exact in f32, and the K-term sum accumulates in f32 in order +note p = 0..K-1, one rounding per add (RNE, no fused multiply-add). C is written as f32 bit patterns. +note s holds the shape [M, K, N]. A, B and C cannot be three separate views because OM-2 function +note mode has six parameter slots and an unsized view takes two (spec/omegese-om2.md section 4). +note Result codes (status 0): 0 done; 1 a dimension is 0 or above 4096; 2 len ab is not M*K + K*N; +note 3 len c is not M*N. C is untouched unless the result is 0. Every index is also checked (trap 3). +om2 +fn bdot ab view ushort * ai ulong bj ulong k ulong n ulong to uint +acc = f32 0.0 +for p ulong k +x = bitcast f32 shl uint get ab add ai p 16 +y = bitcast f32 shl uint get ab add bj mul p n 16 +acc = add acc mul x y +end +ret bitcast uint acc +end +fn brow ab view ushort * c edit uint * s view ulong 3 i ulong to void +k = get s 1 +n = get s 2 +ka = mul get s 0 k +ai = mul i k +ci = mul i n +for j ulong n +put c add ci j bdot ab ai add ka j k n +end +end +export fn omatmul ab view ushort * c edit uint * s view ulong 3 to ulong +m = get s 0 +k = get s 1 +n = get s 2 +if or or eq m 0 eq k 0 eq n 0 +ret 1 +end +if or or gt m 4096 gt k 4096 gt n 4096 +ret 1 +end +ka = mul m k +if ne len ab add ka mul k n +ret 2 +end +if ne len c mul m n +ret 3 +end +for i ulong m +brow ab c s i +end +ret 0 +end diff --git a/max-cpu/omega_max.py b/max-cpu/omega_max.py new file mode 100644 index 0000000..a8d8f69 --- /dev/null +++ b/max-cpu/omega_max.py @@ -0,0 +1,315 @@ +"""MAX CPU harness for the Omega matmul custom op (max-cpu/omatmul.om via max-cpu/kernels). + +Subcommands (run with the MAX venv python, see max-cpu/run.sh): + check numerics: Omega op vs numpy float64 and vs ops.matmul on the same graph + neg-shape bad shapes: refused by Omega (codes 1/2/3) and at graph construction + neg-load a kernels dir that must fail to load or execute (wrong symbol, external_call) + measure one op/shape in this process: cold start, warm latencies, peak RSS + measure-all spawns one `measure` child per (op, shape, cache state) + +Every graph runs on DeviceRef.CPU() only. Exit 0 = the expected outcome was observed. +""" + +import argparse +import ctypes +import json +import os +import pathlib +import resource +import subprocess +import sys +import time + +import numpy as np + +HERE = pathlib.Path(__file__).resolve().parent + +# Error bound per K (Wolfram, evidence/MAX-CPU/README.md "Tolerances"): +# g[n_,u_]:=n u/(1-n u); u32=2^-24; u64=2^-53 +# ref: g[K-1,u32]+g[K-1,u64] max: 2 g[K-1,u32] +# Elementwise |C - R| <= tol * (|A| @ |B|), evaluated in float64. +TOL = { + 1: (0.0, 0.0), + 5: (2.384186363890841e-7, 4.768372718899898e-7), + 16: (8.940704726574863e-7, 1.788140941984304e-6), + 17: (9.536752276781760e-7, 1.907350451803638e-6), + 128: (7.569847202727132e-6, 1.513969437725460e-5), + 256: (1.519941546475356e-5, 3.039883087288574e-5), +} +SHAPES = [(1, 1, 1), (3, 5, 7), (16, 16, 8), (33, 17, 9), (64, 128, 32), (256, 256, 256)] + + +def load_omega(lib): + # RTLD_GLOBAL puts omega2_omatmul in the process scope that the glue's dlopen(NULL) searches. + ctypes.CDLL(str(lib), mode=ctypes.RTLD_GLOBAL) + + +def bf16_bits(x): + """float32 -> bf16 bit patterns, round to nearest even.""" + u = np.asarray(x, np.float32).view(np.uint32).astype(np.uint64) + return ((u + 0x7FFF + ((u >> 16) & 1)) >> 16).astype(np.uint16) + + +def bf16_round(x): + """float32 values exactly representable in bf16 (so the in-graph cast is exact).""" + return (bf16_bits(x).astype(np.uint32) << 16).view(np.float32).reshape(np.shape(x)) + + +def max_mods(): + from max.driver import CPU, Buffer + from max.dtype import DType + from max.engine import InferenceSession + from max.graph import DeviceRef, Graph, TensorType, ops + + return CPU, Buffer, DType, InferenceSession, DeviceRef, Graph, TensorType, ops + + +def build_graph(kind, M, K, N, kernels): + CPU, Buffer, DType, InferenceSession, DeviceRef, Graph, TensorType, ops = max_mods() + dev = DeviceRef.CPU() + f32a = TensorType(DType.float32, [M, K], dev) + f32b = TensorType(DType.float32, [K, N], dev) + s3 = TensorType(DType.int64, [3], dev) + abt = TensorType(DType.bfloat16, [M * K + K * N], dev) + cout = [TensorType(DType.float32, [M, N], dev)] + + def cat(a, b): + return ops.concat( + [ + ops.reshape(ops.cast(a, DType.bfloat16), [M * K]), + ops.reshape(ops.cast(b, DType.bfloat16), [K * N]), + ], + axis=0, + ) + + def omega(ab, s): + return ops.custom("omega_matmul", device=dev, values=[ab, s], out_types=cout)[0].tensor + + if kind == "both": + fwd, types = (lambda a, b, s: (omega(cat(a, b), s), ops.matmul(a, b))), [f32a, f32b, s3] + elif kind == "omega": + fwd, types = (lambda a, b, s: omega(cat(a, b), s)), [f32a, f32b, s3] + elif kind == "omega_nocat": + fwd, types = omega, [abt, s3] + elif kind == "concat": + fwd, types = cat, [f32a, f32b] + elif kind == "matmul": + fwd, types = (lambda a, b: ops.matmul(a, b)), [f32a, f32b] + else: + raise ValueError(kind) + return Graph(f"om_{kind}_{M}x{K}x{N}", forward=fwd, input_types=types, + custom_extensions=[pathlib.Path(kernels)]) + + +def session(): + CPU = max_mods()[0] + return max_mods()[3](devices=[CPU()]) + + +def inputs(kind, a, b, shape): + Buffer, DType = max_mods()[1], max_mods()[2] + s = Buffer.from_numpy(np.array(shape, np.int64)) + if kind == "omega_nocat": + ab = np.concatenate([bf16_bits(a).ravel(), bf16_bits(b).ravel()]) + return [Buffer.from_numpy(ab).view(DType.bfloat16), s] + fa, fb = Buffer.from_numpy(np.ascontiguousarray(a)), Buffer.from_numpy(np.ascontiguousarray(b)) + return [fa, fb, s] if kind in ("both", "omega") else [fa, fb] + + +def judge(c, r, a, b, tol): + """max ratio |c-r| / (tol*|A||B|); <= 1 passes. Zero tolerance means exact equality.""" + bound = tol * (np.abs(a.astype(np.float64)) @ np.abs(b.astype(np.float64))) + err = np.abs(c.astype(np.float64) - r.astype(np.float64)) + if tol == 0.0: + return (0.0 if np.array_equal(err, np.zeros_like(err)) else float("inf")), float(err.max()) + with np.errstate(divide="ignore", invalid="ignore"): + ratio = np.where(bound > 0, err / bound, np.where(err > 0, np.inf, 0.0)) + return float(ratio.max()), float(err.max()) + + +def cases(M, K, N, rng): + out = [("random", bf16_round(rng.standard_normal((M, K)).astype(np.float32)), + bf16_round(rng.standard_normal((K, N)).astype(np.float32)))] + out.append(("zeros", np.zeros((M, K), np.float32), np.zeros((K, N), np.float32))) + if K == N: + out.append(("identity", out[0][1], np.eye(K, dtype=np.float32))) + if (M, K, N) == (16, 16, 8): + big = np.float32(2.0**60) + out.append(("large", out[0][1] * big, out[0][2] * big)) + return out + + +def cmd_check(args): + load_omega(args.lib) + sess, rng, rows, ok = session(), np.random.default_rng(args.seed), [], True + for M, K, N in SHAPES: + t = time.monotonic() + model = sess.load(build_graph("both", M, K, N, args.kernels)) + load_s = time.monotonic() - t + tref, tmax = TOL[K] + for name, a, b in cases(M, K, N, rng): + o = model.execute(*inputs("both", a, b, [M, K, N])) + c, r = o[0].to_numpy(), o[1].to_numpy() + ref = a.astype(np.float64) @ b.astype(np.float64) + rr, er = judge(c, ref, a, b, tref) + rm, em = judge(c, r, a, b, tmax) + exact = name in ("zeros", "identity") + passed = rr <= 1.0 and rm <= 1.0 and (not exact or np.array_equal(c, ref.astype(np.float32))) + ok &= bool(passed) and bool(np.isfinite(c).all()) + row = dict(shape=[M, K, N], case=name, load_s=load_s, tol_ref=tref, tol_max=tmax, + ratio_ref=rr, maxerr_ref=er, ratio_max=rm, maxerr_max=em, + result="PASS" if passed else "FAIL") + rows.append(row) + print(f"{M}x{K}x{N} {name:8s} ratio_ref={rr:.3g} maxerr_ref={er:.3g} " + f"ratio_max={rm:.3g} maxerr_max={em:.3g} {row['result']}", flush=True) + pathlib.Path(args.out).write_text(json.dumps(dict(lib=str(args.lib), rows=rows), indent=1)) + print("OMEGA_MAX_CHECK:", "PASS" if ok else "FAIL") + return 0 if ok else 1 + + +def cmd_neg_shape(args): + load_omega(args.lib) + CPU, Buffer, DType, InferenceSession, DeviceRef, Graph, TensorType, ops = max_mods() + M, K, N = 16, 16, 8 + model = session().load(build_graph("omega", M, K, N, args.kernels)) + rng = np.random.default_rng(args.seed) + a = bf16_round(rng.standard_normal((M, K)).astype(np.float32)) + b = bf16_round(rng.standard_normal((K, N)).astype(np.float32)) + rows, ok = [], True + # ab holds 16*16+16*8 = 384 elements, c holds 128; only the declared shape changes. + refused = "omega_matmul refused: status 0 result " + for shape, want in (([16, 15, 8], refused + "2"), ([5000, 16, 8], refused + "1"), + ([0, 16, 8], refused + "1"), ([12, 16, 12], refused + "3")): + try: + model.execute(*inputs("omega", a, b, shape)) + got = "returned" + except Exception as e: # MAX surfaces the glue's raise as an execution error + got = str(e) or repr(e) + hit = want in got + ok &= hit + rows.append(dict(shape=shape, want=want, got=got, result="PASS" if hit else "FAIL")) + print(f"shape={shape} want '{want}' got: {got} -> {'PASS' if hit else 'FAIL'}", flush=True) + # The refused calls must leave the model usable and correct. + c = model.execute(*inputs("omega", a, b, [M, K, N]))[0].to_numpy() + ratio, _ = judge(c, a.astype(np.float64) @ b.astype(np.float64), a, b, TOL[K][0]) + ok &= ratio <= 1.0 + rows.append(dict(after_refusals="valid call", ratio_ref=ratio, result="PASS" if ratio <= 1 else "FAIL")) + print(f"valid call after refusals ratio_ref={ratio:.3g} {'PASS' if ratio <= 1 else 'FAIL'}") + try: + dev = DeviceRef.CPU() + Graph("om_bad_matmul", forward=lambda x, y: ops.matmul(x, y), + input_types=[TensorType(DType.float32, [16, 16], dev), TensorType(DType.float32, [15, 8], dev)]) + got, hit = "constructed", False + except Exception as e: + got, hit = str(e).strip().splitlines()[0], True + ok &= hit + rows.append(dict(graph="ops.matmul [16,16]x[15,8]", got=got, result="PASS" if hit else "FAIL")) + print(f"graph construction ops.matmul [16,16]x[15,8]: {got} -> {'PASS' if hit else 'FAIL'}") + pathlib.Path(args.out).write_text(json.dumps(rows, indent=1)) + print("OMEGA_MAX_NEG_SHAPE:", "PASS" if ok else "FAIL") + return 0 if ok else 1 + + +def cmd_neg_load(args): + """Expect the kernels dir to fail (load or execute) with `args.want` in the error.""" + load_omega(args.lib) + M, K, N = 16, 16, 8 + a, b = np.ones((M, K), np.float32), np.ones((K, N), np.float32) + try: + model = session().load(build_graph("omega", M, K, N, args.kernels)) + model.execute(*inputs("omega", a, b, [M, K, N])) + got = "ran" + except Exception as e: + got = str(e) + hit = args.want in got + print(f"kernels={args.kernels}\nwant '{args.want}'\ngot: {got}") + print("OMEGA_MAX_NEG_LOAD:", "PASS" if hit else "FAIL") + return 0 if hit else 1 + + +def cmd_measure(args): + load_omega(args.lib) + M, K, N = args.shape + rng = np.random.default_rng(args.seed) + a = bf16_round(rng.standard_normal((M, K)).astype(np.float32)) + b = bf16_round(rng.standard_normal((K, N)).astype(np.float32)) + model = session().load(build_graph(args.op, M, K, N, args.kernels)) + ins = inputs(args.op, a, b, [M, K, N]) + u16 = max_mods()[2].uint16 + # numpy has no bf16: the concat-only graph's output is read back through a uint16 view. + done = (lambda o: o[0].view(u16).to_numpy()) if args.op == "concat" else (lambda o: o[0].to_numpy()) + done(model.execute(*ins)) + first = time.monotonic_ns() + for _ in range(args.warmup): + done(model.execute(*ins)) + lat = [] + for _ in range(args.iters): + t = time.perf_counter_ns() + done(model.execute(*ins)) + lat.append(time.perf_counter_ns() - t) + rec = dict(op=args.op, shape=[M, K, N], cache=args.cache, cold_ns=first - args.t0, + iters=args.iters, warmup=args.warmup, lat_ns=lat, + p50_ns_numpy=float(np.percentile(lat, 50)), p99_ns_numpy=float(np.percentile(lat, 99)), + maxrss_kib=resource.getrusage(resource.RUSAGE_SELF).ru_maxrss, + affinity=sorted(os.sched_getaffinity(0))) + pathlib.Path(args.out).write_text(json.dumps(rec)) + print(f"{args.op} {M}x{K}x{N} cache={args.cache} cold_ms={rec['cold_ns']/1e6:.1f} " + f"p50_us={rec['p50_ns_numpy']/1e3:.2f} p99_us={rec['p99_ns_numpy']/1e3:.2f} " + f"maxrss_kib={rec['maxrss_kib']}", flush=True) + return 0 + + +def cmd_measure_all(args): + out = pathlib.Path(args.out) + out.mkdir(parents=True, exist_ok=True) + rows = [] + for M, K, N in ((16, 16, 8), (256, 256, 256)): + for op in ("omega", "omega_nocat", "concat", "matmul"): + cache = out / f"cache-{op}-{M}x{K}x{N}" + for state in ("fresh", "warm"): + if state == "fresh": + subprocess.run(["rm", "-rf", str(cache)], check=True) + f = out / f"{op}-{M}x{K}x{N}-{state}.json" + env = dict(os.environ, MODULAR_CACHE_DIR=str(cache)) + cmd = [sys.executable, __file__, "measure", "--lib", str(args.lib), "--kernels", + str(args.kernels), "--op", op, "--shape", str(M), str(K), str(N), + "--iters", str(args.iters), "--cache", state, "--out", str(f), + "--t0", str(time.monotonic_ns())] + subprocess.run(cmd, check=True, env=env) + r = json.loads(f.read_text()) + rows.append([op, f"{M}x{K}x{N}", state, r["cold_ns"], r["iters"], + r["p50_ns_numpy"], r["p99_ns_numpy"], r["maxrss_kib"]]) + head = ["op", "shape", "cache", "cold_ns", "iters", "p50_ns", "p99_ns", "maxrss_kib"] + (out / "summary.tsv").write_text("\n".join("\t".join(map(str, x)) for x in [head] + rows) + "\n") + print((out / "summary.tsv").read_text()) + return 0 + + +def main(): + p = argparse.ArgumentParser() + sub = p.add_subparsers(dest="cmd", required=True) + for name in ("check", "neg-shape", "neg-load", "measure", "measure-all"): + s = sub.add_parser(name) + s.add_argument("--lib", required=True) + s.add_argument("--kernels", default=str(HERE / "kernels")) + s.add_argument("--seed", type=int, default=20261030) + s.add_argument("--out", required=name != "neg-load") + if name == "neg-load": + s.add_argument("--want", required=True) + if name in ("measure", "measure-all"): + s.add_argument("--iters", type=int, default=300) + if name == "measure": + s.add_argument("--op", required=True, + choices=["omega", "omega_nocat", "concat", "matmul"]) + s.add_argument("--shape", type=int, nargs=3, required=True) + s.add_argument("--warmup", type=int, default=20) + s.add_argument("--cache", default="fresh") + s.add_argument("--t0", type=int, required=True) + a = p.parse_args() + fn = {"check": cmd_check, "neg-shape": cmd_neg_shape, "neg-load": cmd_neg_load, + "measure": cmd_measure, "measure-all": cmd_measure_all}[a.cmd] + sys.exit(fn(a)) + + +if __name__ == "__main__": + main() diff --git a/max-cpu/run.sh b/max-cpu/run.sh new file mode 100755 index 0000000..31b2ae9 --- /dev/null +++ b/max-cpu/run.sh @@ -0,0 +1,83 @@ +#!/bin/sh +# Reproduce the MAX CPU route for the Omega matmul custom op (evidence/MAX-CPU/README.md). +# Run from anywhere, pinned: TMPDIR=/dev/shm taskset -c 10-14 nice -n 19 ionice -c3 max-cpu/run.sh +# CPU only: every graph is built on DeviceRef.CPU(); nothing here opens the GPU. +set -eu +cd "$(dirname "$0")/.." +MAXPY=${MAXPY:-$HOME/workspace/maxinterop/venv/bin/python} +OMEGA_REPO=${OMEGA_REPO:-$HOME/workspace/omega} +BUILD=${BUILD:-/dev/shm/omega-max-cpu} +EV=${EV:-$PWD/evidence/MAX-CPU/raw} +ITERS=${ITERS:-300} +OMC1_REV=55f9b0af OMC1_SHA=734f0a39319fbfa930bcc62cb30dbf06d47d78e126372b74f5baf478e6126b61 +OMC2_REV=ec07d25d OMC2_SHA=499236398aabc652e2dae27fe4bdc4c5db3d3726314356e0dbef23e3345803ec +GLUE_CALL='process.get_function[UInt32]("omega2_omatmul")(' +# Mutant: A's row stride N instead of K (one token). A transposed C write (C[j*M+i]) does not +# compile: brow is already at the 16-live-value limit (omc error 12). +MUT_FROM='ai = mul i k' +MUT_TO='ai = mul i n' + +rm -rf "$BUILD" +mkdir -p "$BUILD/omc" "$EV" +for v in 1 2; do + eval rev=\$OMC${v}_REV sha=\$OMC${v}_SHA + git -C "$OMEGA_REPO" show "$rev:seed/out/omc" >"$BUILD/omc/omc$v" + chmod +x "$BUILD/omc/omc$v" + echo "$sha $BUILD/omc/omc$v" | sha256sum -c - +done +export OMEGA_NATIVE_OMC="$BUILD/omc/omc1" OMEGA_NATIVE_OMC2="$BUILD/omc/omc2" + +once() { # once FILE FROM: FROM must occur exactly once + n=$(grep -cF -- "$2" "$1" || true) + [ "$n" = 1 ] || { echo "run.sh: '$2' occurs $n times in $1" >&2; exit 2; } +} +swap() { # swap SRC DST FROM TO + once "$1" "$3" + FROM=$3 TO=$4 "$MAXPY" -c 'import os,sys; s=open(sys.argv[1]).read(); open(sys.argv[2],"w").write(s.replace(os.environ["FROM"],os.environ["TO"]))' "$1" "$2" + once "$2" "$4" +} + +# Omega library, and the transposed-write mutant (negative control c). +tools/native "$BUILD/lib" max-cpu/omatmul.om >"$EV/build-lib.log" 2>&1 +mkdir -p "$BUILD/mut" +swap max-cpu/omatmul.om "$BUILD/mut/omatmul.om" "$MUT_FROM" "$MUT_TO" +tools/native "$BUILD/lib-mutant" "$BUILD/mut/omatmul.om" >"$EV/build-mutant.log" 2>&1 +grep -h 'omega-ident' "$BUILD/lib/omega_native.h" "$BUILD/lib-mutant/omega_native.h" >"$EV/idents.txt" || true + +# Glue variants (negative control a): a missing symbol, and the plain external_call route. +mkdir -p "$BUILD/wrongsym/kernels" "$BUILD/extcall/kernels" +swap max-cpu/kernels/__init__.mojo "$BUILD/wrongsym/kernels/__init__.mojo" "$GLUE_CALL" \ + 'process.get_function[UInt32]("omega2_omatmul_missing")(' +swap max-cpu/kernels/__init__.mojo "$BUILD/extcall/kernels/__init__.mojo" "$GLUE_CALL" \ + 'external_call["omega2_omatmul", UInt32](' + +# Each run gets an empty MAX cache: MAX 26.7.0 reuses compiled kernels across glue edits. +run() { # run NAME ARGS... + name=$1; shift + rm -rf "$BUILD/cache-$name" + MODULAR_CACHE_DIR="$BUILD/cache-$name" "$MAXPY" max-cpu/omega_max.py "$@" >"$EV/$name.log" 2>&1 +} +fail=0 +L="--lib $BUILD/lib/libomega_native.so" +run check check $L --out "$EV/check.json" || fail=1 +run neg-shape neg-shape $L --out "$EV/neg-shape.json" || fail=1 +run neg-wrongsym neg-load $L --kernels "$BUILD/wrongsym/kernels" \ + --want 'symbol not found: omega2_omatmul_missing' || fail=1 +run neg-extcall neg-load $L --kernels "$BUILD/extcall/kernels" \ + --want 'Failed to materialize symbols' || fail=1 +grep -qF 'Symbols not found: [ omega2_omatmul ]' "$EV/neg-extcall.log" || fail=1 +if run neg-mutant check --lib "$BUILD/lib-mutant/libomega_native.so" --out "$EV/neg-mutant.json"; then + echo "neg-mutant: the A-stride mutant passed the numeric check" >&2; fail=1 +else + grep -q 'OMEGA_MAX_CHECK: FAIL' "$EV/neg-mutant.log" || fail=1 +fi +for f in check neg-shape neg-wrongsym neg-extcall neg-mutant; do + printf '%-13s %s\n' "$f" "$(grep -h 'OMEGA_MAX_' "$EV/$f.log" | tail -1)" +done +if [ "${MEASURE:-1}" = 1 ]; then + "$MAXPY" max-cpu/omega_max.py measure-all $L --iters "$ITERS" --out "$EV/measure" \ + >"$EV/measure.log" 2>&1 || fail=1 + rm -rf "$EV"/measure/cache-* +fi +[ $fail -eq 0 ] && echo "OMEGA MAX CPU: PASS (controls green, negatives red as expected)" +exit $fail ```