Skip to content

Telemetry smallmol - #66

Merged
drawadiagram merged 4 commits into
mainfrom
telemetry-smallmol
Oct 8, 2026
Merged

drawadiagram merged 4 commits into
mainfrom
telemetry-smallmol

Conversation

@drawadiagram

Copy link
Copy Markdown
Contributor

based on #65. adds telemetry to the smallmol wf. lemma

Mason Hooten and others added 4 commits September 27, 2026 21:27
Fixes the TIMEOUT that killed the three previous PROD runs (21933600,
21945304, 21960876) and enables 4-node / 16-pipeline execution, measured
at 98% per-pipeline scaling efficiency vs a 2-node baseline (job 22491438).

Allocation sizing (delta_gpu_run.sh):
  --cpus-per-task 16 -> 64, --mem 220G -> 240G, --time 4h -> 48h, explicit
  --account. seff on the three TIMEOUT runs showed 97.7-98.1% CPU efficiency
  on 16 cores at 29% memory. The extra cores are free: billing is
  max(cpu*31.25, mem/8, gpu*500) under MAX_TRES and the GPU term already
  pins it at 2000.

`dragon -m` does not work on Delta:
  Dragon's slurm backend launcher builds `srun --nodelist=` from
  gethostname(), which returns FQDNs here, while Slurm's NodeName is short
  (gpub039) -- the step is unsatisfiable ("Requested node configuration is
  not available") and the job hangs to the wall clock (job 22456499).
  --hostlist is not a workaround: SlurmWLM.__init__ accepts _hostlist and
  never references it. Multi-node now follows ARCHIVE-run_impress.slurm:
  dragon-network-config --output-to-yaml into a per-job dir, then
  `dragon -w ssh --network-config <yaml> -t tcp`. ssh builds no --nodelist
  (Delta sets HostbasedAuthentication/EnableSSHKeysign cluster-wide, so no
  user keys are needed) and -t tcp avoids the HSTA/OFI libdfabric dlopen.

Run config travels as argv, not environment:
  `dragon -w ssh` forwards only BASE_ENV_VARNAMES (PATH, PYTHONPATH,
  LD_LIBRARY_PATH, PYTHONSTARTUP, VIRTUAL_ENV, DRAGON_*), so IMPRESS_*
  and OMP_NUM_THREADS were silently dropped -- job 22466127 ran PROD
  defaults despite IMPRESS_TEST_MODE=1. The runner now takes
  --n-pipelines / --work-dir / --test-mode (CLI > env > default) and sets
  OMP_NUM_THREADS and friends in os.environ itself, sized from
  sched_getaffinity so it respects the cgroup rather than the physical
  core count. MPNN_DIR/BOLTZ_CACHE/FOUNDRY_SIF_PATH/SCRATCH survive that
  hop only because ~/.bashrc exports them; that is noted, not relied on.

Also:
  - autodetect CUDA_HOME/MPI_LIB/FAB_LIB with an existence check; the
    hardcoded CUDA 25.3 / mpich 8.1.32 / libfabric 1.22.0 paths were
    removed by Delta's Cray PE upgrade. dragon-config add does not
    validate what it stores, and a bad FAB_LIB fails as a silent hang.
  - `--mail-user=<your e-mail>` made sbatch parse `e-mail>` as a directive,
    so the script could not be submitted at all.
  - IMPRESS_WORK_DIR scoped per job: taskcount restarts at 1 each run, so a
    shared work dir silently overwrites the previous run's task dirs.
  - correct three ${SCRATCH}/${USER} defaults that doubled the user segment.
  - dragon-config -c before add (it appends); SLURM_OVERLAP=1; refuse the
    node-local /tmp foundry extraction when --nodes>1.
  - boltz.sh gains the VIRTUAL_ENV guard the other scripts already carry.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Job 22491438 (4 nodes / 16 pipelines) completed its science: all 16
pipelines reached the max_tasks=300 budget in 6h41m, producing 552
passing folds with 0 OOM, tracebacks, or task failures. Scaling measured
at 98% per-pipeline efficiency vs the 2-node baseline (11.46 vs 11.69
rfd3/pipeline/h; 3.9x job-wide for 4x pipelines). Per-node CPULoad stayed
balanced at 26-40 of 64 with the primary no busier than the rest, so the
"11 of 13 tasks are local_task=True and pinned to the primary node"
ceiling, while real, is not binding at 16 pipelines.

New defect recorded: the Dragon teardown hangs. After

  22:23:11  [MANAGER] All pipelines finished. Exiting.
  22:23:11  Shutting down Dragon backend

flow.shutdown() never returned. The job sat for exactly 60 minutes and
had to be scancelled, ending State=CANCELLED at Elapsed=07:41:11 with
"=== Small Molecule Binding pipeline done ===" never printed.

That burned ~64 GPU-hours -- 37% of the job's billed 172 GPU-h -- for
zero output, and the rate doubles to 32 GPU-h per hung hour at 8 nodes.
There is no resume and no watchdog, so the SLURM wall limit is currently
the only backstop: a 48h request lets an unattended hang bill the entire
remainder. Mitigations for the next campaign are to right-size --time and
to bound flow.shutdown() in code so the job self-terminates once the work
is provably complete.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
PR #64 (adbd249, "Remove IMPRESS_TEST_MODE") deleted the TEST RunConfig, the
`cfg = TEST if ... else PROD` conditional and the IMPRESS_TEST_MODE export --
the same three regions this branch had rewritten so that run config travels as
argv over `dragon -w ssh`, which forwards only BASE_ENV_VARNAMES. Neither file
auto-merged.

Resolved in main's favour on whether test mode exists (it does not): --test-mode
dropped from the argparse and from RUNNER_ARGS, cfg = PROD unconditionally.
Resolved in this branch's favour on everything else: the --n-pipelines/--work-dir
argv plumbing and the sched_getaffinity thread caps are load-bearing for
multi-node and orthogonal to the flag.

The `cfg is PROD` guard on IMPRESS_N_PIPELINES existed only to stop the pipeline
count overriding the fixed-size TEST config; with TEST gone it is vacuous and
was removed.

Docs: CLAUDE.md's architecture and thresholds sections described PROD/TEST
selection as live; the revision-history rows and multinode-scaleup-testing.md's
Stage 1/2 records are left intact as history, with a note that the flag they
used has since been retired.

Verified: the runner imports cleanly under the real stack with cfg is PROD and
no TEST attribute, --n-pipelines 32 still reaches replace() with PROD left
unmutated, `bash -n` passes, and no executable reference to IMPRESS_TEST_MODE
or --test-mode remains.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Enabling telemetry is three lines on ImpressManager, but the protein_binding
reference wiring copied verbatim produces a trace that cannot answer the
question the next campaign exists to answer. Both defects verified against that
example's real 7.0 MB output:

1. Only 2 of 13 tasks appear. auto_register_task(local_task=True) returns the
   raw coroutine and never reaches asyncflow, so only rfd3 and boltz emit
   lifecycle events -- the other 11 are exactly the stages that run on the
   Dragon primary node.
2. Even those 2 are indistinguishable: the label is shlex.split(cmd)[0], i.e.
   always "bash" -- 3486 of 3486 in the reference file.

Fixed with an impress.LocalStage custom event plus a _timed_local decorator on
all 11 local stages, and workflow_id= at the two Dragon call sites. The
decorator is additive instrumentation, not an execution change: converting the
local stages to flow.function_task is not drop-in, since they mutate
self.state/self.taskcount in-process and the OMP_NUM_THREADS cap depends on
them being subprocesses of the runner.

Config deviates from the reference deliberately: checkpoint_path derived from
the resolved work_dir (a relative path resolves against $SCRATCH, not the
source tree, and this inherits per-job scoping); resource_poll_interval=15.0
(the reference's 5.0 made ResourceUpdate 69% of its file);
checkpoint_interval=300.0 (the reference omits it, so a wall-clock kill loses
the 128KB-buffered file); stop() in finally before flow.shutdown() (the
reference has it in try and loses the file on any error).

Note the overlap with origin/update_usecases/telemetry (b8035a4), which fixes
the same local-task blindness at the framework level via wrap_local_task in a
new src/impress/utils/telemetry.py. That branch is not in main and does not
apply to it -- it predates PR #60's lifecycle rework. If it ever lands,
_timed_local should be removed rather than run alongside it, or every local
stage emits twice. Recorded in the tracker.

Verified off-HPC against the real stack: a live start_telemetry session wrote
the JSONL containing "fastrelax completed 0.020s" and "packmin failed"; the
decorator preserves __name__ (required by auto_register_task's setattr),
returns values and propagates exceptions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
# Instrumentation must never take the pipeline down.
pass

def _timed_local(self, func):

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.

So, this also goes back to the 11 local tasks that IMPRESS is launching and managing locally. IMPRESS would not need to perform this local profiling if the task were launched through AsyncFlow.

@drawadiagram drawadiagram mentioned this pull request Oct 6, 2026
@drawadiagram
drawadiagram merged commit 64b2ef2 into main Oct 8, 2026
11 checks passed
@drawadiagram
drawadiagram deleted the telemetry-smallmol branch October 8, 2026 16:47
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.

2 participants