nv-simonec commited on
Commit
32725a9
·
1 Parent(s): 1620e9f

Unify forward-pass iteration measurements (#7)

Browse files

- Unify forward-pass iteration measurements (945f92e8e21b2ab4fb57292fb0397b79787d7ce2)
- Clarify measurement grouping methods (ef5d1b56b18b410e7acf06e9028d726dd8640aa1)
- Align synchronized iteration provenance (1f40833972a1d55f541b1fdd37d9ceb4cfb6711c)
- Require listener join evidence per rank (e0bb6ccaa82b9aaf65e79d609f72fd8774120114)
- Model synchronized DP rank latency explicitly (5306df84733acb87c44ef92ae5d196221a4e2890)

README.md CHANGED
@@ -91,10 +91,24 @@ coordinates, row order, and row count. Each affected sidecar records the
91
 
92
  Usable measurement bundles declare one of two semantic protocols:
93
 
94
- - `forward-pass-measurement-v1` contains exact scheduler observations and
95
- measured wall time. Rank streams and synchronized iteration groups are two
96
- representations of this protocol, not separate protocols. See
97
- [`schemas/forward-pass-measurement-v1.schema.json`](schemas/forward-pass-measurement-v1.schema.json).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  - `forward-pass-record-v1` contains a reduced, self-contained point:
99
  scheduled batch/token coordinates plus observed latency. The current
100
  DSV4-Pro derived CSV files use this protocol because their raw streams are
@@ -163,8 +177,8 @@ references or filtering `catalog/index.parquet` by `snapshot_status`.
163
  - Consumers verify every recorded SHA-256 before loading data.
164
  - FPM Gym records the pinned dataset commit and AISim commit for each evaluation.
165
  - Missing or invalid measurement evidence remains visible as a gap; it is never scored.
166
- - Raw logs, reproduction scripts, reports, per-rank duplicates, and wholesale
167
- prediction directories are not mirrored.
168
 
169
  The repository must remain private. Retained provenance contains internal paths
170
  and network metadata, and the source has no approved redistribution license.
 
91
 
92
  Usable measurement bundles declare one of two semantic protocols:
93
 
94
+ - `forward-pass-measurement-v1`:
95
+
96
+ - Normalizes exact scheduler observations into one synchronized iteration.
97
+ - Retains one measurement for every contributing rank and caches
98
+ `max_rank_wall_time` as the default complete-iteration truth. Consumers may
99
+ derive another latency policy from the authoritative rank measurements.
100
+ - Distinguishes two source kinds:
101
+ - `self_benchmark`: a benchmark producer groups ranks by `benchmark_id`.
102
+ - `rank_event_stream`: rank-local events are either evaluated directly for
103
+ one rank or joined using a declared corrected receive-time window.
104
+ - `producer` identifies the component that creates rank-local FPM records.
105
+ Optional `collector` provenance identifies a separate capture component;
106
+ it is required when grouping by `listener_receive_time_window`.
107
+ - `grouping` records the membership method and its authority. Rank-local
108
+ counters, file position, and exact timestamp equality are never cross-rank
109
+ join keys.
110
+ - Schema:
111
+ [`forward-pass-measurement-v1.schema.json`](schemas/forward-pass-measurement-v1.schema.json).
112
  - `forward-pass-record-v1` contains a reduced, self-contained point:
113
  scheduled batch/token coordinates plus observed latency. The current
114
  DSV4-Pro derived CSV files use this protocol because their raw streams are
 
177
  - Consumers verify every recorded SHA-256 before loading data.
178
  - FPM Gym records the pinned dataset commit and AISim commit for each evaluation.
179
  - Missing or invalid measurement evidence remains visible as a gap; it is never scored.
180
+ - Raw logs, reproduction scripts, reports, redundant copies of rank streams,
181
+ and wholesale prediction directories are not mirrored.
182
 
183
  The repository must remain private. Retained provenance contains internal paths
184
  and network metadata, and the source has no approved redistribution license.
docs/measurement-protocols.md CHANGED
@@ -20,35 +20,74 @@ unknown protocol is an incompatible contract and must fail validation.
20
 
21
  ## `forward-pass-measurement-v1`
22
 
23
- This protocol retains the captured scheduler state. Its core rank record stores
24
- the worker and rank identity, counter, wall time, scheduled requests, and queued
25
- requests.
 
 
26
 
27
- It has two source representations:
 
28
 
29
- - Observation streams store one rank record per JSONL line. The dataset uses
30
- rank 0 as the representative record because rank-local counters do not prove
31
- that records from different ranks belong to the same engine iteration.
32
- - Synchronized benchmark files store `iteration_groups`. Each complete group
33
- declares the expected DP ranks and contains exactly one rank record for each
34
- rank. The iteration latency is the maximum rank wall time.
35
 
36
- These are representations of one protocol, not separate protocols. Both
37
- normalize to one forward-pass iteration containing one or more rank records.
38
- Zero-time records and empty scheduler heartbeats may remain in a source stream,
39
- but consumers exclude them from measured points.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
41
  Request metrics use the following fields. Missing metrics normalize to zero.
42
 
43
  | Field | Meaning |
44
  | --- | --- |
45
  | `num_prefill_requests` | Scheduled or queued prefill request count. |
46
- | `sum_prefill_tokens` | Total new prefill tokens. |
47
- | `sum_prefill_kv_tokens` | Total KV-cache tokens read by prefill requests. |
48
  | `num_decode_requests` | Scheduled or queued decode request count. |
49
- | `sum_decode_kv_tokens` | Total KV-cache tokens read by decode requests. |
50
- | `var_prefill_length` | Variance of prefill lengths when recorded. |
51
- | `var_decode_kv_tokens` | Variance of decode KV lengths when recorded. |
52
 
53
  Workload kind is derived from scheduled request metrics. It is not encoded in
54
  the protocol ID.
 
20
 
21
  ## `forward-pass-measurement-v1`
22
 
23
+ This protocol retains captured scheduler state and rank-local latency. Its
24
+ canonical record is `synchronizedIteration`: one evaluation target containing
25
+ every contributing `rankObservation` in `rank_measurements`. A rank observation
26
+ stores the worker and rank identity, rank-local counter and wall time, scheduled
27
+ requests, and queued requests.
28
 
29
+ The canonical record separates who emitted a measurement from how its ranks
30
+ were synchronized:
31
 
32
+ | Field | Meaning |
33
+ | --- | --- |
34
+ | `source_kind` | `self_benchmark` or `rank_event_stream`. |
35
+ | `producer` | Component that created the rank-local FPM measurements. |
36
+ | `collector` | Optional separate capture component. Required for a listener receive-time-window join. |
37
+ | `grouping` | Iteration membership method, authority, and source evidence. |
38
 
39
+ The `grouping.method` records how the ranks became one iteration:
40
+
41
+ | Method | Purpose | Required source evidence |
42
+ | --- | --- | --- |
43
+ | `single_rank` | Normalize a rank-event iteration with one attention-DP rank. | One rank observation; producer authority. |
44
+ | `benchmark_id` | Normalize ranks grouped by a self-benchmark producer. | `benchmark_id`, benchmark `point`, and producer authority. |
45
+ | `listener_receive_time_window` | Reconstruct an iteration from separately received rank events. | Engine role, raw `_recv_ts`, clock-group offsets, corrected window start and size, collector provenance, and derived authority. |
46
+
47
+ All methods produce the same canonical measurement. For a complete iteration,
48
+ `rank_measurements` contains exactly the declared `expected_dp_ranks`, sorted by
49
+ `dp_rank`, and `max_rank_wall_time` caches the maximum rank-local `wall_time` as
50
+ the default scoring latency. Consumers may derive another latency policy from
51
+ the retained, authoritative rank measurements. A consumer records the policy it
52
+ uses in its own result provenance. Incomplete groups retain their available
53
+ ranks with `max_rank_wall_time: null`.
54
+
55
+ Physical source files may remain in their producer formats:
56
+
57
+ - Rank observation streams store one `rankObservation` per JSONL line. A
58
+ standalone row is directly evaluable only when the configuration has one
59
+ attention-DP rank. Multi-rank streams require raw listener receive timestamps,
60
+ explicit clock correction, and a declared time window. File order, exact
61
+ timestamp equality, and rank-local `counter_id` are not join keys.
62
+ - Self-benchmark files store `iteration_groups`. Their
63
+ `rank_results[].fpms[0]` records normalize to canonical
64
+ `rank_measurements[]` with `source_kind: self_benchmark` and
65
+ `grouping.method: benchmark_id`; the source `wall_time` normalizes to
66
+ `max_rank_wall_time` after validation against the nested ranks.
67
+ - Canonical iteration streams store one `synchronizedIteration` per
68
+ JSONL line.
69
+
70
+ Listener `_recv_ts` values are assigned independently when each rank event is
71
+ received, so equal timestamps must not be expected. A dataset importer may use
72
+ `listener_receive_time_window` only when the source preserves `_recv_ts` and
73
+ the grouping provenance declares reproducible clock offsets and window rules.
74
+ The GLM DEP16 campaign corrects its four node clocks, then groups distinct ranks
75
+ within an 8 ms half-open window.
76
+
77
+ Zero-time observations and empty scheduler heartbeats may remain in source
78
+ evidence, but consumers exclude them from measured points.
79
 
80
  Request metrics use the following fields. Missing metrics normalize to zero.
81
 
82
  | Field | Meaning |
83
  | --- | --- |
84
  | `num_prefill_requests` | Scheduled or queued prefill request count. |
85
+ | `sum_prefill_tokens` | New prefill tokens computed in the iteration. |
86
+ | `sum_prefill_kv_tokens` | Previously computed prefix or prior-chunk tokens read from KV cache by prefill requests. |
87
  | `num_decode_requests` | Scheduled or queued decode request count. |
88
+ | `sum_decode_kv_tokens` | Total KV context length across decode requests. |
89
+ | `var_prefill_length` | Population variance of full prompt lengths across prefill requests. |
90
+ | `var_decode_kv_tokens` | Population variance of KV context lengths across decode requests. |
91
 
92
  Workload kind is derived from scheduled request metrics. It is not encoded in
93
  the protocol ID.
schemas/forward-pass-measurement-v1.schema.json CHANGED
@@ -3,26 +3,62 @@
3
  "$id": "https://huggingface.co/datasets/nvidia/aisimulate-fpm-dataset/raw/main/schemas/forward-pass-measurement-v1.schema.json",
4
  "x-protocol-id": "forward-pass-measurement-v1",
5
  "title": "Forward-pass measurement v1 record",
6
- "description": "One physical record from the full forward-pass measurement protocol. A JSONL line is a rank measurement; an iteration_groups entry is a synchronized iteration.",
7
  "oneOf": [
8
- {"$ref": "#/$defs/rankMeasurement"},
9
- {"$ref": "#/$defs/synchronizedIteration"}
 
10
  ],
11
  "$defs": {
12
  "requestMetrics": {
13
  "type": "object",
14
  "properties": {
15
- "num_prefill_requests": {"type": "integer", "minimum": 0, "default": 0},
16
- "sum_prefill_tokens": {"type": "integer", "minimum": 0, "default": 0},
17
- "var_prefill_length": {"type": "number", "minimum": 0, "default": 0},
18
- "sum_prefill_kv_tokens": {"type": "integer", "minimum": 0, "default": 0},
19
- "num_decode_requests": {"type": "integer", "minimum": 0, "default": 0},
20
- "sum_decode_kv_tokens": {"type": "integer", "minimum": 0, "default": 0},
21
- "var_decode_kv_tokens": {"type": "number", "minimum": 0, "default": 0}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  },
23
  "additionalProperties": true
24
  },
25
- "rankMeasurement": {
26
  "type": "object",
27
  "required": [
28
  "version",
@@ -37,14 +73,61 @@
37
  "version": {"const": 1},
38
  "worker_id": {"type": "string", "minLength": 1},
39
  "dp_rank": {"type": "integer", "minimum": 0},
40
- "counter_id": {"type": "integer", "minimum": 0},
41
- "wall_time": {"type": "number", "minimum": 0, "description": "Rank-local wall time in seconds. Zero-time records are retained evidence but are not usable measurements."},
 
 
 
 
 
 
 
 
42
  "observed_at_unix_ms": {"type": "number", "minimum": 0},
 
 
 
 
43
  "scheduled_requests": {"$ref": "#/$defs/requestMetrics"},
44
  "queued_requests": {"$ref": "#/$defs/requestMetrics"}
45
  },
46
  "additionalProperties": true
47
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  "benchmarkPoint": {
49
  "type": "object",
50
  "required": [
@@ -63,7 +146,285 @@
63
  },
64
  "additionalProperties": true
65
  },
66
- "rankResult": {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  "type": "object",
68
  "required": ["dp_rank", "fpms"],
69
  "properties": {
@@ -72,12 +433,12 @@
72
  "type": "array",
73
  "minItems": 1,
74
  "maxItems": 1,
75
- "items": {"$ref": "#/$defs/rankMeasurement"}
76
  }
77
  },
78
  "additionalProperties": true
79
  },
80
- "synchronizedIteration": {
81
  "type": "object",
82
  "required": [
83
  "benchmark_id",
@@ -97,11 +458,15 @@
97
  "items": {"type": "integer", "minimum": 0}
98
  },
99
  "complete": {"const": true},
100
- "wall_time": {"type": "number", "exclusiveMinimum": 0, "description": "Observed iteration wall time in seconds; equal to the maximum rank wall time."},
 
 
 
 
101
  "rank_results": {
102
  "type": "array",
103
  "minItems": 1,
104
- "items": {"$ref": "#/$defs/rankResult"}
105
  }
106
  },
107
  "additionalProperties": true
@@ -109,15 +474,34 @@
109
  },
110
  "x-source-representations": [
111
  {
112
- "name": "observation_stream",
113
  "file_extensions": [".jsonl", ".jsonl.gz"],
114
- "record_schema": "#/$defs/rankMeasurement"
 
 
 
115
  },
116
  {
117
- "name": "synchronized_iteration",
118
  "file_extensions": [".json", ".json.gz"],
119
  "record_path": "iteration_groups[]",
 
 
 
 
 
 
 
 
120
  "record_schema": "#/$defs/synchronizedIteration"
121
  }
 
 
 
 
 
 
 
 
122
  ]
123
  }
 
