Repository navigation
feat(agentx): plan from reviewed recipe files, add vLLM and per-framework runs - #208
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical validation and comparison defects can mislabel concurrency, mix incompatible traces or settings, and admit fast-mode runs as formal baselines.
7 open issues
Filter curve comparisons to common trace identities · New Use matched points for point comparisons · New Reject fast mode in recipe points · New Require client concurrency to match the planned point · New Verify the loader repository matches the declared trace · New Include the complete baseline frontier in curve comparisons · New Validate required runtime and DRAM fields during planning · New
What changed in this PR
This PR makes AgentX CI plan runs from reviewed, pinned recipe files rather than resolving upstream recipes during execution. Each run is scoped to one model, hardware target, and serving framework.
Changes:
- Adds recipe validation and sealed selections, replacing runtime recipe resolution.
- Adds vLLM support, framework-specific paths, and PR model selection through
AgentX:. - Updates frontier comparisons, baseline reporting, tests, and usage documentation.
| File | Description |
|---|---|
tests/benchmarks/test_agentx_sweep.py |
Tests sealed plans and the Bash container entrypoint. |
tests/benchmarks/test_agentx_report.py |
Updates report fixtures for framework identities and selections. |
tests/benchmarks/test_agentx_metrics.py |
Tests GPU counts and framework-scoped metric reporting. |
tests/benchmarks/test_agentx_environment.py |
Tests vLLM switches and framework validation. |
tests/benchmarks/test_agentx_comparisons.py |
Covers curve comparisons and execution identity changes. |
tests/benchmarks/test_agentx_baselines.py |
Updates baseline tests for sealed selections and schema migration. |
tests/benchmarks/test_agentx_archives.py |
Updates archive tests for framework-specific paths. |
scripts/agentx/install_aklr.sh |
Checks the selected framework’s plugin entry point. |
benchmarks/agentx/recipes/serving.schema.json |
Defines the reviewed recipe contract. |
benchmarks/agentx/recipes/MiniMax/mi355x/vllm/serving.minimaxm31flash-fp4.json |
Adds six MiniMax vLLM recipe points. |
benchmarks/agentx/recipes/GLM/mi355x/sglang/serving.glm52-fp8.json |
Adds four GLM FP8 SGLang recipe points. |
benchmarks/agentx/README.zh.md |
Updates Chinese configuration and workflow guidance. |
benchmarks/agentx/README.md |
Documents recipe-based, per-framework runs. |
benchmarks/agentx/agentx.yaml |
Adds framework configuration and model definitions. |
benchmarks/agentx/agentx_ci/utils.py |
Adds framework identities, paths, and schema-4 result metadata. |
benchmarks/agentx/agentx_ci/sweep.py |
Removes obsolete runtime selection options. |
benchmarks/agentx/agentx_ci/serving_config.py |
Validates recipes and builds sealed serving plans. |
benchmarks/agentx/agentx_ci/runtime.py |
Executes framework-specific runs and checks reported GPU counts. |
benchmarks/agentx/agentx_ci/report.py |
Renders curve comparisons and framework-aware reports. |
benchmarks/agentx/agentx_ci/report_all.py |
Manages framework-specific reports and Pareto baselines. |
benchmarks/agentx/agentx_ci/preflight.py |
Includes framework and client source in comparison identities. |
benchmarks/agentx/agentx_ci/pr_scope.py |
Parses model selections from PR descriptions. |
benchmarks/agentx/agentx_ci/plan.py |
Loads reviewed recipes and applies PR scope. |
benchmarks/agentx/agentx_ci/pipeline.py |
Supports one model/target/framework local run. |
benchmarks/agentx/agentx_ci/performance_analysis.py |
Adds frontier comparisons alongside matched-point comparisons. |
benchmarks/agentx/agentx_ci/model_config.py |
Selects frameworks and merges their settings. |
benchmarks/agentx/agentx_ci/inferencex_points.py |
Removes runtime upstream point binding. |
benchmarks/agentx/agentx_ci/inferencex_client.py |
Separates pinned client checkout fetching. |
benchmarks/agentx/agentx_ci/docker_launch.py |
Uses Bash entrypoints and framework-aware result identities. |
benchmarks/agentx/agentx_ci/__main__.py |
Removes the resolve command. |
.github/workflows/agentx-ci.yaml |
Adds framework inputs, PR scope, and scoped sweep paths. |
.github/pull_request_template.md |
Adds the AgentX: model-selection declaration. |
Review effort: Max
| "baseline_aklr_sha": baseline["run"]["aklr_sha"], | ||
| "arms": arms, | ||
| "notes": notes, | ||
| "combined": compare_curve(verified(current), verified(baseline), curve_reason or "combined frontier"), |
There was a problem hiding this comment.
Fixed in 617d33d. compare_curve now keeps only points on trace identities present on both sides before building either frontier, so a point from another trace revision cannot enter the per-arm or combined curve. The chart draws the baseline frontier returned by that comparison. Test: test_curves_compare_only_shared_traces.
| "baseline_aklr_sha": baseline["run"]["aklr_sha"], | ||
| "arms": arms, | ||
| "notes": notes, | ||
| "combined": compare_curve(verified(current), verified(baseline), curve_reason or "combined frontier"), |
There was a problem hiding this comment.
Fixed in 617d33d. Without a run-level change, the combined frontier is built from the same inputs as each arm: matched point pairs for a point-compared arm, verified points for a curve arm. A point with changed duration, trace or environment no longer enters it. Test: test_changed_points_stay_out_of_the_combined_frontier (the combined ratio was ~1000x before, while the arm was 3x).
| spec["selection"] = sc.narrow_selection(spec["selection"], points, duration) | ||
| item["image"] = spec["image"]["run"] | ||
| write_json(args.out / target_path(*run) / "serving.json", spec) | ||
| selected_points = sc.selected_points(spec) |
There was a problem hiding this comment.
Fixed in 617d33d. Planning now requires client_env.AIPERF_EXPERIMENTAL_FAST to be "0", and the schema has it as const "0", so a fast-mode point cannot be resolved or become a baseline. Covered in test_invalid_recipes_are_rejected.
| ) | ||
| leaked = sorted(set(RUN_CLIENT_ENV) & set(point["client_env"])) | ||
| _expect(not leaked, f"point {label} client_env contains plan-owned keys: {leaked}") | ||
| _check_topology(label, point["client_env"], point["gpus"]) |
There was a problem hiding this comment.
Fixed in 617d33d. Planning now requires client_env.CONC == str(conc) (also required in the schema), so the measured concurrency always matches the label. Covered in test_invalid_recipes_are_rejected.
| point["client_env"] = dict( | ||
| sorted({**point["client_env"], "WEKA_LOADER_OVERRIDE": trace["loader"]}.items()) | ||
| ) | ||
| point["trace"] = copy.deepcopy(trace) |
There was a problem hiding this comment.
Fixed in 617d33d. Before preparing traces, sweep runs the pinned client's traces.resolve for each point's loader and requires the resolved dataset to equal trace.repo. An unknown loader or a mismatch fails before any download or replay. Test: test_trace_loaders_must_replay_the_recorded_trace_dataset.
| for arm, view in comparison["arms"].items(): | ||
| if is_curve(view): | ||
| previous_points += verified(baseline, arm) if baseline is not None else [] |
There was a problem hiding this comment.
Fixed in 617d33d. With a run-level curve reason, method is curve whatever the arm names are, and the combined comparison uses every verified point on both sides. The chart draws the previous frontier from combined.baseline_frontier, so it stays when arms are removed or renamed. Test: test_renamed_arms_under_a_run_level_change_keep_the_previous_frontier.
| leaked = sorted(set(RUN_CLIENT_ENV) & set(point["client_env"])) | ||
| _expect(not leaked, f"point {label} client_env contains plan-owned keys: {leaked}") | ||
| _check_topology(label, point["client_env"], point["gpus"]) | ||
| _expect(isinstance(point.get("runtime"), dict), f"point {label} needs runtime settings") |
There was a problem hiding this comment.
Fixed in 617d33d. Planning (check_point_runtime) now requires runtime.port (null or a TCP port), finite positive ready_timeout_s, point_timeout_s and poll_s, and a digit client_env.TOTAL_CPU_DRAM_GB. Sweep repeats the same check, and recipes/serving.schema.json requires the same fields. Covered in test_invalid_recipes_are_rejected.
a28275a to
617d33d
Compare
…work runs Each AgentX run is one model, target and serving framework, planned from a reviewed recipes/<family>/<target>/<framework>/serving.<model>.json (schema 4, checked by recipes/serving.schema.json) instead of resolving InferenceX recipes at run time. plan adds the agentx.yaml identity, device env, trace, arms, hashes and a sealed selection, and checks topology, exp_name, FRAMEWORK and the recipe source; recipe_resolve.py is removed. vLLM runs set AKLR_VLLM_PLUGIN, install checks the vllm.general_plugins entry point and the container starts through bash. Recipe files cover glm52-fp4 and glm52-fp8 (SGLang) and minimaxm31flash-fp4 (vLLM) on MI355X. ci:agentx-mi355x runs only the models on the PR description's AgentX: line and is skipped without one. Week-over-week comparison falls back to Pareto frontiers over the shared interactivity range when the selection, image or dependencies change; other hardware, client or trace leaves no baseline. Results must report the planned num_gpus.
…tarts The SGLang image pins Rust 1.92 in rust/rust-toolchain.toml but does not ship it, so the first server in a sweep container makes every TP rank run rustup's auto-install at once. The installs collide: in the glm52-fp8 run 43564140956, seven ranks fell back to the Python TreeCore and TP5 built the extension for 58 s. TP5 then sized its HiCache host pool after its peers had pinned theirs; SGLang divides the remaining host memory by the rank count, so it saw 186 GB for a 219.55 GB pool and the tp8 c16 dram-hicache point failed to start. install_aklr.sh now installs the toolchain and builds the TreeCore extension in one process for SGLang runs, so every rank loads the cached build. A failed warmup only warns: the ranks then resolve the toolchain themselves, as before.
…rt page Frontiers are drawn as d3.curveMonotoneX paths, as on the InferenceX dashboard, instead of polylines. The points chosen were already the same. The report no longer lists observed GPUs. Its "Week over week" and "AKLR changes since the previous run" sections are hidden for now behind SHOW_BASELINE_SECTIONS; the comparison and history are still computed and written to report.json. English and Chinese pages and READMEs change together.
The point is upstream's override_tp8_c2 at the recipe's pinned InferenceX commit 8f29d8d: the tp8 no-offload settings with admission and the decode graph batch at 4. Its recipe_fingerprint is the one InferenceX publishes for glm5.2_tp8_conc2_kvnone_spec-mtp.
Each series is now a d3.curveMonotoneX path through all of its successful points in interactivity order, instead of only its Pareto frontier. The combined frontier line and the "Show non-Pareto points" toggle go away, and the chart titles no longer say Pareto. The previous-run overlay and the frontiers in report.json are unchanged.
HiCache servers release GPU memory some time after their process group is gone, so the next point could start while the cards were still occupied. Before each server starts, sweep now polls amd-smi every 5 s until every GPU reads 0% VRAM use, in whole percent as rocm-smi reports it. After 300 s, or if amd-smi cannot be read, it aborts the sweep as a cleanup failure, naming the busy GPUs. The wait does not count against the point's timeout.
595e554 to
7023aba
Compare
…mmit Recipes now hold only schema, source and points; plan fills in the rest: - image.run: plan reads the framework's CI image from ci.yaml (AKLR_CI_IMAGE for sglang, new AKLR_VLLM_CI_IMAGE for vllm) and pins its current digest with docker buildx imagetools inspect. - client and trace: fixed by maintainers in serving.schema.json $defs. - source: only kind plus config_key (inferencex) or url (cookbook). - points: no recipe_fingerprint; exp_name is generated as <model>-<arm>-c<conc>, so arms must be safe path components. Unknown point keys are rejected. The report no longer shows the recipe's upstream image. Add the agentx-recipes pre-commit hook (agentx_bench check-recipes): when recipes/ or agentx.yaml change, check every recipe against the schema, agentx.yaml and plan's rules, without Docker or a registry. Co-authored-by: Cursor <[email protected]>


