{
  "_comment": [
    "Whisper whisper-large-v3-turbo per-tensor tolerances for compare_tensors.py.",
    "",
    "Regime: ASYMMETRIC. C++ side runs the shipped F16 GGUF with F16 KV",
    "cache (whisper model.cpp AUTO mirrors weight dtype: F16 weights ->",
    "F16 KV). Reference side runs transformers with model.float() -> F32",
    "weights and F32 KV. So the per-tensor diff is dominated by F16",
    "production quant noise, NOT fp32 implementation drift like the",
    "F32-shipped variants (tiny, base, small, medium, large, large-v2)",
    "carry. Cases calibrated: jfk.",
    "",
    "What that means for these gates: they catch LARGE regressions",
    "(>= a few x of F16 noise floor) and structural breakage (NaN, sign",
    "flips, shape mismatches). They do NOT reliably catch subtle",
    "implementation drift in F16 attn / matmul / LN kernels - such drift",
    "would land inside F16 noise and slip past. End-to-end transcript",
    "match is the strongest correctness signal we have for this variant",
    "today. If subtle F16-implementation-regression coverage matters, add",
    "a parallel F16-vs-F16 reference path (downcast ref to torch.half)",
    "and gate against that instead.",
    "",
    "Outlier feature dimensions: drift is NOT uniform across the encoder",
    "output. It concentrates on a small set of dims that the model uses",
    "as outlier channels - notably dim 1142 (mean(|ref|)~4.8 at",
    "enc.final, vs ~0.3 for typical dims) plus dims {182, 220, 319,",
    "635, 987, 988, 1075, 1142}. Same dim 1142 is the worst-drift dim",
    "in whisper-large-v3 - shared model behavior, not a turbo-only",
    "artifact. Worst single-element absolute drift (~1.34) sits on row",
    "1402 dim 182 with ref=2.6 (so ~50% relative on that one element);",
    "this is cumulative F16 drift across 32 encoder layers compounded by",
    "final LN dynamic range, not a sign flip / NaN / shape problem.",
    "Treat any new outlier rows / dims as a regression signal.",
    "",
    "Encoder peak signal jumps ~50x between block 16 (~6.6) and block",
    "23 (~300) - blocks 23+ tolerances widen accordingly. Not a",
    "regression, just where this model's signal magnitude lands.",
    "",
    "Recipe: 1.5x worst-of-cases observed drift, rounded up to 1 sig",
    "fig. Zero-drift tensors (raw GGUF reads, pure adds) pinned at",
    "exact 0.0. enc.mel.in tolerance reflects production C++ MelFrontend",
    "drift vs HF WhisperFeatureExtractor (fp32 mixed-radix FFT vs torch",
    "fp64 frontend) and is unaffected by the F16/F32 weight asymmetry.",
    "",
    "Generated by tmp/calibrate_whisper_tolerances.py from the dumps",
    "in build/validate/whisper/<variant>/<case>/{cpp,ref}/."
  ],
  "enc.mel.in": {"max_abs": 4e-05, "mean_abs": 7e-08},
  "enc.pos_emb": {"max_abs": 0.0, "mean_abs": 0.0},
  "enc.conv1.out": {"max_abs": 2e-03, "mean_abs": 7e-05},
  "enc.conv2.out": {"max_abs": 5e-03, "mean_abs": 8e-05},
  "enc.embed.out": {"max_abs": 5e-03, "mean_abs": 8e-05},
  "enc.block.0.out": {"max_abs": 3e-02, "mean_abs": 3e-03},
  "enc.block.8.out": {"max_abs": 6e-02, "mean_abs": 3e-03},
  "enc.block.16.out": {"max_abs": 9e-02, "mean_abs": 2e-03},
  "enc.block.23.out": {"max_abs": 3e+00, "mean_abs": 8e-04},
  "enc.block.31.out": {"max_abs": 4e+00, "mean_abs": 6e-03},
  "enc.final": {"max_abs": 3e+00, "mean_abs": 2e-02},
  "dec.token_emb": {"max_abs": 0.0, "mean_abs": 0.0},
  "dec.pos_emb": {"max_abs": 0.0, "mean_abs": 0.0},
  "dec.embed_sum": {"max_abs": 0.0, "mean_abs": 0.0},
  "dec.block.0.out": {"max_abs": 2e-02, "mean_abs": 3e-04},
  "dec.block.1.out": {"max_abs": 3e-02, "mean_abs": 4e-04},
  "dec.block.2.out": {"max_abs": 3e-02, "mean_abs": 4e-04},
  "dec.block.3.out": {"max_abs": 3e-02, "mean_abs": 2e-03},
  "dec.out_before_head": {"max_abs": 4e-01, "mean_abs": 4e-02},
  "dec.logits_raw": {"max_abs": 3e-01, "mean_abs": 5e-02},
  "dec.logits": {"max_abs": 3e-01, "mean_abs": 5e-02},
  "dec.logits_raw.gen20": {"max_abs": 6e-02, "mean_abs": 1e-02}
}
