FAILURE MAP
← Case archive

FA-99256 / Distributed training aggregation / Open access

Per-worker loss means receive equal weight despite different token counts · case 01

Per-worker loss means receive equal weight despite different token counts.

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

ROOT CAUSE

Averaging local token means gives each worker equal influence even when their valid-token counts differ.

THE FAILURE

Averaging local token means gives each worker equal influence even when their valid-token counts differ.

Unsuccessful approach: Weighting each local mean by its token count but dividing by worker count still does not normalize by global token count.

Case contract

Rows are [loss_sum, valid_count]; return global token mean or None when total count is zero.

Why this case matters

A toy distributed-training contract makes replica and shard contribution rules explicit without claiming framework compatibility or performance.

1 / The failure

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

N = 1
observations = []
def solve(rows):
    return sum(x/c for x,c in rows if c)/len(rows) if rows else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unequal tokens',solve([[N,1],[9*N,3]]),2.5*N)
check('equal token split',solve([[2*N,2],[4*N,2]]),1.5*N)
check('empty',solve([]),None)
check('zero counts',solve([[N,0]]),None)
check('zero worker ignored',solve([[N,0],[6*N,2]]),3*N)
check('single batch',solve([[5*N,5]]),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 fixtureActualExpectedOutcome
unequal tokens2.02.5Failed
equal token split1.51.5Passed
emptyNoneNonePassed
zero counts0.0NoneFailed
zero worker ignored1.53Failed
single batch1.01Passed

SHA-256 / 75cf1207c52c6bc25516266fe744345eea2f0195c829f4499f61a4d2a0980f8a

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(rows):
    return sum((x/c)*c for x,c in rows if c)/len(rows) if rows else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unequal tokens',solve([[N,1],[9*N,3]]),2.5*N)
check('equal token split',solve([[2*N,2],[4*N,2]]),1.5*N)
check('empty',solve([]),None)
check('zero counts',solve([[N,0]]),None)
check('zero worker ignored',solve([[N,0],[6*N,2]]),3*N)
check('single batch',solve([[5*N,5]]),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 fixtureActualExpectedOutcome
unequal tokens5.02.5Failed
equal token split3.01.5Failed
emptyNoneNonePassed
zero counts0.0NoneFailed
zero worker ignored3.03Passed
single batch5.01Failed

SHA-256 / 499970e209a0ac0353cc906b45a42e27e01dbc6f17ea2209fd54cddf7b5a0c4d

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

Inputs are already materialized Python values from a fixed toy collective; no transport, failure recovery, optimizer state, or real model behavior is represented. 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:22.178268+00:00.

Case digest / 579c8ef17540958bcd9f38e0bc09331c1de28ed0ddd996c4bf9746305f4bf662