Skip to content

feat(planner): asap-planner --planner saved writes a sketch-bench eval plan without re-solving - #828

Open
milindsrivastava1997 wants to merge 1 commit into
mainfrom
824-planner-saved
Open

milindsrivastava1997 wants to merge 1 commit into
mainfrom
824-planner-saved

Conversation

@milindsrivastava1997

Copy link
Copy Markdown
Contributor

Before this PR

The only way to get streaming and inference configs from an rqe-optimizer plan was --planner milp, which solves the plan itself. The #777 eval's plans were solved in sketch-bench (autosketch_vs_asap, saved in sketch-bench#203), and re-solving gives a different plan: a different solver objective, accuracy source and arrival rates. experiment_run_e2e.py also always runs the planner.

After this PR

B1 + B2: asap-planner --planner saved

asap-planner --planner saved --streaming_engine precompute --data-ingestion-interval-ms 1000 \
  --plan <sketch-bench>/rqe-optimizer/results/autosketch-vs-asap-hydra/plans/synthetic-templatesclassic-shared1.plans.json.gz \
  --workload-table <sketch-bench>/rqe-optimizer/results/autosketch-vs-asap-hydra/inputs/tables/synthetic-templatesclassic-shared1.json \
  --method asap --weights cpu [--sla-ms 1000] --output_dir DIR
  • The table's e2e block (sketch-bench#208) becomes a ControllerConfig: one query group per interval, with metrics hints from its labels. workload_from_config (the facts-free half of build_milp_workload) turns it into Raqes.
  • Each leaf query maps to its plan RQE through e2e.queries[].rqes, and the RQE to its chosen deployment, sketch, params, window and slide. The result goes through deployments_to_planner_output, the existing converter with MilpSolution replaced by (deployments, Raqe → deployment). plan_to_planner_output is now a thin wrapper around it, so --planner milp output is unchanged.
  • Without --sla-ms it picks the cheapest plan, and with it the sla plan at that SLA. A .gz plan file is read directly (flate2).
  • It refuses:
    • roll-ups (deployment_grouping)
    • an RQE the plan doesn't serve
    • a plan deployment whose RQEs would need different sketches
    • one query served by two deployments (the existing check, which also covers the same PromQL at two intervals on different deployments)
    • any shape the engine can't serve (the existing pattern check)

B3: controller.prebuilt_output_dir in experiment_run_e2e.py skips controller_service.start and syncs that directory's streaming_config.yaml and inference_config.yaml to the controller output dir. It checks that both files exist at startup.

Departures from the #824 plan:

  • B1 passes deployments instead of building a MilpSolution, because PlanCost can't be built honestly from a saved plan.
  • B2 takes --sla-ms instead of --kind, because the file has one SLA plan per SLA.

Blocked: 12 classic queries (#827)

On the real classic base table (ASAP cheapest at CPU weights), 12 of the 54 queries are shapes ASAPQuery can't serve: sum by (job) (rate(...)) and topk(32, sum by (label_0) (...)) over rate and sum_over_time. So --planner saved refuses the table:

Error: cannot optimize leaf 'topk(32, sum by (label_0) (sum_over_time(data[15m])))' ...: no supported query pattern matched

With those 12 removed from a copy of the table, it writes 5 aggregations. Their windows, slides and params match the plan: dd 0.02 1s; dd 0.05 300s/60s sliding; exact-increase 60s; exact-sum 1s and 60s. The other 3 plan deployments serve the removed queries. #827 tracks engine support, and the e2e run waits on it.

Validation

  • cargo test -p asap_planner: all pass, including 5 new tests in saved_plan.rs. They cover:
    • a ratio whose legs share one sliding DDSketch
    • --sla-ms selection, plus no matching plan
    • roll-up refusal
    • one deployment needing two sketches (this test caught leaves that merge into one item, such as p90 and p50, not being checked)
    • an RQE missing from the plan
  • cargo clippy --all-targets -D warnings, cargo fmt, black, flake8: clean.
  • The CLI ran on sketch-bench's committed plan file: the refusal above, the 42-query conversion, and --sla-ms 1000.
  • B3: the copy-and-sync path was run on its own with a local provider. A full e2e run waits on feat(planner): serve the #777 eval's sum-of-rate and nested topk queries #827 and B4.

Part of #824 (B1, B2, B3).

🤖 Generated with Claude Code

…l plan without re-solving

Reads a plan from sketch-bench's autosketch_vs_asap plan file and the eval
table's `e2e` block (PromQL queries, the plan RQEs each reads, metric
labels), and writes streaming and inference YAML through the same
converter as --planner milp. experiment_run_e2e.py gains
controller.prebuilt_output_dir to deploy those configs instead of running
the planner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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