Skip to content
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ output.
library layers, uses the reference model's `state_dict` names, takes NumPy arrays or
`ServerArray`s as weights, and is not loaded by `import tensor_ee`. A random-weight model's
numerical reference uses integer-generated weights with calibrated BatchNorm (CONTRIBUTING,
"Model references follow the same rule"). `compile_model` stays the
"Add a block", the paragraph "Model references follow the same rule"). `compile_model` stays the
CNN path (`torch.fx` onto the R blocks): attention models go through the converter, which is
extended with recognizers, never by routing them through `compile_model`.
- **A new recognizer** follows CONTRIBUTING's "Add a recognizer":
Expand Down
7 changes: 5 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ model. [`tests/test_graph_identity.py`](tests/test_graph_identity.py) refuses to
generators while the G1 fixtures build.

**Model references follow the same rule.** A random-weight model's numerical reference,
the PyTorch model its mirror is compared with, takes its weights from integer arithmetic
(`_fixed_weights`), never from a library's native random initialization. Native
the PyTorch model its mirror is compared with, takes its weights from integer arithmetic,
never from a library's native random initialization: a counter-based integer hash of each
parameter's name and position, identical on every platform, scaled per tensor to the
standard deviation the library's own initializer gives it, so the reference behaves like a
natively initialized model. Native
initialization is not bit-identical across platforms, and it can let activations grow
far beyond a trained model's. Its BatchNorm running statistics are then calibrated from
a fixed set of integer-generated inputs, separate from the evaluation input: a fixed
Expand Down
11 changes: 7 additions & 4 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,13 @@ The caller prepares the crop and handles georeferenced relabeling.
The [evidence summary](converter.md#smp-dpt-vit-b16-evidence-and-scope) keeps graph
identity, offline mirror agreement, live agreement and model accuracy separate.
Random-weight full-width and reduced conversions are byte-identical to their
hand-composed targets. Full width is offline only: the DPT offline NumPy mirror
misses the 1e-4 absolute target against both float32 and float64 PyTorch, with
0 argmax flips. Float32 PyTorch itself differs from float64 PyTorch by more
([numbers and dtype record](vit-b16-dpt224.md#numerical-scope)). Live agreement
hand-composed targets. Full width is offline only: with counter-based integer-hash
weights at native initializer scales and fixed BatchNorm calibration, head/logits
meet 1e-4 against float32 PyTorch (full-width errors 2.06e-5/2.01e-5, reduced
7.60e-6/7.29e-6; zero argmax flips). Every intermediate's error against float64
PyTorch is no larger than float32 PyTorch's own; intermediate agreement within
1e-4 against float32 is not claimed
([scales, results and historical records](vit-b16-dpt224.md#numerical-scope)). Live agreement
covers only the reduced encoder twin with rank-at-most-4 projection weights,
the structured reduced DPT twin (`vit_dpt_reduced`, 7 requests, sampled head/logit
readouts), and individual blocks' recorded settings. The full-width live run
Expand Down
26 changes: 16 additions & 10 deletions docs/converter.md
Original file line number Diff line number Diff line change
Expand Up @@ -613,20 +613,26 @@ one class token and cat readout, as in the example above. Four claims stay separ
and [SMP DPT converter gate](../tests/test_smp_dpt_converter.py) convert random-weight
models to graphs byte-identical to the hand-composed targets, at full width and
reduced width. Both builds bind the same symbolic table reads; reduced inline
gates also compare random-weight literals. These gates establish graph identity,
gates also compare native SMP/timm random-weight literals, independently of
the calibrated integer numerical references. These gates establish graph identity,
not numerical execution.
- **Offline mirror agreement.** The [encoder evidence](vit-b16-encoder224.md)
and [DPT numerical evidence](vit-b16-dpt224.md#numerical-scope) compare NumPy
mirrors with PyTorch. The [reduced DPT fixture record](evidence/dpt-reduced-offline.json)
has largest absolute error 1.86e-9. Full width is **offline only** and does
**not meet the unchanged 1e-4 absolute target**: against float32 PyTorch,
fusion3 differs by 6.03e-4 and logits by 3.51e-4; against float64 PyTorch,
fusion3 differs by 1.18e-4 and logits by 1.50e-4. Activations reach about
190, where one float32 step is about 1.5e-5. Float32 PyTorch itself differs
from float64 PyTorch by more (fusion3 6.13e-4, logits 3.70e-4); there are
**0 argmax flips**. The [dtype record](evidence/dpt-dtype-offline.json)
retains these failures; neither rounding scale nor unchanged decisions relaxes
the absolute target.
has largest absolute error 1.86e-9, using its unchanged compact fixture weights.
The final [hash-reference record](evidence/dpt-hash-offline.json) uses a
counter-based integer hash at each native initializer's standard deviation,
followed by fixed four-batch BatchNorm calibration. Head/logits meet 1e-4
against float32 PyTorch: full-width errors 2.06e-5/2.01e-5, reduced errors
7.60e-6/7.29e-6. Every intermediate's mirror/float64 error is no larger
than float32 PyTorch's own. Full-width fusion3 peaks at 51.93 (float32
step 3.81e-6): mirror/float32 error 1.88e-4, mirror/float64 4.64e-5,
float32/float64 1.87e-4. This is an intermediate ordering claim, not
1e-4 intermediate agreement against float32. Every recorded output has zero
argmax flips. The [native-init](evidence/dpt-dtype-offline.json),
[unscaled periodic](evidence/dpt-integer-offline.json), and
[fan-in periodic](evidence/dpt-fan-in-offline.json) records remain unchanged
as superseded history. Full-width agreement remains offline only.
- **Live agreement.** It exists only for the
[reduced ViT encoder twin](evidence/live-fixtures/20261103T022505Z-vit_encoder_reduced.json)
with **rank-at-most-4 projection weights**, the
Expand Down
Loading
Loading