interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / docs / abft / CONTRACT.md

268 lines · 14607 bytes Raw Blame History Source

GEMM fault detection and schedule perturbation: evaluator contract

Linear DRA-420 (the numerical/GEMM slice only) and DRA-387 (the evaluator and concurrency slice). CUDApp#55 (schedule perturbation) and CUDApp#56 (reduced-concurrency witness) are covered on the host only. Weight integrity at load time belongs to the ownmodel loader and is not in this slice.

Status labels: everything here is SIMULATED/HOST_TESTED. The candidate is a first-party .om tiled GEMM run by simulated workers on the host CPU. No GB10 (sm_121) kernel, device output buffer or device scheduler has been exercised. Every device edge in section 10 is NOT_RUN.

1. Files and build

PathRole
tests/abft/frozen.omFrozen plan: 51 rows plus config. Its hash is in tests/abft/FROZEN.sha256, committed in 9a16df99 before any checker existed.
native/abft/lib.omBuffered output, splitmix64 streams, FNV-1a, bf16 and f32 decoding.
native/abft/check.omIndependent checkers: full recompute, two-sided checksum, sampled recompute, input digest, structural check.
native/abft/cand.omCandidate tiled GEMM (W workers, two barriers per K tile) and the labelled fault injectors.
native/abft/sched.omCUDApp#55 admission. A refused row never forks.
native/abft/run.omEvaluator: fork, deadline, reap, collect, detect, admit, retry, tallies, witnesses, gates.
native/abft/cul1.omkabft: the same two-sided checksum on the merged learn53 CUL1 GEMM records.
tests/abft/cul1-unit.omCUL1 checksum unit cases. Uses tests/learn53/fixtures.om.
tests/abft/driver.omSeeded Omega driver: pin check, frozen-hash check, build, unit run and full evaluator run.
mkdir -p build && "$OMEGA_OMC" < tests/abft/driver.om > build/abft-driver && chmod +x build/abft-driver
OMEGA_OMC=/abs/omega-mv/seed/out/omc build/abft-driver build/abft   # all 51 rows plus gates
build/abft/abft FIRST LAST                                          # a row range; gates are skipped

Run the driver from the repository root. It exits 0 when every step and gate passed, 2 when OMEGA_OMC is unset, 1 on a pin, frozen-hash, input or output failure, and otherwise with the failing step's status (omc, cul1-unit, then the evaluator).

The compiler must be omega-mv e5b32567a7aff3ce594e3254a622a846a6cd190b seed/out/omc, sha256 2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f; the driver refuses any other. build/abft/abft exits with the number of failed gates (0 when all pass), or 64 for bad arguments.

2. Roles and isolation

3. Fault model, precision and tolerance

Fault model. Errors that reach the output buffer:

Not modelled: faults inside the checker itself, faults in the evaluator's generation code, and faults that alter both the candidate and the checker's view of the output identically.

Precision.

Bounds with $u = 2^{-24}$, $u' = 2^{-53}$ and $\gamma_n(u) = nu/(1-nu)$:

Wolfram checks (WolframLanguageEvaluator; definitions $u = 2^{-24}$, $u' = 2^{-53}$, $g[n] = nu/(1-nu)$, $g'[n] = nu'/(1-nu')$, $sl = 1 + 2^{-20}$):

Every comparison is written not le d t, so a NaN is detected. The structural check also counts outputs whose f32 exponent is all ones.

Rounding and quantisation declaration. These bounds are for profile P1 only. A device kernel that uses FMA, a different accumulation order, split-K, tensor-core fragment accumulation, MUFU, or denormal flushing (GB10 flushes denormals) needs its own profile and bound before these checks apply. One example is gemm-any #283's bound $n/(2^{18}-n)\cdot\sum|ab|$ with $n = \lceil K/16\rceil$, recorded as profile P2, NOT_RUN. Inputs avoid denormals by construction (exponent ≥ 120).

4. Exact mode (dt 0): checksum miss bound

The two-sided Freivalds check works mod $2^{32}$ with odd multipliers. Let $v$ be the 2-adic valuation of the error pattern's combination. The miss probability is at most $2^{v-31}$ per side.

Wolfram enumeration over the scaled model mod $2^6$:

At 32 bits, an error of $2^{31}$ on the four corners of a 2×2 rectangle is a deterministic miss (row 40, gate 7). Full recompute catches it. On the merged learn53 CUL1 record, kabft misses the same rectangle while keval (exact) catches it (tests/abft/cul1-unit.om, abrect). Wolfram: {2^31+21, 2^31+24, 2^31+47, 2^31+54} → {2147483669, 2147483672, 2147483695, 2147483702}, and {{1,2},{3,4}}.{{5,6,7},{8,9,10}} → {{21,24,27},{47,54,61}}.

5. Modes, admission and cost

ModeWorkIn admission
Structuraloutput length, exit status, nonfinite countyes
Input digestFNV-1a over dims, A and B; detects common-mode input corruptionyes
Full recompute (thorough)$2MNK$ multiply-adds in f64 or mod $2^{32}$yes
Checksum (ABFT, Huang–Abraham 1984, doi:10.1109/TC.1984.1676475; Freivalds)$O(MK + KN + MN)$ per sideyes
Sampled recompute$S = 64$ elements with replacement; about $SK$no, reported only

6. Frozen plan

The row fields, fault codes and flags are documented in the header of tests/abft/frozen.om.

RowsContent
1–5Fault-free FP rows (bf16 and exact; odd shape 33×17×41).
6–14Single bit.
15–18Multi-element.
19–22Stale.
23–27Index. 26 is the out-of-bounds store and must exit 103.
28–37Sync. 34/35 is the W8/W2 pair; 36 is the hang; 37 is a wait removal without the control flag and must be refused.
38–39Unsupported sites. Must be refused with 69.
40–42Declared misses and common-mode corruption.
43–44Transient and persistent recovery.
45–49Host cost.
50–51Witness pair with a correct barrier.

Config: S = 64, deadline 20 s, 1 retry, plan version 1.

7. CUDApp#55 schedule perturbation

Policies:

PolicyBehaviour
0Round-robin.
1Seeded random choice among ready workers. Stream 2, varied by seed, rep and attempt.
2Run-ahead: worker tgt goes first whenever it is ready.
3Delay: worker tgt is postponed while it sits at site, provided another worker is ready.

Sites: 1 load, 2 compute, 3 barrier arrival. Site 4 (intra-unit atomic) and site 5 (device instruction stream) are refused with 69, because there is no host atomic and no qualified delay opcode. Nothing is guessed (docs/learn53/DEPENDENCIES.md on the integration branch: "#55 NOT_RUN … no delay opcode guessed").

Each row is validated before the first fork:

CodeMeaningStatus
0ok0
1unknown policy65
2target out of range65
3atomic site69
4device instruction stream site69
5wait removal without the known-bad control flag65
6shape or worker bounds65
7transposed index on a non-square shape65
8delay policy without a site65
9hang control with W < 265

The SCHED record reports the number of distinct schedules, by an FNV hash of the worker-choice sequence, across reps.

8. CUDApp#56 reduced-concurrency witness

A row with flag bit 3 is the reduced-concurrency partner of the previous row: same seed and shape, fewer workers (W8 → W2). The evaluator compares the first-attempt output digests rep by rep and the admission detections:

VerdictMeaning
1Counterexample: the original detected a fault and the reduced run detected none. The fault depends on concurrency.
2The digests differ rep by rep, and there is no counterexample.
0Otherwise.

A reduced run that is clean is not proof that the original is correct. It is only a witness.

9. Output records and gates

Output is numeric, space separated, after the COLUMNS header lines printed by the driver. The records are PLAN, CASE, SCHED, TALLY, WITNESS, RESOURCES and GATE. In the CASE record, detector columns read 0 pass, 1 detect, 2 not evaluated (no usable output). Verdict codes: 0 ACCEPT, 1 RECOVERED, 2 REJECTED, 4 retry follows. Times are in ns from monons.

GateCondition
1No false positive in any detector, admission included.
2Admission FN = 0, except the declared rows 11 and 17 (low-mantissa flips below the P1 bound).
3Schedule status: row 37 → 65, rows 38/39 → 69, every other row 0.
4Row 43 all RECOVERED and row 44 all REJECTED.
5Resources: forks = reaped, fd first = fd last, no fd or wait errors.
6Row 36: timeouts = 2 × reps (both attempts killed at the deadline).
7Row 40: checksum FN = full TP = corrupt cases (deterministic rectangle miss).
8Row 42 (common mode): digest TP = corrupt cases, and full FN + structural TP = checksum FN + structural TP = corrupt cases.
9Row 51 witness: same = reps and verdict 0.
10Row 26: every attempt ends in Omega trap 3 (exit 103) before the store.

Gate revisions after the first sandbox run.

10. Known misses and pending device evidence

Known misses (declared before the first run).

NOT_RUN (needs producer interfaces).