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:
|
|
Hyperloom-to-Magpie benchmark integration and repeated trace capture have been exercised on real GPUs.
GPU results above are from Magpie Profiling validates capture only: selected-rank quality checks reported blocked / warn; other ranks received file-inventory checks. Full TraceLens/Roofline analysis has not run, and profiled results cannot supply KEEP evidence. Latest-head native GPU and ordinary benchmark/GSM8K validation remain incomplete, as does the full Hyperloom optimization loop (Coordinator/KEEP/GEAK). |
Adapt native AgentX promotion and GEAK revalidation to explicit orchestration collaborators, preserving launch identity, grading and rollback behavior. Update regression fixtures for main's state and grading contracts.
|
Merged main ( Validation: 3,048 regression tests passed, 10 skipped; repository-wide Ruff lint/format and shell syntax checks passed. Installer tests did not pass in the local macOS environment; Linux CI is pending. GPU tests were not rerun. The PR remains Draft. |
| envs.pop(str(k), None) | ||
| for k, v in variant.extra_envs.items(): | ||
| envs[str(k)] = str(v) | ||
| from ._workload_envs import pin_mlperf_round_concurrency |
|
Hi @haofrank I was testing this PR using GLM 5.2 with AgentX to validate the end-to-end Hyperloom optimization flow. I have encountered an issue at the profiling stage. The profiling failed due to shape_discovery check. The check requires SGLang's profiler to support shape_discovery, including those inside CUDA graphs. SGLang 0.5.20 doesn't have that option, so Magpie refuses to profile at all. I tried to fix it, but Hyperloom treats any edited tool as tampered, and it reinstalled the original version, and profiling failed again on the same check. I have raised an issue ticket on the Magpie repo "AMD-AGI/Magpie#116" |
|
@Ahmedhasssan-aig Magpie #117 is merged. This PR now pins 315 regression tests and the installed-package health check passed. GPU revalidation remains pending. |
Preserve native launch configuration while adopting framework registry and KEEP helper refactors. Retire tests for the removed CK blockscale patch.
|
Re-reviewed at Magpie #114 and #117 are merged, and the pin ( Two must-fix items, plus that condition: 1. A successful native profile, run as a standalone
2.
Condition for the default switch: legacy AgentX settings that the native path does not honour should be refused at CLI preflight with a clear message, and documented. Today:
CI: the one failing test ( |
CI E2E report — ✅ Succeeded
|
|
Thanks @chaojhou, fixed all three in dd02d4e: successful diagnostic profiles now reach trace analysis without becoming KEEP evidence; the installer shares the CLI's mode-specific Magpie check; and unsupported legacy replay settings fail early with a clear preflight error. Unit tests and coverage and the single-GPU Qwen3-0.6B smoke E2E are green on this head. The full native AgentX optimization E2E is still pending. Ready for another look when you have time. |

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
dd02d4ea3, 1,609 focused regression tests passed (1 skipped), including Coordinator trace promotion, installer/preflight compatibility, candidate execution, profiling, Roofline and GEAK boundaries. Ruff lint/format and shell syntax checks passed. The shared native health check also passed against the actual VCS-installed Magpied80eb4dpackage. Maindc46f8d97is merged; conflict resolutions follow its relocated trace/GEAK helpers and retired recipe-rewrite path. Current-head CI is pending; local mypy was unavailable.Before these fixes,
d4ccb156apassed full Linux Python 3.10/3.11 unit and coverage CI. Its separate single-GPU Qwen3-0.6B E2E run timed out and did not establish a passing E2E result.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.