Setting up ROME + IMPRESS on Delta¶
End-to-end: environment, install, a ladder of smoke tests that each prove one more layer, then running an IMPRESS campaign with ROME attached.
What has actually been verified, and where. Everything below was run on a
single-node Linux box with Dragon 0.14.1 — not on Delta. The Delta-specific
parts (module names, partitions, account, sbatch shape) are marked where they
need checking against your allocation. The software parts — Dragon, asyncflow,
ROME, IMPRESS, and the two of them together — were run and are reported with
their real output.
1. Environment¶
Delta gives you /work/nvme (fast, for code and checkpoints) and /work/hdd
(bulk, for structures and caches). Keep code and checkpoints on
/work/nvme/<project>/<user>/... and the bulk artifacts on /work/hdd.
export PROJ=/work/nvme/bdyk/$USER # adjust to your project/user
export BULK=/work/hdd/bdyk/$USER
mkdir -p $PROJ $BULK
Python 3.11 is what everything below was verified against. Dragon publishes
wheels per CPython version, so the interpreter version is not a free choice —
check what dragonhpc has for your Python before committing to one.
module avail python anaconda # Delta-specific: see what is offered
python3 -m venv $PROJ/venv-rome
source $PROJ/venv-rome/bin/activate
pip install --upgrade pip
A venv is easier than conda here because Dragon, radical.asyncflow and
rhapsody-py are all plain wheels.
2. Install Dragon¶
Two things to know from the start:
- Run programs as
dragon -s script.py, notpython script.py. Dragon's API imports without the runtime but every object it creates asserts on launch parameters that only exist inside a Dragon launch, so plainpythonfails withLaunch parameter not initialized: GS_CD. - Run
dragon-cleanup-deprecatedafter every Dragon program, including after a crash or a timeout. Leftovers stop the next run from starting.
3. Install ROME¶
cd $PROJ
git clone <your ROME remote> ROME && cd ROME
git checkout claude/rome-agnostic-implementation-xi5bz4
pip install -e '.[test]'
pip install 'rhapsody-py[dragon]' # Dragon execution backend for asyncflow
Sanity check without any HPC involvement:
Expect a clean run — every test here is CPU-only and needs no allocation.
4. Install IMPRESS¶
cd $PROJ
git clone --branch archive/ipdps_pdz_usecase --single-branch \
https://github.com/radical-collaboration/IMPRESS.git
cd IMPRESS
pip install --no-deps -e .
--no-deps is deliberate: pyproject.toml declares radical.pilot, but it is
only needed for the RADICAL execution backend. The examples and the full test
suite run without it.
The archived branch predates an asyncflow rename, so its examples need two
lines changed — see docs/impress.md for the detail and the version table.
Applied to a working copy:
sed -i 's/ConcurrentExecutionBackend/LocalExecutionBackend/g' \
examples/dummy.py examples/dummy_adaptive.py
python -m pytest -q # 19 passed
python examples/dummy.py # 3 pipelines, clean exit
5. Smoke-test ladder¶
Run these in order on a compute node. Each one proves one more layer, so when something breaks you know which layer to look at. Every command below was run and produced the output shown.
(a) Dragon primitives — is the DDict reachable?
ok single-key round trip
ok dict records survive pickling
ok prefix scan is namespace-scoped
ok drain claims exactly once
...
all DDict/Event checks passed
(b) The whole ROME loop — 4 stream replicas, a trainer, one real DDict.
ok every request answered exactly once
ok concurrent writers lose nothing
ok training fired and published
ok streams swapped onto the checkpoint
ROME works on Dragon
© The worked example — watch a model version climb while inference serves.
That runs on LocalExecutionBackend (task bodies as threads). To exercise real
multi-process placement — streams and a training round in separate processes,
which is what a real allocation does — run the same example on the Dragon
execution backend:
ROME_BACKEND=dragon ROME_STREAM_REPLICAS=1 ROME_GPUS=0 \
dragon -s examples/agnostic/dummy_loop.py && dragon-cleanup-deprecated
The version still climbs, but two things differ and both are backend facts, not
ROME ones (see §6 and docs/dragon.md): keep ROME_STREAM_REPLICAS below the
allocation's concurrent-task capacity so the round gets a slot, and the round's
result is published from disk after a short grace because a stream service task
blocks rhapsody's result delivery. On a real multi-node allocation raise the
replica count and leave the fallback at its minutes-scale default.
(d) IMPRESS-R — real IMPRESS pipeline, real ROME, stubbed executables.
[PIPELINE-P1] pass 1 | mpnn=proteinmpnn_v_48_020.pt
[PIPELINE-P1] corpus 4 (+4 this pass) | WAITING
[PIPELINE-P1] ROME published v1
[PIPELINE-P1] pass 3 | mpnn=.../checkpoints/dummy/v1 <-- campaign swapped
...
[PIPELINE-P1] ROME published v7
At this point everything but the science executables is proven on your machine.
6. Moving off one node: the Dragon execution backend¶
Steps (a)–(d) use LocalExecutionBackend, which runs task bodies as threads in
the driver process. For a real allocation you want tasks placed on nodes, which
is rhapsody's Dragon backend:
from rhapsody.backends import DragonExecutionBackendV3
backend = DragonExecutionBackendV3({
"num_nodes": 2, # defaults to the whole allocation
"results_ddict_mem": 4 * 1024**3, # raise for large returns / many tasks
})
manager = rome.Manager(backend=backend, ...) # ROME builds its own engine
batch_kwargs are forwarded verbatim to dragon.workflows.batch.Batch().
Verified on this backend: the data + training path, which is what IMPRESS-R uses. A run publishing three checkpoints across processes:
cycle 1: corpus 4 | v1 | model=v1
cycle 3: corpus 8 | v2 | model=v2
cycle 5: corpus 12 | v3 | model=v3
Two things this turned up that you will hit:
- A
TrainTask's in-process state does not come back. The task body runs in a different process, so anything it records onselfis invisible to the driver — in the run above the trainer object reported0rounds while three checkpoints were on disk. Only the returned checkpoint path crosses back. Write results to the DDict or to disk, not to instance attributes. DDict.get(key, default)hangs. Not raises — hangs. Used[key]in atry/except KeyError. ROME'sNamespace.getalready does; this matters if you touch a DDict directly in your own pipeline code.
Streams work on this backend. They did not until recently, and the cause was a ROME bug rather than anything about Dragon:
StreamManager.start() submits a body that closes over the StreamTask by
reference, then assigns the returned future to task.task_fut. A
multi-process backend pickles that body from its dispatcher thread, which
happens after the assignment — so the task now carries an _asyncio.Future,
cannot pickle '_asyncio.Future' object is raised inside the dispatcher, and
the dispatcher thread dies. Every task queued behind it, ROME's or the host
workflow's, then silently never runs. LocalExecutionBackend never pickles
anything, which is why the bug was invisible there.
StreamTask.__getstate__ now drops driver-only attributes, so the body pickles
whenever the backend gets round to it. With that fix all the stream checks pass
on DragonExecutionBackendV3: every request answered exactly once, work spread
across replicas, distinct outputs, and streams swapping onto a new checkpoint.
Budget one task slot per stream, plus one for training. This is the thing to
size for. A stream is a service task that never returns, so it holds its slot
for the whole run. Measured on a 4-CPU single node, this backend ran only 2
concurrent never-returning tasks — six submitted, two started, four stuck in
STARTING forever. scheduler_workers did not raise it. Two consequences:
- Requests routed to a replica that never started are never claimed. With four replicas on a two-slot box, exactly half the batch was processed and the rest sat in the queue.
- Training starves. A round is a task like any other, so if the streams
occupy every slot,
min_samplesis reached and no round ever runs. Verified: the trainer alone publishesv1in two seconds on this backend, and the same trainer never fires with a stream holding a slot.
So the allocation needs at least num_streams + 1 concurrent task slots. On a
real multi-node allocation that is not a constraint; on one node it is, and
tests/dragon/test_manager_dragon.py takes ROME_STREAM_REPLICAS for exactly
that reason.
Ask for GPUs only if you have them. StreamConfig.num_gpus defaults to 1
and TrainTask.gpus is passed through, both of which put gpus_per_rank into
the task description. On a node without GPUs the task is accepted and never
placed — no error, just STARTING forever.
7. Running a campaign under Slurm¶
Delta-specific values to confirm first — check with sinfo and your allocation:
#!/bin/bash
#SBATCH --job-name=impress-r
#SBATCH --account=<your-account>
#SBATCH --partition=<gpu-partition> # e.g. gpuA100x4
#SBATCH --nodes=2
#SBATCH --gpus-per-node=4
#SBATCH --time=04:00:00
#SBATCH --output=impress-r-%j.out
set -euo pipefail
export PROJ=/work/nvme/bdyk/$USER
source $PROJ/venv-rome/bin/activate
cd $PROJ/ROME
# Keep campaign state off the login filesystem.
export ROME_CHECKPOINTS=$PROJ/checkpoints
export IMPRESS_BASE=/work/hdd/bdyk/$USER/campaign
mkdir -p "$ROME_CHECKPOINTS" "$IMPRESS_BASE"
dragon -s examples/impress_r/adaptive_rome.py
rc=$?
dragon-cleanup-deprecated || true # always, including after a failure
exit $rc
Start with --nodes=1 and the stubbed example to confirm Dragon comes up under
Slurm at all, then scale.
8. Swapping in the real science¶
The example stubs three things. Replacing them is where the remaining work is:
| Stub in the example | Real thing |
|---|---|
s1_mpnn echo |
mpnn_wrapper.py from IMPRESS's protien_binding_usecase |
s4_alphafold echo |
af2_multimer_reduced.sh |
s5_extract writing a CSV |
plddt_extract_pipeline.py |
DummyTrainer |
ProteinMPNNTrainer(ProteinMPNNConfig(...)) |
The adaptive_fn reads the real CSV schema (ID, avg_plddt, ptm, avg_pae) and
the real structure path (pipeline.output_path_af/{design}.pdb), but it does
need one change before a production run: that path is keyed by pipeline, not
by pass, so the next pass overwrites it and finalize() deletes it outright.
The contribution step has to copy the prediction to a pass-qualified location
before recording it, or the corpus points at files that no longer hold the
structure that was scored. See docs/impress.md.
Do not reuse impress_corpus_filter()'s defaults either — see §9.
For the trainer, read docs/proteinmpnn_training.md first. It fine-tunes the
original dauparas/ProteinMPNN — the same implementation IMPRESS runs —
pointed at your ProteinMPNN checkout via ProteinMPNNConfig(mpnn_repo=...), and
with publish_into_repo=True writes the new weights into
{mpnn_repo}/vanilla_model_weights/{model_name}.pt so the next pass runs them
with no wrapper change. The data prep, chain designation and checkpoint format
are tested; the torch fine-tuning loop needs the checkout and a GPU and has not
been run in CI, so validate it there (or start with train_func).
Two open items to settle before a production run, both noted in
docs/impress.md and docs/proteinmpnn_training.md:
- IMPRESS's real
run_protein_binding.pyusesRadicalExecutionBackend, which exists only in asyncflow 0.2.0. On current asyncflow, use the Dragon backend above. - Fine-tuning only on self-generated designs will drift the model, and the standard mitigation — mixing in a slice of the original PDB training distribution — needs a held-out set the campaign does not provide.
9. Selecting designs without knowing your thresholds yet¶
impress_corpus_filter()'s defaults admit 83% of a real campaign. They are
IMPRESS's own keep/drop thresholds, and everything reaching the score CSVs has
already cleared those, so the filter is applied downstream of itself and selects
nothing. Fine-tuning on that corpus trains ProteinMPNN on its own median output.
Replacing them needs a distribution, and confidence scales are predictor specific — an AlphaFold2-multimer campaign and a Boltz one are not comparable — so the numbers have to come from the run you are doing. Two ways to get there, and the first needs nothing up front.
Rank instead of threshold (recommended for a first run).
from examples.impress_r.mpnn import percentile_sampler
rome.DataConfig(
min_samples=24,
sample_func=percentile_sampler(0.33, on_summary=print),
)
"The best third of what this campaign has produced" needs no scale, so it works
on the first round before any distribution exists, and keeps working if you
switch predictors. Ranking is by average rank across pAE (down) and pTM (up), so
the two contribute equally without normalisation and neither's outliers dominate.
on_summary=print reports, every round, the corpus size, how many were selected,
and the cutoffs an equivalent fixed filter would have used — which is how the
run hands you the calibration data as a byproduct.
Leave filter_func off, or keep it only to reject malformed records. Admission
and selection are different jobs; this does the selecting.
Watch the distribution directly.
Reads every af_stats_*.csv written so far and prints the live distribution
plus what each candidate threshold triple would admit. Read-only, safe against a
running job. Once a few passes have landed, pick the row admitting roughly a
third and pass it explicitly:
One trap it will show you: setting each of the three clauses at its 33rd percentile does not admit a third. On measured data it admitted 6%, because the three scores correlate. If you do choose fixed thresholds, verify the joint admission rate rather than reasoning clause by clause.
Whichever route, sampling="top_k" with score_key="pLDDT" is worth avoiding:
pLDDT never fell below 88 across 176 measured records, so ranking on it is close
to ranking at random.