Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@

# Legacy output dirs
*/myoutputs/
impress_*.out
impress_*.err
8 changes: 6 additions & 2 deletions examples/small_molecule_binding/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
| 2026-09-09 | — | Added a metric-agnostic non-improvement short-circuit to `fastrelax`/`interface` retry logic — escalates to a new backbone (`STEP_RFD3`) as soon as a retry fails to improve on the previous attempt, instead of always exhausting 5 resequencing retries on backbones that real data showed never recover |
| 2026-09-09 | — | Fixed guided-RFD3 ligand atom-name mismatch that crashed 4/4 pipelines in a real production run (job `21916521`) on their first guided-backbone-feedback attempt: `_normalize_ligand_id()` only rewrote the Boltz co-folded PDB's ligand *residue* name, not its Boltz-assigned *atom* names, so `select_exposed`/`select_buried` (copied verbatim from the base spec, keyed by canonical `.params` atom names) never matched and RFD3's validator rejected every guided run. New `_infer_ligand_atom_mapping()`/`_normalize_ligand_atom_names()` establish atom correspondence via element+connectivity graph isomorphism (rdkit) with a Kabsch-RMSD tie-break; `_write_guided_rfd3_json()` now also verifies atom-name coverage before writing. Adds an `rdkit` runtime dependency |
| 2026-09-09 | — | Fixed a second guided-RFD3 crash found in a real production run (job `21928556`, 3/3 pipelines that reached guided feedback crashed on their very first attempt): `_write_guided_rfd3_json()` copied the base spec's `partial.length` field verbatim into the guided JSON, but RFD3's `DesignInputSpecification` validator rejects `length` outright whenever `partial.input`/`partial_t` (partial diffusion) are set (`ValidationError: ... Length argument must not be provided during partial diffusion`) — length is inferred from the input structure in that mode. `_write_guided_rfd3_json()` now drops `length` from the guided spec |
| 2026-09-26 | — | Scaled the Delta allocation up, and fixed two latent blockers found while doing it. `delta_gpu_run.sh`: `--cpus-per-task` 16→64 and `--time` 4h→48h — the three prior PROD runs all died at TIMEOUT and `seff` showed 97.7-98.1% CPU efficiency on 16 cores while using only 29% of memory, and since billing is `max(cpu*31.25, mem/8, gpu*500)` under `MAX_TRES` the extra 48 cores cost nothing (the gpu term already sets the bill at 2000); also `--mem` 220G→240G (`RealMemory` 257637MB less `MemSpecLimit` 8450 = 249187MB ceiling) and an explicit `--account`. **Blocker 1:** `CUDA_HOME`/`MPI_LIB`/`FAB_LIB` were hardcoded to CUDA 25.3 / mpich 8.1.32 / libfabric 1.22.0, all removed by Delta's Cray PE upgrade — inert under `dragon -s` (no transport agent is started) but `dragon -m` dlopens libdfabric out of `FAB_LIB` and hangs with almost no diagnostic; now autodetected with an existence check, since `dragon-config add` does not validate the path it stores. **Blocker 2:** the `--mail-user=<your e-mail>` placeholder made `sbatch` parse `e-mail>` as a directive (`Invalid directive found in batch script`), so the script could not be submitted at all. Also: `dragon-config -c` before `add` (it appends, so a stale path would survive), `SLURM_OVERLAP=1` (Dragon's own srun steps lack `--overlap`), refuse the node-local `/tmp` foundry extraction when `--nodes>1`, corrected three `${SCRATCH}/${USER}` defaults that expanded to a doubled `hooten1/hooten1`, and added `OMP_NUM_THREADS`/`OMP_WAIT_POLICY` (nothing set a thread cap anywhere, so each of N concurrent head-node subprocesses grabbed all 64 cores). New `IMPRESS_N_PIPELINES` env var scales pipeline count with the allocation, capped at the number of `p{i}_in` dirs that exist. `scripts/boltz.sh`: added the `VIRTUAL_ENV` guard `fastrelax.sh`/`packmin.sh`/`filter_shape.sh` already carry — it is one of only two tasks dispatched to Dragon and resolves `boltz`/`python` purely via inherited PATH, which is what breaks on a remote node. Note GPU placement is deliberately NOT pinned here; per "Execution backends" below that is the backend's responsibility |
| 2026-09-27 | — | Multi-node scale-up on Delta (4 nodes / 16 pipelines, job `22491438`, 98% per-pipeline scaling efficiency vs the 2-node baseline). **`dragon -m` does not work on Delta**: its slurm backend launcher builds `srun --nodelist=` from `gethostname()`, which returns FQDNs here while Slurm's `NodeName` is short (`gpub039`), so the step is unsatisfiable (`Requested node configuration is not available`) and the job hangs to the wall clock — confirmed job `22456499`; `--hostlist` is not a workaround, `SlurmWLM.__init__` accepts `_hostlist` and never uses it. `delta_gpu_run.sh` now follows `ARCHIVE-run_impress.slurm` for `SLURM_NNODES>1`: `dragon-network-config --output-to-yaml` into a per-job dir, then `dragon -w ssh --network-config <yaml> -t tcp` — ssh builds no `--nodelist` (and Delta sets `HostbasedAuthentication`/`EnableSSHKeysign` cluster-wide, so no user keys are needed), while `-t tcp` avoids the HSTA/OFI `libdfabric` dlopen. **Run config now travels as argv, not environment**: `dragon -w ssh` forwards only `BASE_ENV_VARNAMES` (`PATH`, `PYTHONPATH`, `LD_LIBRARY_PATH`, `PYTHONSTARTUP`, `VIRTUAL_ENV`, `DRAGON_*`), so `IMPRESS_TEST_MODE`/`IMPRESS_N_PIPELINES`/`IMPRESS_WORK_DIR`/`OMP_NUM_THREADS` were silently dropped and job `22466127` ran PROD defaults despite `IMPRESS_TEST_MODE=1`. `run_small_molecule_binding.py` takes `--n-pipelines`/`--work-dir` (CLI > env > config default) and sets `OMP_NUM_THREADS` and friends in `os.environ` itself, sized from `sched_getaffinity` so it respects the cgroup. Note `MPNN_DIR`/`BOLTZ_CACHE`/`FOUNDRY_SIF_PATH`/`SCRATCH` survive that hop **only** because `~/.bashrc` exports them — do not rely on that for new settings. `IMPRESS_WORK_DIR` is now scoped per job (`logs/${SLURM_JOB_ID}`): `taskcount` restarts at 1 each run, so a shared work dir silently overwrites the previous run's task dirs |
| 2026-09-27 | — | **First 4-node production campaign (job `22491438`) completed**: 16/16 pipelines reached the `max_tasks=300` budget in 6h41m, 552 passing folds, 0 OOM/tracebacks/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), with per-node CPULoad balanced at 26-40 of 64 and the primary no busier than the rest — so the "11 of 13 tasks are `local_task=True` and pinned to the primary node" ceiling is real but **not binding at 16 pipelines**. **New defect: the Dragon teardown hangs.** After `[MANAGER] All pipelines finished. Exiting.` and `Shutting down Dragon backend` at 22:23:11, `flow.shutdown()` never returned; the job sat for exactly 60 minutes and had to be `scancel`led, ending `State=CANCELLED` at `Elapsed=07:41:11` with `=== ... pipeline done ===` never printed. That burned **~64 GPU-hours (37% of the job's billed total) for zero output**, and the burn rate doubles to 32 GPU-h per hung hour at 8 nodes. Since there is no resume and no watchdog, the SLURM wall limit is the only backstop — so future runs should right-size `--time` (a 48h request lets an unattended hang bill the whole remainder) and bound `flow.shutdown()` in code so the job self-terminates once the work is provably complete |
| 2026-09-28 | — | Merged `main` (PR #64, `adbd249`, "Remove IMPRESS_TEST_MODE") into this branch. That PR 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 run config could travel as argv over `dragon -w ssh`, so 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) and 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. One consequence worth noting: the `cfg is PROD` guard on `IMPRESS_N_PIPELINES` existed only to stop the pipeline count overriding the fixed-size `TEST` config, so with `TEST` gone it is vacuous and was removed. `README.md` still documents `IMPRESS_TEST_MODE` and the `PROD`/`TEST` pair — that staleness came in with PR #64 itself and is left for a separate change rather than widened into this branch's diff |

## Context

Expand All @@ -38,7 +42,7 @@ Before running on HPC, edit the path constants at the top of `run_small_molecule

- **`small_molecule_binding.py`** — defines `SmallMoleculeBindingPipeline(ImpressBasePipeline)`, all step constants, ensemble utility functions (`_ca_rmsd`, `_seq_identity`, `_ensemble_selective_avg`), and the inner `_run_refine_cycle()` loop. All pipeline tasks (HPC and local analysis) are registered via `@self.auto_register_task()` inside `_register_real_tasks()`. The `run()` method drives a state-machine loop; `_run_refine_cycle()` handles the MPNN+PackMin inner loop with per-cycle sequence retry support.

- **`run_small_molecule_binding.py`** — entry point. Defines the `RunConfig` dataclass and two named instances (`PROD`, `TEST`); selects between them via `IMPRESS_TEST_MODE`; defines the `adaptive_decision()` callback; creates the execution backend and the `WorkflowEngine`, injects the engine into an `ImpressManager`, and launches via `manager.start(pipeline_setups=[...])` inside a `try`/`finally` that calls `await flow.shutdown()`. The caller owns the engine end to end -- `ImpressManager` never creates or shuts it down.
- **`run_small_molecule_binding.py`** — entry point. Defines the `RunConfig` dataclass and the single `PROD` instance (the `TEST` config and `IMPRESS_TEST_MODE` were retired upstream by PR #64); parses `--n-pipelines`/`--work-dir` from argv; defines the `adaptive_decision()` callback; creates the execution backend and the `WorkflowEngine`, injects the engine into an `ImpressManager`, and launches via `manager.start(pipeline_setups=[...])` inside a `try`/`finally` that calls `await flow.shutdown()`. The caller owns the engine end to end -- `ImpressManager` never creates or shuts it down.

### Step constants (state-machine constants in `small_molecule_binding.py`)

Expand Down Expand Up @@ -164,7 +168,7 @@ Ensemble similarity utilities (all in `small_molecule_binding.py`):

Also configurable, not a pass/fail threshold: `rfd3_partial_t` (default `10.0`, Å of noise added during RFD3 partial diffusion — see "Ensemble-guided backbone feedback" below).

The `PROD` config in `run_small_molecule_binding.py` overrides these class defaults at `PipelineSetup` construction (e.g. `backbone_max_ca_deviation=1.0`, `fastrelax_max_interact=-8.0`, `fold_min_plddt=75.0`). The `TEST` config sets inert thresholds (everything passes) and `max_tasks=10` for integration testing.
The `PROD` config in `run_small_molecule_binding.py` overrides these class defaults at `PipelineSetup` construction (e.g. `backbone_max_ca_deviation=1.0`, `fastrelax_max_interact=-8.0`, `fold_min_plddt=75.0`).

### Output directory structure

Expand Down
Loading
Loading