fix(profile): find the steady-state trace the injected profiler dir redirected - #1573
Conversation
|
Reconsider this as a write-side fix. The task-root search should not exist. Magpie emits Drop the placeholder from the launched |
|
Adopted the write-side approach from your comment.
Pushed on |
|
Rebase onto main; this head conflicts, so Lint and Tests with Coverage never started and must pass on the rebased commit. Rewrite the PR body: it still describes probing the task root and the mtime watermark, but the change now stops Correct the new comment and test note: Magpie emits |
Stop appending a task-root torch_profiler_dir placeholder to EXTRA_VLLM_ARGS so Magpie's workspace/torch_trace flag wins vLLM's last-wins merge. Revert task-root trace discovery and attempt watermarks; argv preflight still gets a probe-only dir from baseline and bypass_engine.
3e1af6d to
878a685
Compare
Align the sidecar-preference executor test with Magpie's profiler output dir after the write-side EXTRA_VLLM_ARGS fix.
8c15a31 to
331031e
Compare
Stub kernel subprocess boundaries in the phase machine fixture and assert idempotency while parked in FRAMEWORK_AGENT after prelude_done.
Clarify that Magpie emits torch_profiler_dir before EXTRA_VLLM_ARGS and that omitting a duplicate dir in materialization keeps traces under workspace/torch_trace.
Problem
Magpie's launcher emits its own
--profiler-config.torch_profiler_dir <workspace>/torch_tracebeforeEXTRA_VLLM_ARGS, so the placeholder_workload_envsappends -- the task root -- is the value vLLM resolves underits dotted-flag last-wins merge. Observed argv order on a real round:
and the server confirms it:
ProfilerConfig(torch_profiler_dir='<task root>').The server therefore writes its steady-state traces straight into the task root
and its graph-capture sidecars into that root's
capture_traces/, whileMagpie's own
torch_trace/stays empty and says so(
[PROFILE] No trace found for relay under: .../torch_trace)._candidate_trace_dirsprobed the workspace and the root'scapture_traces,so it saw only sidecars and fell back to capture-only. Roofline rejects a
capture-only trace, so every attempt failed with
profile_capture_only_failedwhile the traces it wanted sat one directory up.
Session
20260917T191938Z-1ad81699lost both roofline tasks that way, 3 of 3attempts each, against 24 complete annotated steady-state traces (8 ranks x 3
attempts, ~250MB each) already on disk. The knock-on is the whole kernel phase:
GEMM tuning had no shapes to derive (
no candidates to E2E validate) andforge-fusion was skipped outright (
no decode trace yet), leaving KB replay asthe session's only source of gain.
Fix
Fix the launch contract instead of teaching the reader to hunt the task root.
_workload_envs.py): when materializing a vLLM profile run,keep
profiler=torchand the delay/max-iteration bounds inEXTRA_VLLM_ARGS,but do not append
--profiler-config.torch_profiler_dir(the old task-rootplaceholder). With only Magpie's earlier
torch_profiler_diron the realvllm serveargv, last-wins no longer overrides Magpie; steady-state tracesland under
<workspace>/torch_traceas Magpie intended.profile.py): discovery stays onworkspace/torch_trace(andcapture sidecars under the workspace). No task-root candidate, no mtime
watermark — those were dropped in favour of fixing where the server writes.
CI / test hygiene:
test_phase_state_machine.pystubs GEAK runner andcontroller subprocess boundaries in its
session_dirfixture (same pattern asthe optimize-loop walkthrough) and checks phase-history idempotency while parked
in
FRAMEWORK_AGENTafterprelude_done, instead of disabling the frameworkphase and racing KERNEL→SWEEP closeout on the second tick.
Test plan
test_profile_and_kernel_handlers.py: materialize tests asserttorch_profiler_diris not injected intoEXTRA_VLLM_ARGS; executortests prefer
workspace/torch_traceover capture-only sidecars.test_phase_state_machine.py: kernel subprocess stubs + idempotency inFRAMEWORK_AGENT(46 passed in file).src/hyperloom/orchestrator/and inference_optimizer profile suite asrun locally before push.
ruff check+ruff format --checkon changed files.20260917T191938Z-1ad81699: roofline admitssteady-state traces under workspace
torch_traceonce launch no longerredirects writes to the task root.