FAILURE MAP
← Case archive

FA-98656 / Model quantization arithmetic / Open access

Quantization: Per-channel zero points broadcast by row · case 01

Per-channel zero points broadcast by row.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Rows contain values and columns are channels. Quantize each value with its column scale and zero offset (value-zero)/scale.

THE FAILURE

Rows contain values and columns are channels. Quantize each value with its column scale and zero offset (value-zero)/scale.

Unsuccessful approach: The attempted code selects zero points by row index while scales use columns; it repairs only fixtures where row and channel offsets coincide.

Case contract

Rows contain values and columns are channels. Quantize each value with its column scale and zero offset (value-zero)/scale. Inputs follow this explicit integer toy contract; ties use Python round-to-even where rounding is required.

Why this case matters

This deterministic model isolates one quantization arithmetic contract from tensor storage and runtime kernels.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(rows, scales, zeros):
    return [[round((v-zeros[0])/scales[j]) for j,v in enumerate(row)] for row in rows]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('distinct channel offsets',solve([[5,12],[7,18]],[2,3],[1,3]),[[2,3],[3,5]])
check('one row',solve([[3,9]],[1,2],[1,3]),[[2,3]])
check('empty',solve([],[],[]),[])
check('zero residual',solve([[4,6]],[2,3],[4,6]),[[0,0]])
check('negative residual',solve([[0,0]],[2,4],[2,4]),[[-1,-1]])
check('single column',solve([[7],[9]],[2],[3]),[[2],[3]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
distinct channel offsets[[2, 4], [3, 6]][[2, 3], [3, 5]]Failed
one row[[2, 4]][[2, 3]]Failed
empty[][]Passed
zero residual[[0, 1]][[0, 0]]Failed
negative residual[[-1, 0]][[-1, -1]]Failed
single column[[2], [3]][[2], [3]]Passed

SHA-256 / fe8edb0621973f8d984e8a811377633824b9a30fb21b35efa1d4998aa7e493af

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(rows, scales, zeros):
    return [[round((v-zeros[min(i,len(zeros)-1)])/scales[j]) for j,v in enumerate(row)] for i,row in enumerate(rows)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('distinct channel offsets',solve([[5,12],[7,18]],[2,3],[1,3]),[[2,3],[3,5]])
check('one row',solve([[3,9]],[1,2],[1,3]),[[2,3]])
check('empty',solve([],[],[]),[])
check('zero residual',solve([[4,6]],[2,3],[4,6]),[[0,0]])
check('negative residual',solve([[0,0]],[2,4],[2,4]),[[-1,-1]])
check('single column',solve([[7],[9]],[2],[3]),[[2],[3]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
distinct channel offsets[[2, 4], [2, 5]][[2, 3], [3, 5]]Failed
one row[[2, 4]][[2, 3]]Failed
empty[][]Passed
zero residual[[0, 1]][[0, 0]]Failed
negative residual[[-1, 0]][[-1, -1]]Failed
single column[[2], [3]][[2], [3]]Passed

SHA-256 / 16738e00296afa20a375a0807ec166fbdc669aa3fbd05b225f613e69a13d2731

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Toy scalar/list arithmetic only; it does not model a production quantizer, hardware instruction, or accuracy/performance gain. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-30T16:48:15.403520+00:00.

Case digest / 79ea53e28c4b90b34ab722457ab95f53bbf33878b136dc81ac679c8a6d2f11bf