Skip to content

Feature/sciot 042 proper evaluation output#43

Open
lbedogni wants to merge 3 commits into
mainfrom
feature/sciot-042-proper-evaluation-output
Open

Feature/sciot 042 proper evaluation output#43
lbedogni wants to merge 3 commits into
mainfrom
feature/sciot-042-proper-evaluation-output

Conversation

@lbedogni

@lbedogni lbedogni commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Luca Bedogni added 2 commits July 5, 2026 20:59
Implements a proper structured evaluation output for server inference cycles.
Each inference cycle produces one JSONL row with all analysis-ready metrics.

Key changes:
- New src/sciot/evaluation.py with inference-cycle.v1 schema
- Structured fields: timing, network, device_layers, edge_layers,
  offloading_decision, layer_sizes_bytes
- Replaces the old flat evaluation CSV write with structured JSONL
- Versioned schema (inference-cycle.v1) for future compatibility
- File rotation with configurable max bytes and backups
- Summary frame for flat-table analysis
- 7 unit tests covering event building, append/read, rotation, and summary

Data per inference cycle:
- Timing: acquire, device compute, edge compute, network, total
- Network: avg speed, payload size, NTP latency
- Device/edge layers: per-layer times, EMA times, count, total
- Offloading decision: selected layer, reason, candidates count, estimated cost
- Layer sizes for model reference

All unit tests pass (49 passed, 0 failed).
The structured evaluation JSONL file now includes the server start timestamp
in its name (format: inference_cycles_YYYYMMDD_HHMMSS.jsonl) so different
server runs are easily distinguishable.

- EvaluationFiles.structured_evaluations_file_path() now returns path with timestamp
- RequestHandler.__init__() sets the server start timestamp on first instantiation
- All unit tests pass (49 tests total)
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 26.66667% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/server/communication/request_handler.py 26.66% 11 Missing ⚠️
Flag Coverage Δ
fast-tests 26.82% <26.66%> (+0.64%) ⬆️
http-integration 10.75% <ø> (-0.30%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/server/communication/request_handler.py 35.47% <26.66%> (-0.18%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…d toggles

Replace the single-file + size-rotation scheme (which discarded old data) for
both the structured-evaluation and offloading-decision JSONL outputs with
never-deleted segment files. A new segment is opened at the first tripped
criterion (evaluation.split.max_rows or evaluation.split.interval_minutes) via a
shared segment writer reused by both modules.

- Add evaluation.split (rows/time) and evaluation.outputs (per-output
  enable/disable) config, validated in config.py, with example in server.full.yaml.
- Skip event build + enqueue entirely for disabled outputs, so there is no cost.
- Normalize device_layers_inference_time (a numpy array) via _to_float_list:
  the previous `array or []` raised "truth value of an array is ambiguous" and
  aborted the inference-cycle write before it was enqueued. Also log the endpoint
  ValueError and background I/O failures with tracebacks so such write failures
  are no longer swallowed.
- Read across all segments in the dashboard and via run_segment_paths /
  iter_run_offloading_decisions / iter_run_evaluations helpers.
- Update CONFIGURATION.md and OFFLOADING_DECISION_EVENTS.md.
- Add tests for splitting, per-output toggles, config validation, and the
  numpy-normalization fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants