Repository navigation
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Compatibility checkout preparation blocks the async event loop, and the native GEAK skip leaves superseded handoff code reachable only through direct tests.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Routes AgentX measurements through pinned Magpie/InferenceX native launchers while preserving recipe topology, cache behavior, and measurement provenance.
Changes:
- Adds native AgentX configuration, runtime validation, topology-aware metrics, and resume state.
- Rejects unsupported optimization, GEAK, mutation, and sweep paths.
- Updates installation, profiling compatibility, tests, examples, and documentation.
| File | Description |
|---|---|
src/hyperloom/orchestrator/state/shared_state.py |
Persists AgentX pins and source config. |
src/hyperloom/orchestrator/phases/prelude.py |
Preserves pinned InferenceX checkout. |
src/hyperloom/orchestrator/phases/kernel.py |
Skips unsupported native GEAK execution. |
src/hyperloom/orchestrator/loop/writeback.py |
Persists AgentX GPU topology. |
src/hyperloom/orchestrator/kernel/request_handlers.py |
Rejects native mutation integration. |
src/hyperloom/orchestrator/kernel/conc_sweep.py |
Records AgentX GPU count. |
src/hyperloom/orchestrator/kernel/conc_sweep_plot.py |
Normalizes plots by recipe GPUs. |
src/hyperloom/orchestrator/actions/executors/tests/test_integrate_patch_executor.py |
Tests native integration rejection. |
src/hyperloom/orchestrator/actions/executors/profile.py |
Adds isolated compatibility profiling. |
src/hyperloom/orchestrator/actions/executors/integrate_patch.py |
Blocks native source mutations. |
src/hyperloom/orchestrator/actions/executors/baseline.py |
Adds native launch validation hooks. |
src/hyperloom/orchestrator/actions/executors/_recipe_script.py |
Resolves native server proxies. |
src/hyperloom/orchestrator/actions/executors/_ray_backend.py |
Forces AgentX local execution. |
src/hyperloom/orchestrator/actions/executors/_inferencex_patcher.py |
Limits patching to explicit checkouts. |
src/hyperloom/orchestrator/actions/executors/_grid_runner.py |
Validates native grid topology. |
src/hyperloom/orchestrator/actions/executors/_grid_base.py |
Adds GPU-count result metadata. |
src/hyperloom/orchestrator/actions/executors/_benchmark_runtime.py |
Preserves native launcher selection. |
src/hyperloom/orchestrator/actions/executors/_accuracy_gate.py |
Parses native request-error gates. |
src/hyperloom/inference_optimizer/tests/test_workload_envs.py |
Tests diagnostic profile materialization. |
src/hyperloom/inference_optimizer/tests/test_workload_envs_branches_unit.py |
Tests native configuration safeguards. |
src/hyperloom/inference_optimizer/tests/test_warm_replay.py |
Tests pinned checkout preservation. |
src/hyperloom/inference_optimizer/tests/test_shared_state_units.py |
Tests disabled AgentX warm replay. |
src/hyperloom/inference_optimizer/tests/test_run_optimize_exit_code_lock.py |
Strengthens CLI error assertions. |
src/hyperloom/inference_optimizer/tests/test_ray_backend_unit.py |
Tests local execution and GPU counts. |
src/hyperloom/inference_optimizer/tests/test_profile_and_kernel_handlers.py |
Tests isolated compatibility profiling. |
src/hyperloom/inference_optimizer/tests/test_map_aiperf.py |
Tests native accounting mapping. |
src/hyperloom/inference_optimizer/tests/test_kernel_integrate_and_report.py |
Tests measurement-only integration behavior. |
src/hyperloom/inference_optimizer/tests/test_install_magpie_idempotent.py |
Tests Magpie capability repair. |
src/hyperloom/inference_optimizer/tests/test_install_inferencex.py |
Tests checkout ownership preservation. |
src/hyperloom/inference_optimizer/tests/test_inferencex_preflight_clone.py |
Tests pinned checkout identity. |
src/hyperloom/inference_optimizer/tests/test_inferencex_patcher.py |
Tests isolated patch scope. |
src/hyperloom/inference_optimizer/tests/test_grid_runner.py |
Updates legacy timeout coverage. |
src/hyperloom/inference_optimizer/tests/test_graded_comparison.py |
Tests native grading guards. |
src/hyperloom/inference_optimizer/tests/test_geak_revalidation_dispatch.py |
Tests GEAK refusal and recovery. |
src/hyperloom/inference_optimizer/tests/test_geak_handoff_workload_contract.py |
Tests pre-handoff GEAK skipping. |
src/hyperloom/inference_optimizer/tests/test_geak_handoff_launch_server_script.py |
Tests native proxy resolution. |
src/hyperloom/inference_optimizer/tests/test_eval_result_dir_wiring.py |
Isolates native accuracy mapping. |
src/hyperloom/inference_optimizer/tests/test_env_safety.py |
Tests blocked AgentX identity overrides. |
src/hyperloom/inference_optimizer/tests/test_coordinator_gemm_promote_units.py |
Separates generic grading tests. |
src/hyperloom/inference_optimizer/tests/test_cli_conc_sweep_default.py |
Tests mode-dependent sweep defaults. |
src/hyperloom/inference_optimizer/tests/test_cli_bootstrap.py |
Tests source and pin snapshots. |
src/hyperloom/inference_optimizer/tests/test_baseline_param_overrides.py |
Tests unsupported native overrides. |
src/hyperloom/inference_optimizer/tests/test_backend_gating.py |
Tests immutable install behavior. |
src/hyperloom/inference_optimizer/tests/test_agentx_runtime.py |
Tests native launch-boundary validation. |
src/hyperloom/inference_optimizer/tests/test_agentx_repair.py |
Updates installer extraction coverage. |
src/hyperloom/inference_optimizer/tests/test_agentx_baseline_timeout.py |
Tests profile compatibility timeout. |
src/hyperloom/inference_optimizer/tests/test_accuracy_gate_units.py |
Tests native error thresholds. |
src/hyperloom/inference_optimizer/cli/parser.py |
Adds benchmark-config CLI semantics. |
src/hyperloom/inference_optimizer/cli/bootstrap.py |
Seeds native state and runtime pins. |
src/hyperloom/inference_optimizer/baseline_comparison/research_hints.py |
Uses physical recipe GPU count. |
src/hyperloom/inference_optimizer/assets/install.sh |
Pins and validates Magpie 0.3.0. |
src/hyperloom/inference_optimizer/assets/agentx/aiperf_client.sh |
Uses canonical AgentX model identity. |
src/hyperloom/inference_optimizer/agentx/mapping.py |
Maps native accounting fields. |
src/hyperloom/common/tests/test_perf_metric.py |
Tests per-chip throughput guards. |
src/hyperloom/common/perf_metric.py |
Adds topology-aware throughput helpers. |
src/hyperloom/common/gain_math.py |
Normalizes sweep guards per chip. |
src/hyperloom/common/env_safety.py |
Blocks recipe-identity candidate overrides. |
examples/hyperloom-agentx-glm-5.2-mi355x/README.md |
Documents the runnable GLM example. |
examples/hyperloom-agentx-glm-5.2-mi355x/benchmark.yaml |
Adds the native GLM recipe config. |
docs/release-notes.md |
Records native AgentX behavior. |
docs/reference/environment-variables.md |
Documents native controls and limits. |
docs/reference/authentication.md |
Documents dependency path ownership. |
docs/how-to/optimize.md |
Adds native AgentX instructions. |
docs/conceptual/optimization-loop.md |
Documents measurement-only phase behavior. |
docs/components/magpie.md |
Updates Magpie integration details. |
docs/compatibility.rst |
Records validated dependency pins. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
chaojhou
left a comment
There was a problem hiding this comment.
Blocker: several native-only refusals are gated on AgentX in general, so they also switch off optimization for legacy AgentX sessions.
Native mode is opt-in (benchmark.agentx: enable), and SKILL.md keeps HYPERLOOM_AGENTX as the supported legacy switch. Most of the PR scopes its limits correctly with native_agentx_enabled(bench["agentx"]) (preflight, grid runner, benchmark runtime, CLI). These do not:
kernel.py:1050isif agentx:, whereagentx = is_agentx_mode(benchmark_mode) if benchmark_mode else agentx_enabled()(:1011). The GEAK phase is skipped for every AgentX session, and the legacy AgentX GEAK branches (proposal proxies with canonical revalidation in Hyperloom) are deleted.integrate_patch.py:2350,request_handlers.py:4778,baseline.py:2366/:2445andwriteback.py:6190useagentx_active(...), which isHYPERLOOM_AGENTXorbenchmark_mode == "agentx", unchanged from main.
Their messages all say "Native AgentX cannot ...", but a legacy HYPERLOOM_AGENTX=1 session -- today's production AgentX path -- would lose GEAK, integrate_patch source/kernel mutations, kernel mutation benchmarks and runtime_override, leaving measurement plus explore. The description does not mention this.
Requested change: gate these on native mode (the same native_agentx_enabled check on the session's source/accepted config), or, if legacy AgentX is meant to lose these levers too, say so in the description and get that signed off.
Must-fix: no GPU run. This bumps Magpie for every session, including synthetic ones, drops the install-time compat patch step (the runtime equivalents in preflight and baseline remain), and adds the native path, but per the description no GPU workload was executed, and ci-e2e has not run on this branch. Before merge, please run at least one synthetic GPU E2E and the shipped GLM-5.2 native example, and post the results.
|
Review follow-up: legacy Both real BaselineExecutor GPU integration validations below passed on a newly allocated exclusive Crusoe 8×MI355X node. The full LLM optimizer E2E has not run: the operator's LLM credential configuration is unavailable. These baseline runs do not close that remaining E2E request, and no optimization gain is claimed.
The synthetic retry completed at 2026-09-29 04:03 UTC, with The first synthetic attempt completed throughput but failed GSM8K because Magpie changed the working directory after sourcing InferenceX by a relative path. Fixed upstream in Magpie #113, currently draft and unmerged, and pinned the immutable fix in this PR. The v0.3.0 tag remains unchanged. Only ten generic script source blocks changed; native AgentX and shared runner Python code are byte-identical. The new source/wheel execution manifest was independently audited, and the old native manifest remains accepted for resume. Native accounting caveats: the 3600-second sending window issued 990 requests; 989 completed, one tail request was cancelled, and there were zero recorded request errors. After the 30-second drain and a further 10-second cancellation-credit wait, AIPerf logged an ERROR and forced phase completion. This is not 990/990 completion. The 87 warmup records are excluded. All native schema/protocol, measurement, publishability, and submission-validity checks nevertheless passed. P50 TTFT/TPOT were 539.43/11.79 ms. The native table uses Magpie/InferenceX's 3606.24392-second completed-record span. AIPerf uses a 3640.00082-second phase window including drain, yielding 284.12549 output tokens/s for the same run. Server metrics emitted counter-reset warnings, so cache/MTP counter statistics are diagnostic. Both parsers report the nonfatal At current head Reproduction and evidence:
|
|
@haofrank #1800 and #1802, filed by @mohbasit from MiniMax-M3 runs on this branch, are gaps in the native AgentX profiling path this PR introduces. I checked both at
Fresh
|

Fresh
HYPERLOOM_AGENTX=1sessions use Magpie-managed AgentX through the existing Hyperloom CLI. Hyperloom keeps optimization, candidate grading and selection. Magpie manages the server lifecycle and optional trace capture; InferenceX/AIPerf replays and measures the workload. No Slurm integration is required.Fixes #1601.
What this enables
Compatibility and trace handling
AIPERF_*,AGENTIC_*,AGENTX_DATASET,AGENTX_WARMUP_REQUESTS_PER_LANEandWEKA_LOADER_OVERRIDEcontrols in the shell orbenchmark.envs, before dependency installation or benchmarking. Errors identify the variable names without printing their values. Use supportedbenchmark.agentxsettings and the resolved InferenceX recipe. Legacy and MLPerf controls remain available.Profiling
Hyperloom profiles an accepted configuration using Magpie's AgentX replay. The corresponding Magpie settings can request repeated captures:
Use the accepted workload's concurrency. The initial delay starts after warmup, and later intervals start after the previous trace finishes flushing. These are server execution steps, not request counts. Profile results are diagnostic; KEEP requires separate unprofiled canonical evidence. Rank-file inventory and selected-rank quality certificates remain distinct.
The example uses basic tracing. Enhanced shape/roofline analysis requires a compatible instrumented runtime and passing trace-quality checks.
Dependencies and validation
Hyperloom
d9bb74cpins merged Magpied80eb4dfrom #117, with its updated audited package fingerprint and InferenceX408c015. SGLang shape discovery is optional; per-batch graph trace export is preserved. Both InferenceX layouts are supported. The generic packaged throughput client has an isolated Python 3.12 / Transformers 5 runtime; native AgentX/AIPerf remains unchanged. The validation harness protects GSM8K's existing environment with framework constraints and version checks. Generic compatibility preparation leaves the audited Magpie package unchanged.At
40a143aa, main53ed5072is merged and the PR has no conflicts. All 12 Linux Python 3.10/3.11 test shards and both coverage checks pass. Lint, including all seven architecture contracts, also passes. The current-head single-GPU smoke E2E is still running.Remaining merge gates: PR hygiene counts 10,027 changed production Python lines against the 1,000-line limit; code-metrics retains complexity/size and two flag-argument findings. Repeated literals, cross-package private imports and stale baseline entries are cleared. No thresholds were relaxed; six improved baseline entries were lowered, and no exception labels have been added. These remaining gates require restructuring or a documented exception under the repository's review rules.
GPU baseline/candidate and trace capture previously passed on earlier revisions; the slower
--disable-cuda-graphcandidate was not promoted. Selected-rank trace quality reported blocked/warn, while other ranks received file-inventory checks. Full TraceLens/Roofline analysis has not run. Current-head native GPU, ordinary benchmark/GSM8K, and the full Coordinator/KEEP/GEAK GPU loop remain unverified. See detailed results and limitations.