Skip to content

fix(agentx): align profiling with measured workload phase - #1386

Merged
ZhengGong-amd merged 17 commits into
mainfrom
fix/agentx-phase-aligned-profiling
Sep 3, 2026
Merged

fix(agentx): align profiling with measured workload phase#1386
ZhengGong-amd merged 17 commits into
mainfrom
fix/agentx-phase-aligned-profiling

Conversation

@jiaqiang-dot-liu

@jiaqiang-dot-liu jiaqiang-dot-liu commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • gate AgentX trace capture on AIPerf's measured-phase progress instead of a fixed warmup delay
  • bound capture by profiling-phase completion or the existing wall-clock limit, and persist capture failures independently from benchmark results
  • route AgentX analysis through a primary rank trace and refuse unsafe multi-rank merged fallbacks

Test plan

  • python -m pytest -q src/hyperloom/inference_optimizer/tests/test_aiperf_client_sh.py
  • python -m pytest -q src/hyperloom/inference_optimizer/tests/test_aiperf_phase_gate.py src/hyperloom/inference_optimizer/tests/test_agentx_deploy.py src/hyperloom/inference_optimizer/tests/test_agentx_preflight.py src/hyperloom/inference_optimizer/tests/test_agentx_runtime.py src/hyperloom/inference_optimizer/tests/test_packaging_lint.py
  • PYTHONPATH=src python -m pytest -q src/hyperloom/inference_optimizer/tests/test_profile_and_kernel_handlers.py
  • targeted roofline and profile writeback tests
  • Ruff, shell syntax, and whitespace checks

Made with Cursor

fields = stat.rsplit(")", 1)
if len(fields) == 2 and fields[1].strip().split(maxsplit=1)[0] == "Z":
return False
except (OSError, IndexError):
fields = stat.rsplit(")", 1)
if len(fields) == 2 and fields[1].strip().split(maxsplit=1)[0] == "Z":
return False
except (OSError, IndexError):
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Hyperloom Forge E2E — ❌ Timeout

item value
result ❌ Timeout
example triton-softmax-forge-loop (max_hours=1.0, max_iters=100)
resources 1× GPU
workspace control-plan-hyperloom-ci
PR branch fix/agentx-phase-aligned-profiling
commit 6b469a6829aecedc680dc48b884c011ecf6c70c4
session_id 14516bda-d69f-4c88-95e5-3127f781ec64
queue → dispatch
run time
total 1m 12s

Actions run

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

CI E2E report — ❌ Timeout

item value
result ❌ Timeout
model Qwen/Qwen3-0.6B (dense)
resources 1× GPU, TP=1
PR branch fix/agentx-phase-aligned-profiling
commit 6b469a6829aecedc680dc48b884c011ecf6c70c4
session_id 962624cd-32b7-486d-8af0-b695a54b945c
queue → dispatch -43367s
run time 748m 37s
total 25m 50s
reason Timed out — the run never reached a terminal state in time (task stuck, or the GPU stayed queued too long).
detail not terminal after 13200s

details

jiaqiang-dot-liu and others added 5 commits September 3, 2026 01:33
Gate bounded trace capture on AIPerf phase progress, preserve capture failures independently, and keep single-rank analysis off merged traces.

Co-authored-by: Cursor <cursoragent@cursor.com>
Guarantee profiler shutdown on gate errors, remove unreliable request-coverage stopping, and tighten rank, timeout, status, and preflight handling from review feedback.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Reject missing capture state, preserve actionable flush reasons, complete vLLM rank matching, and avoid deterministic profile retries.

Co-authored-by: Cursor <cursoragent@cursor.com>
Let the outer profile deadline bound large-model warmup and resolve single-trace compatibility without relying solely on process TP state.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jiaqiang-dot-liu
jiaqiang-dot-liu force-pushed the fix/agentx-phase-aligned-profiling branch from 76ea161 to 6ed8a39 Compare September 3, 2026 01:36
jiaqiang-dot-liu and others added 12 commits September 3, 2026 01:43
Rename internal AIPerf progress variables so Gitleaks does not interpret a failure reason as an API credential.

Co-authored-by: Cursor <cursoragent@cursor.com>
Parse vLLM global rank before node-local TP rank while preserving SGLang and ATOM naming fallbacks.

Co-authored-by: Cursor <cursoragent@cursor.com>
Allow unranked compatibility traces only when the run is single-rank or TP is unknown, never when a multi-rank run is missing rank zero.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep bypass analysis on a single rank, preserve measurement outcomes independently, surface capture API degradation, and fail unsupported multi-node profiling explicitly.

Co-authored-by: Cursor <cursoragent@cursor.com>
Create trace directories before writing fixtures and update TP-tagged provenance expectations.

Co-authored-by: Cursor <cursoragent@cursor.com>
Allocate a per-invocation capture ID and status path before Magpie starts, validate that contract on return, and publish a trace manifest without relying on RESULT_DIR rewriting.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pass the session-level AgentX decision through benchmark materialization and preserve it when grid variants rebuild configuration without the ambient env flag.

Co-authored-by: Cursor <cursoragent@cursor.com>
Only classify a missing capture sidecar after a successful measurement, leaving server, CUDA graph, and memory failures intact for roofline recovery.

Co-authored-by: Cursor <cursoragent@cursor.com>
Share global-rank parsing across profile and bypass paths, enforce single-rank validation for explicit files, and derive a finite phase wait from the materialized benchmark timeout.

Co-authored-by: Cursor <cursoragent@cursor.com>
Require both measurement and capture success before marking trace input ready, preserve pre-capture errors, and mtime-gate single-node artifacts across retries.

Co-authored-by: Cursor <cursoragent@cursor.com>
Skip stale trace discovery after a failed measurement and align TP-rank fixture syntax with the shared parser contract.

Co-authored-by: Cursor <cursoragent@cursor.com>
Carry the resolved session decision into runtime preparation and fall back to the materialized AgentX script without weakening lazy imports for synthetic runs.

Co-authored-by: Cursor <cursoragent@cursor.com>

@ZhengGong-amd ZhengGong-amd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Problem resolved, approved

@ZhengGong-amd
ZhengGong-amd merged commit 33da083 into main Sep 3, 2026
30 of 34 checks passed
@ZhengGong-amd
ZhengGong-amd deleted the fix/agentx-phase-aligned-profiling branch September 3, 2026 08:42
zengleixin-amd pushed a commit that referenced this pull request Sep 3, 2026
Two conflicts, both in the AgentX preflight path that #1386 also touched. Kept
both sides rather than either:

* `preflight.py` -- main's structure (the loader-allowlist branch plus the new
  `require_progress_api` flag check) with this branch's `repairable` marking
  carried onto all three raise sites. A build missing `--api-host`/`--api-port`
  is a build the pinned installer can replace, so it is repairable for the same
  reason the scenario-flag and probe-failure raises are.
* `runtime.py` -- main's upgrade-aware memoization (a weak check does not
  satisfy a later strong one) around this branch's repair. The memo is keyed on
  the binary that actually passed, which after a repair may be one the install
  only just put on PATH, and `require_progress_api` is threaded into both
  capability checks so a profile round's stronger requirement survives the
  repair.

`test_agentx_runtime.py`'s two `require_progress_api` assertions gain `env`:
this branch passes the child environment into the capability check so the
corpus-pin admission test reads the pin the benchmark will actually run with.

Co-Authored-By: Claude Opus 5 (1M context) <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.

3 participants