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
The memory weights convert bytes into the same units as CPU-seconds with an assumed price ratio (~1e6, see CostWeights docs). That ratio is a guess, and it means the solver trades memory against CPU at an exchange rate nobody has calibrated.
sketch-bench PR #129 (rqe-optimizer) takes a different approach: it minimizes CPU only (ingest + query + merge) and treats memory as a hard constraint, adding a continuous variable M ≥ working-set(a,g) for every assignment and an optional M ≤ budget limit.
Proposal to explore
Remove the memory terms from the objective, i.e. CostWeights { ingest_mem: 0, query_mem: 0, .. } or remove the fields.
Add memory bounds as constraints instead. Candidates:
Total ingest memory: Σ_g u[g] · n_concurrent(g) · groups(g) · mem_bytes_per_instance ≤ max_ingest_memory_bytes. This is linear in u[g] and needs no extra variable; arguably the number an operator budgets for.
Decide where the budget(s) come from: asap-planner CLI flag vs. a ControllerConfig field.
Questions to answer
Does the CPU-only + memory-bound formulation give materially different plans from the weighted one on real workloads?
Which memory quantity (query working set, ingest/active, retained storage) should be bounded?
Should greedy follow the same change so the mip_cost ≤ greedy_cost test invariant still holds?
Context
The planned
mip_assign(cross-AQE sharing MILP, #650) minimizes the existing weighted objective fromoptimizer/cost_model.rs:The memory weights convert bytes into the same units as CPU-seconds with an assumed price ratio (~1e6, see
CostWeightsdocs). That ratio is a guess, and it means the solver trades memory against CPU at an exchange rate nobody has calibrated.sketch-bench PR #129 (
rqe-optimizer) takes a different approach: it minimizes CPU only (ingest + query + merge) and treats memory as a hard constraint, adding a continuous variableM ≥ working-set(a,g)for every assignment and an optionalM ≤ budgetlimit.Proposal to explore
CostWeights { ingest_mem: 0, query_mem: 0, .. }or remove the fields.M ≥ groups × n_windows × mem_bytes_per_instancefor every selected (a,g);M ≤ max_query_memory_bytes.Σ_g u[g] · n_concurrent(g) · groups(g) · mem_bytes_per_instance ≤ max_ingest_memory_bytes. This is linear inu[g]and needs no extra variable; arguably the number an operator budgets for.asap-plannerCLI flag vs. aControllerConfigfield.Questions to answer
mip_cost ≤ greedy_costtest invariant still holds?References
rqe-optimizer/src/milp.rs(MilpBounds, peak-memory variable).design_docs/optimizer-mip-formulation.mdasap-planner-rs/src/optimizer/cost_model.rs🤖 Generated with Claude Code