Perf on 2-vCPU HF: serial reassessment pin + slim combined-actions payload + Analyze-&-Suggest benchmark#185
Merged
marota merged 4 commits intoJul 6, 2026
Conversation
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>
356d5e4 to
c5e64e3
Compare
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
• 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