Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
57d9a66
refactor(benchmark): split execute.py into execute/profiling/accuracy…
arekay-nv Jul 28, 2026
3070db5
fix(benchmark): kill metrics services on setup failure after launch
arekay-nv Jul 28, 2026
d0956df
fix(benchmark): make kill_all best-effort in MetricsPipeline teardown
arekay-nv Jul 28, 2026
6de2b00
Merge branch 'main' into refactor/execute-split
arekay-nv Jul 28, 2026
137ee01
Merge branch 'main' into refactor/execute-split
arekay-nv Jul 29, 2026
3174d26
refactor(benchmark): promote split helpers to public names + small cl…
arekay-nv Jul 30, 2026
0b22761
fix(benchmark): make pbar.close() best-effort so it can't mask run er…
arekay-nv Jul 30, 2026
3204f52
refactor(benchmark): make MetricsPipeline an async context manager
arekay-nv Jul 30, 2026
693a816
fix(benchmark): guard tmpfs salvage + profiling.json write; cover pro…
arekay-nv Jul 30, 2026
8276b46
Merge branch 'main' into refactor/execute-split
arekay-nv Jul 30, 2026
257d50b
fix(benchmark): shut down HTTP client on setup error; guard drain; co…
arekay-nv Jul 30, 2026
cca7eee
fix(benchmark): propagate drain error on clean runs; dedup test import
arekay-nv Jul 31, 2026
9456604
fix(benchmark): harden report and pipeline teardown failures
arekay-nv Aug 2, 2026
42056f0
fix(benchmark): SIGTERM-before-SIGKILL teardown, publisher sentinel r…
arekay-nv Aug 4, 2026
e3cd7a1
Merge branch 'main' into refactor/execute-split
arekay-nv Aug 4, 2026
fb10049
fix(launcher): add debug logging to empty OSError handlers in termina…
arekay-nv Aug 4, 2026
be6b9ac
fix(benchmark): update docstrings and harden terminate_all SIGKILL es…
arekay-nv Aug 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ src/inference_endpoint/
│ ├── benchmark/
│ │ ├── __init__.py
│ │ ├── cli.py # benchmark_app: offline, online, from-config subcommands
│ │ └── execute.py # Phased execution: setup/run_threaded/finalize + BenchmarkContext; run_benchmark runs the main benchmark (cli._run dispatches run_audit when audit: is set)
│ │ ├── execute.py # Phased orchestration: setup_benchmark/run_benchmark_async/finalize_benchmark + BenchmarkContext; run_benchmark runs the main benchmark (cli._run dispatches run_audit when audit: is set)
│ │ ├── profiling.py # Profiler-trigger protocol (vLLM /start_profile,/stop_profile) + ProfileController (URL derivation + start/stop/payload lifecycle)
│ │ ├── accuracy.py # AccuracyConfiguration + per-dataset scoring (_score_accuracy, OSL/response-count rollups, write_accuracy_results)
│ │ └── pipeline.py # MetricsPipeline: async context manager for the ZMQ + metrics-aggregator/event-logger subprocess lifecycle (__aenter__/__aexit__/start/drain_and_build_report) + snapshot→Report
│ ├── audit.py # run_audit() — compliance audit orchestrator (phases → verify → result)
│ ├── probe.py # ProbeConfig + execute_probe()
│ ├── info.py # execute_info()
Expand Down
29 changes: 29 additions & 0 deletions src/inference_endpoint/async_utils/services/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,35 @@ async def launch(
# re-raise the exception.
raise

def terminate_all(self, timeout: float = 5.0) -> None:
"""Terminate all managed subprocesses: SIGTERM then escalate to SIGKILL.

Sends SIGTERM first so subprocesses can flush final state (e.g. the
metrics aggregator writes ``INTERRUPTED`` ``final_snapshot.json`` in its
SIGTERM handler). After ``timeout`` seconds any process that has not
exited is killed unconditionally with SIGKILL.
"""
for proc in self._procs:
if proc.poll() is None:
try:
proc.terminate()
except OSError as e: # noqa: BLE001 — proc already exited between poll and terminate
logger.debug("terminate pid=%d: %s", proc.pid, e)
deadline = time.monotonic() + timeout
for proc in self._procs:
remaining = max(0.0, deadline - time.monotonic())
try:
proc.wait(timeout=remaining)
except subprocess.TimeoutExpired:
try:
proc.kill()
proc.wait(timeout=5)
except (OSError, subprocess.TimeoutExpired) as e: # noqa: BLE001
# OSError: proc already exited between kill and wait.
# TimeoutExpired: proc is stuck in kernel D-state; log and
# continue so remaining processes in _procs are still handled.
logger.warning("Could not kill pid=%d: %s", proc.pid, e)

def kill_all(self) -> None:
"""Kill all managed subprocesses."""
for proc in self._procs:
Expand Down
434 changes: 434 additions & 0 deletions src/inference_endpoint/commands/benchmark/accuracy.py

Large diffs are not rendered by default.

Loading
Loading