3
  "$id": "https://huggingface.co/datasets/nvidia/aisimulate-fpm-dataset/raw/main/schemas/forward-pass-measurement-v1.schema.json",
4
  "x-protocol-id": "forward-pass-measurement-v1",
5
  "title": "Forward-pass measurement v1 record",
6
+ "description": "A canonical synchronized forward-pass iteration or one of its supported physical source records.",
7
  "oneOf": [
8
+ {"$ref": "#/$defs/synchronizedIteration"},
9
+ {"$ref": "#/$defs/rankObservation"},
10
+ {"$ref": "#/$defs/selfBenchmarkIterationSource"}
11
  ],
12
  "$defs": {
13
  "requestMetrics": {
14
  "type": "object",
15
  "properties": {
16
+ "num_prefill_requests": {
17
+ "type": "integer",
18
+ "minimum": 0,
19
+ "default": 0,
20
+ "description": "Number of prefill requests."
21
+ },
22
+ "sum_prefill_tokens": {
23
+ "type": "integer",
24
+ "minimum": 0,
25
+ "default": 0,
26
+ "description": "New prefill tokens computed in this iteration."
27
+ },
28
+ "var_prefill_length": {
29
+ "type": "number",
30
+ "minimum": 0,
31
+ "default": 0,
32
+ "description": "Population variance of full prompt lengths across prefill requests."
33
+ },
34
+ "sum_prefill_kv_tokens": {
35
+ "type": "integer",
36
+ "minimum": 0,
37
+ "default": 0,
38
+ "description": "Previously computed prefix or prior-chunk tokens read from KV cache for prefill requests."
39
+ },
40
+ "num_decode_requests": {
41
+ "type": "integer",
42
+ "minimum": 0,
43
+ "default": 0,
44
+ "description": "Number of decode requests."
45
+ },
46
+ "sum_decode_kv_tokens": {
47
+ "type": "integer",
48
+ "minimum": 0,
49
+ "default": 0,
50
+ "description": "Total KV context length across decode requests."
51
+ },
52
+ "var_decode_kv_tokens": {
53
+ "type": "number",
54
+ "minimum": 0,
55
+ "default": 0,
56
+ "description": "Population variance of KV context lengths across decode requests."
57
+ }
58
  },
59
  "additionalProperties": true
60
  },
61
+ "rankObservation": {
62
  "type": "object",
63
  "required": [
64
  "version",
 
73
  "version": {"const": 1},
74
  "worker_id": {"type": "string", "minLength": 1},
75
  "dp_rank": {"type": "integer", "minimum": 0},
76
+ "counter_id": {
77
+ "type": "integer",
78
+ "minimum": 0,
79
+ "description": "Monotonic sequence number local to one worker and DP rank. It is not a cross-rank iteration key."
80
+ },
81
+ "wall_time": {
82
+ "type": "number",
83
+ "minimum": 0,
84
+ "description": "Rank-local wall time in seconds. Zero-time records are retained evidence but are not usable measurements."
85
+ },
86
  "observed_at_unix_ms": {"type": "number", "minimum": 0},
87
+ "_recv_ts": {
88
+ "type": ["number", "string"],
89
+ "description": "Raw listener receive timestamp from a physical rank-event stream. A normalizer must preserve the captured value when it uses corrected receive time to join ranks."
90
+ },
91
  "scheduled_requests": {"$ref": "#/$defs/requestMetrics"},
92
  "queued_requests": {"$ref": "#/$defs/requestMetrics"}
93
  },
94
  "additionalProperties": true
95
  },
96
+ "producer": {
97
+ "type": "object",
98
+ "required": ["component"],
99
+ "properties": {
100
+ "component": {
101
+ "type": "string",
102
+ "minLength": 1,
103
+ "description": "Component that produced the rank-local FPM measurements."
104
+ },
105
+ "version": {"type": "string", "minLength": 1},
106
+ "source_revision": {"type": "string", "minLength": 1}
107
+ },
108
+ "additionalProperties": true
109
+ },
110
+ "collector": {
111
+ "type": "object",
112
+ "required": ["kind"],
113
+ "properties": {
114
+ "kind": {"enum": ["custom_script", "service"]},
115
+ "component": {"type": "string", "minLength": 1},
116
+ "path": {"type": "string", "minLength": 1},
117
+ "source_revision": {"type": "string", "minLength": 1}
118
+ },
119
+ "additionalProperties": true
120
+ },
121
+ "singleRankGrouping": {
122
+ "type": "object",
123
+ "required": ["method", "authority"],
124
+ "properties": {
125
+ "method": {"const": "single_rank"},
126
+ "authority": {"const": "producer"},
127
+ "key": {"type": "string", "minLength": 1}
128
+ },
129
+ "additionalProperties": true
130
+ },
131
  "benchmarkPoint": {
132
  "type": "object",
133
  "required": [
 
146
  },
147
  "additionalProperties": true
148
  },
149
+ "benchmarkIdGrouping": {
150
+ "type": "object",
151
+ "required": ["method", "authority", "key", "benchmark_id", "point"],
152
+ "properties": {
153
+ "method": {"const": "benchmark_id"},
154
+ "authority": {"const": "producer"},
155
+ "key": {
156
+ "type": "string",
157
+ "minLength": 1,
158
+ "description": "Canonical string form of benchmark_id."
159
+ },
160
+ "benchmark_id": {"type": "integer", "minimum": 0},
161
+ "point": {"$ref": "#/$defs/benchmarkPoint"}
162
+ },
163
+ "x-semantic-constraints": [
164
+ "key must equal the canonical decimal string form of benchmark_id.",
165
+ "benchmark_id must equal point.benchmark_id."
166
+ ],
167
+ "additionalProperties": true
168
+ },
169
+ "clockCorrectionGroup": {
170
+ "type": "object",
171
+ "required": ["clock_id", "dp_ranks", "offset"],
172
+ "properties": {
173
+ "clock_id": {"type": "string", "minLength": 1},
174
+ "dp_ranks": {
175
+ "type": "array",
176
+ "minItems": 1,
177
+ "uniqueItems": true,
178
+ "items": {"type": "integer", "minimum": 0}
179
+ },
180
+ "offset": {
181
+ "type": "number",
182
+ "description": "Signed value added to each raw receive timestamp in this clock group before window grouping."
183
+ }
184
+ },
185
+ "additionalProperties": true
186
+ },
187
+ "clockCorrection": {
188
+ "type": "object",
189
+ "required": [
190
+ "method",
191
+ "reference_clock_id",
192
+ "offset_unit",
193
+ "groups"
194
+ ],
195
+ "properties": {
196
+ "method": {
197
+ "type": "string",
198
+ "minLength": 1,
199
+ "description": "Stable identifier for the clock-correction procedure."
200
+ },
201
+ "reference_clock_id": {"type": "string", "minLength": 1},
202
+ "offset_unit": {"enum": ["s", "ms", "us", "ns"]},
203
+ "groups": {
204
+ "type": "array",
205
+ "minItems": 1,
206
+ "items": {"$ref": "#/$defs/clockCorrectionGroup"}
207
+ }
208
+ },
209
+ "x-semantic-constraints": [
210
+ "clock_id values must be unique.",
211
+ "groups[].dp_ranks must partition expected_dp_ranks without duplicates or omissions.",
212
+ "The group named by reference_clock_id must exist and have offset 0."
213
+ ],
214
+ "additionalProperties": true
215
+ },
216
+ "receiveTimeWindow": {
217
+ "type": "object",
218
+ "required": ["size", "unit", "anchor", "boundary", "distinct_by"],
219
+ "properties": {
220
+ "size": {"type": "number", "exclusiveMinimum": 0},
221
+ "unit": {"enum": ["s", "ms", "us", "ns"]},
222
+ "anchor": {"const": "earliest_corrected_receive_timestamp"},
223
+ "boundary": {"const": "half_open"},
224
+ "distinct_by": {"const": "dp_rank"}
225
+ },
226
+ "additionalProperties": true
227
+ },
228
+ "listenerReceiveTimeWindowGrouping": {
229
+ "type": "object",
230
+ "required": [
231
+ "method",
232
+ "authority",
233
+ "performed_by",
234
+ "key",
235
+ "engine_role",
236
+ "source_field",
237
+ "source_unit",
238
+ "clock_correction",
239
+ "window",
240
+ "window_start"
241
+ ],
242
+ "properties": {
243
+ "method": {"const": "listener_receive_time_window"},
244
+ "authority": {"const": "derived"},
245
+ "performed_by": {
246
+ "type": "string",
247
+ "minLength": 1,
248
+ "description": "Component that derived the synchronized group."
249
+ },
250
+ "key": {
251
+ "type": "string",
252
+ "minLength": 1,
253
+ "description": "Stable identity for the engine-role-local corrected receive-time window."
254
+ },
255
+ "engine_role": {
256
+ "type": "string",
257
+ "minLength": 1,
258
+ "description": "Source engine role. This is collection topology, not the derived workload kind."
259
+ },
260
+ "source_field": {"const": "_recv_ts"},
261
+ "source_unit": {"enum": ["s", "ms", "us", "ns"]},
262
+ "clock_correction": {"$ref": "#/$defs/clockCorrection"},
263
+ "window": {"$ref": "#/$defs/receiveTimeWindow"},
264
+ "window_start": {
265
+ "type": "string",
266
+ "minLength": 1,
267
+ "pattern": "^[0-9]+(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$",
268
+ "description": "Earliest corrected receive timestamp in source_unit, serialized as a string."
269
+ }
270
+ },
271
+ "x-semantic-constraints": [
272
+ "Add the declared clock-group offset to every raw _recv_ts before grouping.",
273
+ "Within one engine_role, sort by corrected receive time and form half-open windows anchored at the earliest ungrouped record.",
274
+ "A window member must have corrected receive time minus window_start strictly less than window.size after unit conversion.",
275
+ "A window may contain at most one record per dp_rank; a repeated rank starts a new window.",
276
+ "key must be derived deterministically from engine_role, window_start, source_unit, and window.",
277
+ "counter_id and file position must not be used as cross-rank iteration keys."
278
+ ],
279
+ "additionalProperties": true
280
+ },
281
+ "grouping": {
282
+ "oneOf": [
283
+ {"$ref": "#/$defs/singleRankGrouping"},
284
+ {"$ref": "#/$defs/benchmarkIdGrouping"},
285
+ {"$ref": "#/$defs/listenerReceiveTimeWindowGrouping"}
286
+ ]
287
+ },
288
+ "synchronizedIteration": {
289
+ "type": "object",
290
+ "required": [
291
+ "version",
292
+ "source_kind",
293
+ "iteration_id",
294
+ "producer",
295
+ "grouping",
296
+ "expected_dp_ranks",
297
+ "complete",
298
+ "max_rank_wall_time",
299
+ "rank_measurements"
300
+ ],
301
+ "properties": {
302
+ "version": {"const": 1},
303
+ "source_kind": {"enum": ["self_benchmark", "rank_event_stream"]},
304
+ "iteration_id": {
305
+ "type": "string",
306
+ "minLength": 1,
307
+ "description": "Stable iteration identity within the physical file."
308
+ },
309
+ "producer": {"$ref": "#/$defs/producer"},
310
+ "collector": {"$ref": "#/$defs/collector"},
311
+ "grouping": {"$ref": "#/$defs/grouping"},
312
+ "expected_dp_ranks": {
313
+ "type": "array",
314
+ "minItems": 1,
315
+ "uniqueItems": true,
316
+ "items": {"type": "integer", "minimum": 0}
317
+ },
318
+ "complete": {"type": "boolean"},
319
+ "max_rank_wall_time": {
320
+ "type": ["number", "null"],
321
+ "minimum": 0,
322
+ "description": "Cached default scoring latency in seconds. For a complete iteration, this equals the maximum rank-local wall time; consumers may derive another policy from rank_measurements."
323
+ },
324
+ "rank_measurements": {
325
+ "type": "array",
326
+ "items": {"$ref": "#/$defs/rankObservation"}
327
+ }
328
+ },
329
+ "allOf": [
330
+ {
331
+ "if": {
332
+ "properties": {"complete": {"const": true}},
333
+ "required": ["complete"]
334
+ },
335
+ "then": {
336
+ "properties": {
337
+ "max_rank_wall_time": {"type": "number", "minimum": 0},
338
+ "rank_measurements": {"minItems": 1}
339
+ }
340
+ },
341
+ "else": {
342
+ "properties": {
343
+ "max_rank_wall_time": {"type": "null"}
344
+ }
345
+ }
346
+ },
347
+ {
348
+ "if": {
349
+ "properties": {"source_kind": {"const": "self_benchmark"}},
350
+ "required": ["source_kind"]
351
+ },
352
+ "then": {
353
+ "properties": {
354
+ "grouping": {"$ref": "#/$defs/benchmarkIdGrouping"}
355
+ }
356
+ }
357
+ },
358
+ {
359
+ "if": {
360
+ "properties": {"source_kind": {"const": "rank_event_stream"}},
361
+ "required": ["source_kind"]
362
+ },
363
+ "then": {
364
+ "properties": {
365
+ "grouping": {
366
+ "oneOf": [
367
+ {"$ref": "#/$defs/singleRankGrouping"},
368
+ {"$ref": "#/$defs/listenerReceiveTimeWindowGrouping"}
369
+ ]
370
+ }
371
+ }
372
+ }
373
+ },
374
+ {
375
+ "if": {
376
+ "properties": {
377
+ "grouping": {
378
+ "properties": {"method": {"const": "single_rank"}},
379
+ "required": ["method"]
380
+ }
381
+ },
382
+ "required": ["grouping"]
383
+ },
384
+ "then": {
385
+ "properties": {
386
+ "expected_dp_ranks": {"maxItems": 1},
387
+ "rank_measurements": {"minItems": 1, "maxItems": 1}
388
+ }
389
+ }
390
+ },
391
+ {
392
+ "if": {
393
+ "properties": {
394
+ "grouping": {
395
+ "properties": {
396
+ "method": {"const": "listener_receive_time_window"}
397
+ },
398
+ "required": ["method"]
399
+ }
400
+ },
401
+ "required": ["grouping"]
402
+ },
403
+ "then": {
404
+ "required": ["collector"],
405
+ "properties": {
406
+ "rank_measurements": {
407
+ "items": {
408
+ "required": ["_recv_ts"]
409
+ }
410
+ }
411
+ }
412
+ }
413
+ }
414
+ ],
415
+ "x-semantic-constraints": [
416
+ "rank_measurements must be ordered by ascending dp_rank.",
417
+ "rank_measurements must not contain duplicate dp_rank values.",
418
+ "For complete=true, rank_measurements dp_rank values must exactly equal expected_dp_ranks.",
419
+ "For complete=true, max_rank_wall_time must equal max(rank_measurements[*].wall_time).",
420
+ "For complete=false, available rank measurements are retained and max_rank_wall_time must be null.",
421
+ "For grouping.method=single_rank, expected_dp_ranks and rank_measurements must each contain exactly one matching rank.",
422
+ "collector is optional except when grouping.method=listener_receive_time_window.",
423
+ "For grouping.method=listener_receive_time_window, every rank measurement must retain its raw _recv_ts value."
424
+ ],
425
+ "additionalProperties": true
426
+ },
427
+ "selfBenchmarkRankResult": {
428
  "type": "object",
429
  "required": ["dp_rank", "fpms"],
430
  "properties": {
 
433
  "type": "array",
434
  "minItems": 1,
435
  "maxItems": 1,
436
+ "items": {"$ref": "#/$defs/rankObservation"}
437
  }
438
  },
439
  "additionalProperties": true
440
  },
