Skip to content

Commit f70f1ff

Browse files
feat(ops): expose worker telemetry and Mac MLX equivalence preset
Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com>
1 parent 8486d36 commit f70f1ff

4 files changed

Lines changed: 39 additions & 0 deletions

File tree

inference_engine/bridge/manifest.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,22 @@ def _harness_preset(
104104
PRESETS: Dict[str, Preset] = {
105105
p.name: p
106106
for p in (
107+
Preset(
108+
name="mlx-prefill-snapshot-equivalence",
109+
description="ADR 0017 real-model gate: local MLX prefill vs "
110+
"snapshot export/import must preserve continuation "
111+
"logits, argmax, retained KV tokens and one decode step.",
112+
command_templates=(
113+
(
114+
"python3", "-m", "pytest",
115+
"-m", "integration",
116+
"tests/integration/test_prefill_snapshot_mlx_equivalence.py",
117+
"-q",
118+
),
119+
),
120+
timeout_minutes=45,
121+
validate_reports=False,
122+
),
107123
Preset(
108124
name="mlx-distributed-dflash-e2e-inproc",
109125
description="Real-model distributed DFlash+f_θ E2E (in-process): loads "

inference_engine/network/state.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def nodes(self) -> list[dict[str, Any]]:
9595
for card in self.registry.snapshot():
9696
registration = registrations.get(card.node_id, {})
9797
cache = card.caches[0] if card.caches else None
98+
worker = card.prefill_workers[0] if card.prefill_workers else None
9899
endpoint = sorted(
99100
card.endpoints,
100101
key=lambda item: item.priority,
@@ -132,6 +133,19 @@ def nodes(self) -> list[dict[str, Any]]:
132133
}
133134
if cache else None
134135
),
136+
"prefill_worker": (
137+
{
138+
"address": worker.worker_address,
139+
"max_concurrent_jobs": worker.max_concurrent_jobs,
140+
"inflight_jobs": worker.inflight_jobs,
141+
"queued_jobs": worker.queued_jobs,
142+
"queued_tokens": worker.queued_tokens,
143+
"load": worker.load,
144+
"tokens_per_second": worker.tokens_per_second_prefill,
145+
"ram_bytes_free": worker.ram_bytes_free,
146+
}
147+
if worker else None
148+
),
135149
"endpoint": (
136150
{
137151
"address": endpoint[0].address,
@@ -160,6 +174,7 @@ def nodes(self) -> list[dict[str, Any]]:
160174
"memory_bytes": 0,
161175
"models": [],
162176
"cache": None,
177+
"prefill_worker": None,
163178
"endpoint": {
164179
"address": registration["address"],
165180
"network": "pending",

tests/inference_engine/bridge/test_manifest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def test_allowlist_contains_exactly_the_documented_presets():
9696
"mlx-kakeya-launcher-full",
9797
"mlx-kakeya-launcher-smoke",
9898
"mlx-multitenant-pressure",
99+
"mlx-prefill-snapshot-equivalence",
99100
"mlx-upgrade",
100101
"mlx-upstream-batch-probe",
101102
"pytest-path",

tests/inference_engine/network/test_network_state.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
CapabilityRegistry,
77
NodeCapability,
88
NodeEndpoint,
9+
PrefillWorkerCapability,
910
)
1011
from inference_engine.distributed.prefill_cache import PrefixCacheStore
1112
from inference_engine.network.state import NetworkState
@@ -27,6 +28,12 @@ def _state(tmp_path):
2728
),
2829
),
2930
endpoints=(NodeEndpoint("head:2", "thunderbolt", 100, 0.4),),
31+
prefill_workers=(PrefillWorkerCapability(
32+
compatibility,
33+
worker_address="head:3",
34+
queued_tokens=128,
35+
tokens_per_second_prefill=32,
36+
),),
3037
)
3138
return NetworkState(
3239
CapabilityRegistry(self_card=card),

0 commit comments

Comments
 (0)