Skip to content

feat(agentx): plan from reviewed recipe files, add vLLM and per-framework runs - #208

Merged
zhenhuang12 merged 7 commits into
mainfrom
feat/agentx-vllm-musespark
Nov 17, 2026
Merged

zhenhuang12 merged 7 commits into
mainfrom
feat/agentx-vllm-musespark

Conversation

@RuibinCheung

@RuibinCheung RuibinCheung commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Recipe files: each run reads benchmarks/agentx/recipes/<family>/<target>/<framework>/serving.<model>.json, which must follow recipes/serving.schema.json (schema 4). Three files are added, using the points on InferenceX 8f29d8dc's measured Pareto frontier:
    • glm52-fp4/mi355x/sglang: 10 points
    • glm52-fp8/mi355x/sglang: 4 points
    • minimaxm31flash-fp4/mi355x/vllm: 6 points
  • Plan:
    • plan loads the recipe file and adds the identity from agentx.yaml, plus the device env, trace, arms, hashes and a sealed selection.
    • It checks each point's TP×PP×PCP against gpus, that exp_name is unique and is a single path component, that client_env.FRAMEWORK matches, and that the recipe's source matches recipe_source in agentx.yaml.
    • It also checks the settings sweep needs: a complete runtime (port, positive ready_timeout_s, point_timeout_s, poll_s), client_env.CONC equal to conc, a digit TOTAL_CPU_DRAM_GB, and AIPERF_EXPERIMENTAL_FAST set to "0". Sweep repeats the runtime check and, before downloading traces, checks that the pinned client's trace.loader resolves to trace.repo.
    • recipe_resolve.py (the run-time resolver) and inferencex_points.py are removed. The InferenceX client checkout moves to inferencex_client.py.
    • The resolve command and these options are removed: --inferencex-ref, --run-image, --arms, --point-policy and --work.
  • vLLM:
    • agentx.yaml adds a frameworks: level under each target. Workflow, pipeline and output paths gain a frameworks/<framework> segment.
    • The executor sets AKLR_SGLANG_PLUGIN or AKLR_VLLM_PLUGIN for the framework being run.
    • install_aklr.sh checks the matching plugin entry point.
    • The container starts with --entrypoint bash, because vLLM images set vllm serve as their entrypoint.
  • PR scope:
    • ci:agentx-mi355x runs only the models on the PR description's AgentX: line. Ids are matched without case; all must be the only name.
    • With no usable line, the run is skipped and the check stays green, with a warning annotation. The PR template gains the line.
  • Comparison:
    • When the selection and execution are unchanged, results are still compared point by point.
    • If the selection, image or dependencies changed, the Pareto frontiers are compared over their shared interactivity range instead, using only verified points on shared traces.
    • The combined frontier uses the same points as the per-arm comparisons, so a point with changed settings does not enter it. The chart draws the previous frontier from that comparison, so it stays even when every arm is renamed.
    • If the hardware, the AgentX client or the trace changed, there is no baseline.
    • Results must report the planned num_gpus.
  • Not covered here: the recipe module that generates the recipe files is outside this PR. Recipe files are produced with it and come in through reviewed PRs.

Tradeoffs

  • Run image differs from upstream: image.run is pinned per recipe and can differ from the image the upstream measured with (image.recipe, recorded for reference only). For example, glm52-fp8 runs on SGLang v0.5.22 while upstream measured on v0.5.19.
  • Upstream changes need a recipe PR: an upstream change no longer reaches CI by itself. Someone has to regenerate the recipe file and get it reviewed. That is intended: the same recipe file always yields the same plan.

Verification

Environment: head 617d33d8 on f44b4d88, CPU only, Python 3.12.3, pytest 9.2.0, ruff 0.15.12
Gate overrides: none

Code

  • pytest tests/benchmarks -k agentx --confcutdir=tests/benchmarks: 127 passed, 187 subtests passed.
  • ruff check and ruff format --check pass on benchmarks/agentx and tests/benchmarks. bash -n scripts/agentx/install_aklr.sh passes.
  • python -m agentx_bench plan with the default config: all three runs are resolved, with 10, 4 and 6 points.
  • New and updated tests cover:
    • recipe checks: schema, topology, exp_name, source cross-check, framework
    • AgentX: parsing
    • framework-scoped paths and identities
    • curve comparison: shared traces only, combined frontier inputs, renamed arms
    • runtime and client_env checks, and the trace loader check
    • the num_gpus check
  • No aklr/core change, and no schema or measurement version change.

Not run

  • No GPU sweep or ci:agentx-mi355x run on this head, so neither the vLLM launch path nor the glm52-fp8 and 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:

  • A run fails at plan or sweep, or a PR run is skipped or narrowed by its AgentX: line.
  • The site manifest moves to schema 4, so the first report after merge starts fresh baselines and has no week-over-week comparison.
    Undo: git revert. Baselines published under schema 4 stay on the site, and the reverted code starts fresh baselines again.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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
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"),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"])

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +216 to +219
point["client_env"] = dict(
sorted({**point["client_env"], "WEKA_LOADER_OVERRIDE": trace["loader"]}.items())
)
point["trace"] = copy.deepcopy(trace)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread benchmarks/agentx/agentx_ci/report.py Outdated
Comment on lines +297 to +299
for arm, view in comparison["arms"].items():
if is_curve(view):
previous_points += verified(baseline, arm) if baseline is not None else []

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

…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.
@RuibinCheung RuibinCheung removed the ci:agentx-mi355x Run AgentX sweeps on the MI355X runner label Nov 16, 2026
@RuibinCheung
RuibinCheung force-pushed the feat/agentx-vllm-musespark branch from 595e554 to 7023aba Compare November 16, 2026 06:08
@RuibinCheung RuibinCheung added the ci:agentx-mi355x Run AgentX sweeps on the MI355X runner label Nov 16, 2026
…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]>
@zhenhuang12
zhenhuang12 merged commit dd88ae1 into main Nov 17, 2026
15 of 18 checks passed

This branch was previously deployed

1 inactive deployment
gpu-trusted — 5fc3d044 Deployed Nov 16, 2026 by RuibinCheung via prepare-gpu / prepare #903
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:agentx-mi355x Run AgentX sweeps on the MI355X runner ci:gpu

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants