Skip to content

Perf on 2-vCPU HF: serial reassessment pin + slim combined-actions payload + Analyze-&-Suggest benchmark#185

Merged
marota merged 4 commits into
ainetus:mainfrom
marota:claude/co-study4grid-perf-benchmark-s1u2xr
Jul 6, 2026
Merged

Perf on 2-vCPU HF: serial reassessment pin + slim combined-actions payload + Analyze-&-Suggest benchmark#185
marota merged 4 commits into
ainetus:mainfrom
marota:claude/co-study4grid-perf-benchmark-s1u2xr

Conversation

@marota

@marota marota commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

• Pin per-action reassessment to serial on the HuggingFace 2-vCPU Space (EXPERT_OP4GRID_REASSESSMENT_PARALLEL=0 in the Dockerfile) — parallel over-subscribed the 2 vCPUs (was 15 actions on 10/16 cores, 48.5s).
• Slim the combined-actions payload at the API boundary (services/analysis/combined_pairs.py): empty the unused p_or_combined/p_ex_combined full-grid arrays before serialization — payload 29 MB → 267 KB, sanitize 2.57s → 0.01s, "Other (network/streaming)" 3.8s → 0.5s.
• Surface reassessment_parallelism in the step-2 result event.
• New benchmarks/bench_analyze_suggest.py (config → step1 → step2 via TestClient, "Other" decomposition, --tier/--study/--serial/--compare) + benchmarks/README.md + docs/performance/history/analyze-suggest-2vcpu.md.
• Test: expert_backend/tests/test_combined_actions_payload_slim.py; CHANGELOG.

Claude-Session: https://claude.ai/code/session_01XTEMAv3usezBpo2bm2L8qu

Antoine Marot and others added 2 commits July 6, 2026 14:23
Analyze & Suggest on the reported first scenario (eu-pyrenees, LANNEL61PRAGN on
the European grid) regressed to ~75s. Two fixes, measured with the new
benchmarks/bench_analyze_suggest.py (drives /api/config -> step1 -> step2 via
TestClient and decomposes the UI's "Other (network / streaming)" bucket):

- Payload: each combined-action pair shipped p_or_combined / p_ex_combined —
  full per-line arrays (one float per grid line x ~100 pairs ~= 29 MB on the
  European grid) the frontend never reads (CombinedAction uses only betas /
  max_rho / rho_before / rho_after; session-reload rebuilds them as []). New
  services/analysis/combined_pairs.slim_combined_actions_for_payload() empties
  them at the step-2 API boundary: payload 29 269 KiB -> 267 KiB, sanitize
  2.57s -> 0.01s, "Other" 3.80s -> 0.51s.
- Reassessment: Dockerfile pins EXPERT_OP4GRID_REASSESSMENT_PARALLEL=0 (the
  library's new container-aware detection also picks serial on 2 vCPUs).
- Step-2 result event now carries reassessment_parallelism so a client can
  confirm serial vs parallel.

New benchmark + docs/performance/history/analyze-suggest-2vcpu.md.
Covered by expert_backend/tests/test_combined_actions_payload_slim.py.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XTEMAv3usezBpo2bm2L8qu
Signed-off-by: Antoine Marot <amarot91@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XTEMAv3usezBpo2bm2L8qu
Signed-off-by: Antoine Marot <amarot91@gmail.com>
@marota marota force-pushed the claude/co-study4grid-perf-benchmark-s1u2xr branch from 356d5e4 to c5e64e3 Compare July 6, 2026 14:23
Antoine Marot and others added 2 commits July 6, 2026 15:20
…section

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XTEMAv3usezBpo2bm2L8qu
Signed-off-by: Antoine Marot <amarot91@gmail.com>
Bring marota/Co-Study4Grid up to date with ainetus/main (PR ainetus#184, the Co-Study
side of the recommender R3/R4 refactor — a conftest mock-list addition). Clean
auto-merge, no conflicts, so the PR into ainetus/main is conflict-free.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XTEMAv3usezBpo2bm2L8qu
Signed-off-by: Antoine Marot <amarot91@gmail.com>
@marota marota merged commit b4d3cf1 into ainetus:main Jul 6, 2026
11 checks passed
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.

1 participant