1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use super::backend::BackendUnavailable;
use super::coverage::{Coverage, Dispatch, Fidelity};
use super::formula::{Formula, Precision};
use super::manifest::Manifest;
/// The crate's own fused kernels for composed formulas, elected
/// onto plans at compile time and executing in-process through the
/// payload seam.
///
/// The actions live with their consumer (the kernel table beside
/// the plan, per the symmetry decision); this manifest holds only
/// the declared coverage the election reads.
pub(super) struct Fused;
impl Manifest for Fused {
const DISPATCH: Dispatch = Dispatch::Elected;
fn coverage(formula: Formula) -> Coverage {
match formula {
// `windowed_product` computes through the gemm seam in
// the recorded accumulation order: bit-identical under
// both postures, proven by the plan snapshots — the one
// cell at the bit-identity fidelity, since the oracle's bits
// live in this process.
Formula::WindowProduct => Coverage::Serves {
fidelity: Fidelity::BitIdentical,
precisions: Precision::ALL,
},
// `batch_normalized` offers the whole group down the
// chain and falls back to composing the recorded formula
// through the same payload operations the rules make —
// bitwise — so, like the window kernel, the cell clears
// bit identity: the chain's own admission keeps `Exact`
// runs on the reference, and the envelope enters only
// through an admitted hardware kernel under `Fast`.
Formula::BatchNormTraining => Coverage::Serves {
fidelity: Fidelity::BitIdentical,
precisions: Precision::ALL,
},
// `max_pooled` folds each window with `maximum` in the
// recorded lane order — a direct walk that materializes
// no lane views — so its bits match the composed fold in
// every build, under either posture.
Formula::ReduceWindow => Coverage::Serves {
fidelity: Fidelity::BitIdentical,
precisions: Precision::ALL,
},
// The inference-mode normalization stays raise-only
// until a consumer earns it.
Formula::Gemm | Formula::Map | Formula::BatchNormInference => Coverage::Absent,
}
}
fn compiled() -> bool {
true
}
fn status() -> Result<(), BackendUnavailable> {
// In-process code compiled into every build: nothing to
// initialize, nothing to lose.
Ok(())
}
}