You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Antenna currently distributes ML work to processing workers via NATS JetStream pull-subscriptions. Workers are reference-implemented in ami-data-companion (a standalone Python process). Researchers can also run their own workers — same protocol, same auth, no public endpoint required on their side.
The reference worker has accumulated a long tail of subprocess/memory hygiene issues (RolnickLab/ami-data-companion#140, #145, #144, #147). PR RolnickLab/ami-data-companion#148 ships a near-term fix that addresses the immediate OOM family, but the broader pattern is that we're maintaining custom process-management, GPU memory hygiene, and worker-recycling code that mature OSS handles for free.
This ticket is research and discovery for a "processing service v3" — a worker SDK/runtime bundled in the Antenna repo, designed so the same protocol works for:
a Jupyter notebook function (researcher iterates on a new model),
a single-GPU lab workstation,
a SLURM array job on a university HPC cluster (no inbound network access),
a production multi-GPU service.
Outcome: a recommendation document + proof-of-concept on one or two candidate frameworks. No implementation in this ticket — that lands in follow-up PRs once a direction is picked.
Why now
PR ami-data-companion#148 fixes the immediate fire but doesn't change the architecture. We're going to keep filing variants of the same bug if we don't migrate the worker internals off bespoke code.
The "researchers run their own workers" requirement is genuinely uncommon in commercial ML serving (Triton, TorchServe, Ray Serve, KServe, BentoML are all push-based) — but it's exactly what Antenna's collaborative-research model needs.
The NATS-based federation boundary is the right choice and not what we want to change. The question is what runs inside the worker.
Requirements the current design solves (don't break these)
Federation: anybody can show up with their own worker, no Antenna-controlled fleet.
Heterogeneous shapes: same protocol from Jupyter to HPC.
Open ML problem: workers ship custom models, custom preprocessing, custom collation. Antenna provides the platform, researchers contribute the science.
Strong API contracts (OpenAPI + pydantic): keeps worker/server loose-coupled across model evolution.
What needs deciding
What goes inside the worker boundary, behind the NATS protocol? Three layers to evaluate:
Plain-language summary
Antenna currently distributes ML work to processing workers via NATS JetStream pull-subscriptions. Workers are reference-implemented in
ami-data-companion(a standalone Python process). Researchers can also run their own workers — same protocol, same auth, no public endpoint required on their side.The reference worker has accumulated a long tail of subprocess/memory hygiene issues (RolnickLab/ami-data-companion#140, #145, #144, #147). PR RolnickLab/ami-data-companion#148 ships a near-term fix that addresses the immediate OOM family, but the broader pattern is that we're maintaining custom process-management, GPU memory hygiene, and worker-recycling code that mature OSS handles for free.
This ticket is research and discovery for a "processing service v3" — a worker SDK/runtime bundled in the Antenna repo, designed so the same protocol works for:
Outcome: a recommendation document + proof-of-concept on one or two candidate frameworks. No implementation in this ticket — that lands in follow-up PRs once a direction is picked.
Why now
Requirements the current design solves (don't break these)
What needs deciding
What goes inside the worker boundary, behind the NATS protocol? Three layers to evaluate:
Process management + recycling: kills the leak treadmill (Bump sqlalchemy from 2.0.8 to 2.0.12 in /backend #140, Bump ra-data-simple-rest from 4.9.0 to 4.10.1 in /frontend #145, Add favicons #147)
multiprocessing.Poolwithmaxtasksperchild(stdlib only, cheapest)concurrent.futures.ProcessPoolExecutor--max-tasks-per-child(custom NATS broker required)max_restarts/max_calls_per_actorGPU memory + batching:
Pipeline orchestration (detect → classify → species-classify):
Candidate frameworks to evaluate
For each: federation fit, researcher onboarding cost, GPU memory handling, recycling story, integration cost with NATS, license, community health.
multiprocessing.Pool— simplest, no new deps, solves Add favicons #147 in ~20 LoC. Doesn't help GPU memory.@ray.remoteclasses. Adds Ray as a heavy dep.Discovery scope
quebec_vermont_moths_2023, posts results.Out of scope (for this ticket)
ami-data-companion.Pluggable-backend SDK pattern (worth evaluating during discovery)
A direction worth testing in the proof-of-concept: a single SDK with backends picked per deployment:
All backends speak NATS upward; Antenna server is unaware which is in use.
References