openaccel-lab
aien-dev/openaccel-lab
Brought by drakestapleton
openaccel-lab / docs / CONTAINER.md
| 1 | # Case container (`OALCASE1`) |
| 2 | |
| 3 | One case is one byte stream. `bin/oal-gen` writes it to stdout; every entrant program reads it on |
| 4 | stdin and writes its outputs to stdout. Because every entrant is a separate process that only sees |
| 5 | these bytes, a crash in one entrant cannot corrupt another, and identical input is provable: the |
| 6 | container's sha256 is recorded in every result line and the gate requires it to agree across runners. |
| 7 | |
| 8 | All integers are little-endian. |
| 9 | |
| 10 | | offset | size | field | |
| 11 | |---|---|---| |
| 12 | | 0 | 8 | magic `OALCASE1` | |
| 13 | | 8 | 8 | u64 `nparam`: declared parameters, then derived parameters, in manifest order | |
| 14 | | 16 | 8 | u64 `nin`: input tensors | |
| 15 | | 24 | 8 | u64 `nout`: output tensors | |
| 16 | | 32 | 8 | u64 `warmup`: untimed launches before timing | |
| 17 | | 40 | 8 | u64 `repeats`: timed launches | |
| 18 | | 48 | 8*nparam | i64 parameter values | |
| 19 | | ... | 8*(nin+nout) | u64 byte sizes of each input, then each output | |
| 20 | | ... | ... | input tensors in manifest order, each padded with zero bytes to a multiple of 8 | |
| 21 | |
| 22 | Outputs: the entrant writes each output tensor in manifest order, each padded to a multiple of 8, |
| 23 | and nothing else on stdout. Output buffers start filled with `0xFF` bytes in every runner, so an |
| 24 | element the kernel never writes is a NaN (floats) or -1 (integers) and fails the check instead of |
| 25 | passing by luck on zeroed memory. |
| 26 | |
| 27 | Timing: for each timed launch the entrant writes `oal-time-ns N` on stderr, where `N` is the |
| 28 | wall-clock nanoseconds of that launch including the wait for completion and excluding host-device |
| 29 | copies. It may write `oal-version TEXT` lines naming its runtime. Anything else on stderr is a |
| 30 | diagnostic and is kept in the result's `log` field only on failure. |
| 31 | |
| 32 | Exit codes of entrant programs: 0 success, 2 malformed case, 3 runtime error (device, launch or |
| 33 | API failure), 100+N an Omega `trap N` (9 bad header, 10 output size mismatch, 11 trailing bytes). |