FA-98866 / Gradient accumulation weighting / Open access
Mean-reduced microbatch losses are summed · case 01
Mean-reduced microbatch losses are summed.
ROOT CAUSE
The broken implementation averages sum-reduced contributions by number of microbatches.
THE FAILURE
The broken implementation averages sum-reduced contributions by number of microbatches.
Unsuccessful approach: Counting only positive terms wrongly removes valid zero or negative contributions.
Case contract
Each input is one sum-reduced microbatch contribution. Return the total without dividing by a count.
Why this case matters
A deterministic toy model isolates one local accumulation contract.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(loss_sums):
return sum(loss_sums) / max(1,len(loss_sums))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two sums',solve([2*N,4*N]),6*N)
check('unequal values',solve([2*N,12*N]),14*N)
check('single',solve([5*N]),5*N)
check('empty',solve([]),0)
check('zero included',solve([0,8*N]),8*N)
check('negative contribution',solve([3*N,-N]),2*N)
check('three sums',solve([N,2*N,3*N]),6*N)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| two sums | 3.0 | 6 | Failed |
| unequal values | 7.0 | 14 | Failed |
| single | 5.0 | 5 | Passed |
| empty | 0.0 | 0 | Passed |
| zero included | 4.0 | 8 | Failed |
| negative contribution | 1.0 | 2 | Failed |
| three sums | 2.0 | 6 | Failed |
SHA-256 / 4fdc05ce11e34d722e2fd833423dfb3e7ce39920068e01ac6146b14137fa0969
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(loss_sums):
return sum(loss_sums) / max(1,sum(s > 0 for s in loss_sums))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two sums',solve([2*N,4*N]),6*N)
check('unequal values',solve([2*N,12*N]),14*N)
check('single',solve([5*N]),5*N)
check('empty',solve([]),0)
check('zero included',solve([0,8*N]),8*N)
check('negative contribution',solve([3*N,-N]),2*N)
check('three sums',solve([N,2*N,3*N]),6*N)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| two sums | 3.0 | 6 | Failed |
| unequal values | 7.0 | 14 | Failed |
| single | 5.0 | 5 | Passed |
| empty | 0.0 | 0 | Passed |
| zero included | 8.0 | 8 | Passed |
| negative contribution | 2.0 | 2 | Passed |
| three sums | 2.0 | 6 | Failed |
SHA-256 / b85332e19ec6533535fa383c719f2fc480c8a725d9ca0e5498173bc93e4d137c
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 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
Inputs are scalar or short-list summaries and do not model autodiff, devices, or an optimizer. 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:17.605383+00:00.
Case digest / a5a0160dce9a9681e070ba01d15c05fffe6bce7fc242c208dc90111ab57c675d