Skip to content

Commit 5680bd7

Browse files
committed
campaign: score the ANE direct embed lane by aggregate throughput
The row set is half 12-38-token rows and half near-512-token rows, so a median of per-row rates sat between two regimes and rewarded shaving the per-row fixed cost that dominates the short rows. Every active token over every millisecond weights rows by the work they carry. The runner reads the objective from the field name every embed harness here uses, so that name stays and aggregate_tok_s carries the same value under the honest one. Baseline re-measured with the harness under the new ruler: 9,222 tok/s at 512, min cosine 0.9990908 across shapes, load 8 at admission.
1 parent f31291f commit 5680bd7

2 files changed

Lines changed: 23 additions & 7 deletions

File tree

‎bench/campaign/ane-direct-embed-harness.sh‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import tempfile
2121
from pathlib import Path
2222
from typing import Any, Dict, List, Mapping, Optional, Sequence, Tuple
2323
24-
BASELINE_TOK_S = 8_941.75223984836
24+
BASELINE_TOK_S = 9_222.454033809034
2525
ROW_SET_SHA256 = "f4889a38df77b9940ce973c4d9b82857d0c401987ae8e77b5ca25e6062808c39"
2626
MODEL_REVISION = "e7f32e3c00f91d699e8c43b53106206bcc72bb22"
2727
MODEL_COMPONENT_SHA256 = {
@@ -99,6 +99,7 @@ def initial_payload(note: str) -> Dict[str, Any]:
9999
"samples": [],
100100
"paired_runs": [],
101101
"median_tok_s": None,
102+
"aggregate_tok_s": None,
102103
"min_cosine": None,
103104
"sequence_1024_tok_s": None,
104105
"sequence_2048_tok_s": None,
@@ -604,8 +605,21 @@ def validate_report(
604605
report_load = payload.get("one_minute_load_average")
605606
if not finite_number(report_load) or float(report_load) < 0.0:
606607
raise CandidateRejected("candidate report omitted a valid one-minute load average")
608+
# The row set is half 12-38-token rows and half near-512-token rows. A median
609+
# of per-row rates lands between those two regimes and rewards shaving the
610+
# per-row fixed cost that dominates the short rows. Aggregate throughput —
611+
# every active token over every millisecond spent — weights the rows by the
612+
# work they carry, which is what the lane exists to serve.
613+
total_active = sum(int(row["active_tokens"]) for row in row_measurements)
614+
total_wall_ms = sum(float(row["warm_wall_ms_median"]) for row in row_measurements)
615+
aggregate = total_active * 1000.0 / total_wall_ms
607616
return {
608-
"median_tok_s": float(statistics.median(row_rates)),
617+
# The campaign runner reads the objective from the field every embed
618+
# harness in this repository names `median_tok_s`; the name is a wire
619+
# contract, so it stays, and `aggregate_tok_s` carries the same value
620+
# under the name that describes it.
621+
"median_tok_s": aggregate,
622+
"aggregate_tok_s": aggregate,
609623
"row_tok_s": row_rates,
610624
"rows": row_measurements,
611625
"min_cosine": float(reported_min),
@@ -728,6 +742,7 @@ def run_harness(workspace_arg: str, runner_arg: str, result_arg: str) -> int:
728742
"samples": objective["row_tok_s"],
729743
"paired_runs": measurements,
730744
"median_tok_s": objective["median_tok_s"],
745+
"aggregate_tok_s": objective["aggregate_tok_s"],
731746
"min_cosine": min_cosine,
732747
"sequence_1024_tok_s": measurements[1]["median_tok_s"],
733748
"sequence_2048_tok_s": measurements[2]["median_tok_s"],

‎bench/campaign/ane-direct-embed-registration.jsonc‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
{
88
"machine": "m5-local",
99
"harness_path": "bench/campaign/ane-direct-embed-harness.sh",
10-
"harness_sha256": "25fd123291206020008e56bf6f7ef573cc0f18c7f16cc68258c313eb4877510f",
10+
"harness_sha256": "a3f9546e2402ffb5ce077a915cb52d609e2f964de732807e40b0d68291185933",
1111
"parameters": {},
1212
"parity_command": {
13-
"harness_sha256": "25fd123291206020008e56bf6f7ef573cc0f18c7f16cc68258c313eb4877510f",
13+
"harness_sha256": "a3f9546e2402ffb5ce077a915cb52d609e2f964de732807e40b0d68291185933",
1414
"program": "{harness}",
1515
"args": ["{workspace}", "{candidate_runner}", "{result}"],
1616
"env": {
1717
"HF_HUB_OFFLINE": "1",
1818
"TRANSFORMERS_OFFLINE": "1",
19-
"SYNAPSE_CAMPAIGN_BASELINE_TOK_S": "8941.75223984836",
19+
"SYNAPSE_CAMPAIGN_BASELINE_TOK_S": "9222.454033809034",
2020
"SYNAPSE_CAMPAIGN_MODEL": "<RIG>/.cache/huggingface/hub/models--Alibaba-NLP--gte-modernbert-base/snapshots/e7f32e3c00f91d699e8c43b53106206bcc72bb22",
2121
"SYNAPSE_CAMPAIGN_MODEL_SHA256": "3e85899d5728cb7de79781c0c3acfb91ccef9f875f1f7e0b3c9f3dd4b6a724ba",
2222
"SYNAPSE_CAMPAIGN_ROWS_SHA256": "f4889a38df77b9940ce973c4d9b82857d0c401987ae8e77b5ca25e6062808c39",
@@ -30,13 +30,13 @@
3030
}
3131
},
3232
"objective_command": {
33-
"harness_sha256": "25fd123291206020008e56bf6f7ef573cc0f18c7f16cc68258c313eb4877510f",
33+
"harness_sha256": "a3f9546e2402ffb5ce077a915cb52d609e2f964de732807e40b0d68291185933",
3434
"program": "{harness}",
3535
"args": ["{workspace}", "{candidate_runner}", "{result}"],
3636
"env": {
3737
"HF_HUB_OFFLINE": "1",
3838
"TRANSFORMERS_OFFLINE": "1",
39-
"SYNAPSE_CAMPAIGN_BASELINE_TOK_S": "8941.75223984836",
39+
"SYNAPSE_CAMPAIGN_BASELINE_TOK_S": "9222.454033809034",
4040
"SYNAPSE_CAMPAIGN_MODEL": "<RIG>/.cache/huggingface/hub/models--Alibaba-NLP--gte-modernbert-base/snapshots/e7f32e3c00f91d699e8c43b53106206bcc72bb22",
4141
"SYNAPSE_CAMPAIGN_MODEL_SHA256": "3e85899d5728cb7de79781c0c3acfb91ccef9f875f1f7e0b3c9f3dd4b6a724ba",
4242
"SYNAPSE_CAMPAIGN_ROWS_SHA256": "f4889a38df77b9940ce973c4d9b82857d0c401987ae8e77b5ca25e6062808c39",
@@ -55,6 +55,7 @@
5555
"parity_passed": {"type": "boolean"},
5656
"determinism_passed": {"type": "boolean"},
5757
"median_tok_s": {"type": "number"},
58+
"aggregate_tok_s": {"type": "number"},
5859
"min_cosine": {"type": "number"},
5960
"sequence_1024_tok_s": {"type": "number"},
6061
"sequence_2048_tok_s": {"type": "number"}

0 commit comments

Comments
 (0)