Why
AgentX CI resolved InferenceX recipes and chose Pareto points while the run was going, so upstream changes could alter what a run measured, and only SGLang could run. Now each run is one model, target and serving framework, and it reads a reviewed recipe file kept in the repo. vLLM is supported, and a PR's
AgentX:line picks which models it runs.Scope
benchmarks/agentx/recipes/<family>/<target>/<framework>/serving.<model>.json, which must followrecipes/serving.schema.json(schema 4). Three files are added, using the points on InferenceX8f29d8dc's measured Pareto frontier:glm52-fp4/mi355x/sglang: 10 pointsglm52-fp8/mi355x/sglang: 4 pointsminimaxm31flash-fp4/mi355x/vllm: 6 pointsplanloads the recipe file and adds the identity fromagentx.yaml, plus the device env, trace, arms, hashes and a sealed selection.gpus, thatexp_nameis unique and is a single path component, thatclient_env.FRAMEWORKmatches, and that the recipe'ssourcematchesrecipe_sourceinagentx.yaml.runtime(port, positiveready_timeout_s,point_timeout_s,poll_s),client_env.CONCequal toconc, a digitTOTAL_CPU_DRAM_GB, andAIPERF_EXPERIMENTAL_FASTset to"0". Sweep repeats the runtime check and, before downloading traces, checks that the pinned client'strace.loaderresolves totrace.repo.recipe_resolve.py(the run-time resolver) andinferencex_points.pyare removed. The InferenceX client checkout moves toinferencex_client.py.resolvecommand and these options are removed:--inferencex-ref,--run-image,--arms,--point-policyand--work.agentx.yamladds aframeworks:level under each target. Workflow, pipeline and output paths gain aframeworks/<framework>segment.AKLR_SGLANG_PLUGINorAKLR_VLLM_PLUGINfor the framework being run.install_aklr.shchecks the matching plugin entry point.--entrypoint bash, because vLLM images setvllm serveas their entrypoint.ci:agentx-mi355xruns only the models on the PR description'sAgentX:line. Ids are matched without case;allmust be the only name.num_gpus.Tradeoffs
image.runis pinned per recipe and can differ from the image the upstream measured with (image.recipe, recorded for reference only). For example,glm52-fp8runs on SGLang v0.5.22 while upstream measured on v0.5.19.Verification
Environment: head
617d33d8onf44b4d88, CPU only, Python 3.12.3, pytest 9.2.0, ruff 0.15.12Gate overrides: none
Code
pytest tests/benchmarks -k agentx --confcutdir=tests/benchmarks: 127 passed, 187 subtests passed.ruff checkandruff format --checkpass onbenchmarks/agentxandtests/benchmarks.bash -n scripts/agentx/install_aklr.shpasses.python -m agentx_bench planwith the default config: all three runs areresolved, with 10, 4 and 6 points.exp_name, source cross-check, frameworkAgentX:parsingclient_envchecks, and the trace loader checknum_gpuscheckaklr/corechange, and no schema or measurement version change.Not run
ci:agentx-mi355xrun on this head, so neither the vLLM launch path nor theglm52-fp8and MiniMax recipes have run end to end here.Risk
Affects: AgentX CI only (plan, sweep, report, Pages site); no kernels or plugin routes
AgentX: all
If wrong:
AgentX:line.Undo:
git revert. Baselines published under schema 4 stay on the site, and the reverted code starts fresh baselines again.