441
+ "selfBenchmarkIterationSource": {
442
  "type": "object",
443
  "required": [
444
  "benchmark_id",
 
458
  "items": {"type": "integer", "minimum": 0}
459
  },
460
  "complete": {"const": true},
461
+ "wall_time": {
462
+ "type": "number",
463
+ "exclusiveMinimum": 0,
464
+ "description": "Observed iteration wall time in seconds; equal to the maximum rank wall time."
465
+ },
466
  "rank_results": {
467
  "type": "array",
468
  "minItems": 1,
469
+ "items": {"$ref": "#/$defs/selfBenchmarkRankResult"}
470
  }
471
  },
472
  "additionalProperties": true
 
474
  },
475
  "x-source-representations": [
476
  {
477
+ "name": "rank_event_stream",
478
  "file_extensions": [".jsonl", ".jsonl.gz"],
479
+ "record_schema": "#/$defs/rankObservation",
480
+ "normalizes_to": "#/$defs/synchronizedIteration",
481
+ "source_kind": "rank_event_stream",
482
+ "grouping_methods": ["single_rank", "listener_receive_time_window"]
483
  },
484
  {
485
+ "name": "self_benchmark",
486
  "file_extensions": [".json", ".json.gz"],
487
  "record_path": "iteration_groups[]",
488
+ "record_schema": "#/$defs/selfBenchmarkIterationSource",
489
+ "normalizes_to": "#/$defs/synchronizedIteration",
490
+ "source_kind": "self_benchmark",
491
+ "grouping_method": "benchmark_id"
492
+ },
493
+ {
494
+ "name": "canonical_iteration_stream",
495
+ "file_extensions": [".jsonl", ".jsonl.gz"],
496
  "record_schema": "#/$defs/synchronizedIteration"
497
  }
498
+ ],
499
+ "x-semantic-constraints": [
500
+ "producer identifies the component that created rank-local FPM measurements.",
501
+ "collector identifies a separate capture component and is otherwise omitted.",
502
+ "A standalone rankObservation is directly evaluable only when attention_dp_size is 1.",
503
+ "For attention_dp_size greater than 1, truth requires a complete synchronizedIteration.",
504
+ "A listener receive-time-window join requires raw _recv_ts evidence, explicit clock corrections, and an explicit window rule; exact timestamp equality, file order, and rank-local counter_id are not cross-rank identities.",
505
+ "Zero-time and empty-heartbeat observations may be retained but are excluded from measured evaluation points."
506
  ]
507
  }