rome.manager¶
ROME Manager — the single object a host workflow talks to.
ROME adds model improvement to a workflow that already exists. The manager is the seam: it owns the three components from the design deck and wires them to each other so the workflow only ever sees a handful of API calls.
Data Manager gathers scored outputs -> training dataset
Training Manager schedules training tasks -> publishes checkpoints
Stream Manager runs inference/reward streams -> hot-swaps checkpoints
The wiring that closes the loop is one line in Manager.start: the
training manager's checkpoint callback is the stream manager's reload hook, so
a finished training round is the event that swaps the streams onto the new
model. Nothing in the host workflow has to orchestrate that.
Typical adoption::
rome = Manager(asyncflow=flow, data_config=DataConfig(min_samples=64),
trainer_config=TrainerConfig(trainer=my_trainer))
await rome.start()
... # the workflow runs unchanged
rome.add_training_data(sequence=seq, score=plddt) # from anywhere
if rome.get_current_model(): # improved weights
mpnn.load(rome.get_current_model())
await rome.stop()
ROME_NS
module-attribute
¶
Prefix isolating ROME's keys.
A DDict shared with the host workflow therefore never collides with the workflow's own state.
DEFAULT_DDICT_KWARGS
module-attribute
¶
DEFAULT_DDICT_KWARGS: Dict[str, Any] = {'managers_per_node': 1, 'n_nodes': 1, 'total_mem': 1024 ** 3}
Defaults for a DDict ROME allocates itself.
Dragon's own default total_mem is 3 MiB; a campaign corpus of a few thousand
records plus the stream queues goes past that, and the failure mode is an
allocation error deep in a manager rather than anything ROME can explain, so
ask for room.
Manager
¶
Manager(asyncflow: Optional[WorkflowEngine] = None, *, backend: Any = None, data_config: Optional[DataConfig] = None, trainer_config: Optional[TrainerConfig] = None, stream_configs: Optional[List[StreamConfig]] = None, ddict: Optional[DDict] = None, ddict_kwargs: Optional[Dict[str, Any]] = None, auto_reload_streams: bool = True)
Manager class for handling tasks and data in the ROME framework.
Parameters:
-
asyncflow(WorkflowEngine, default:None) –The engine ROME submits its tasks to. Pass the host workflow's — for an IMPRESS campaign that is
impress_manager.flow, available once the manager has started — and ROME's rounds and streams are scheduled against the same allocation as the campaign's own tasks.Leave it
Noneand ROME builds its own engine atstartand shuts it down atstop. That is the right choice when ROME should manage its own tasks independently of the host, or when the host creates its engine internally and does not hand one out. -
backend(optional, default:None) –Execution backend for the engine ROME builds for itself. Ignored when
asyncflowis given. When both are omitted, asyncflow falls back to a local, in-process backend — fine for tests and CPU work, but wrong for a GPU fine-tune: a training round then runs inside this driver process, so the model's CUDA context stays resident for the whole campaign instead of being freed when the round ends. Pass a process-based backend (DragonExecutionBackendV3on Delta, or aConcurrentExecutionBackend(ProcessPoolExecutor())) so each round runs in a task process that releases its VRAM on exit. Seeexamples/impress_r/run_protein_binding_rome.py. -
data_config(DataConfig, default:None) –How scored outputs become a dataset, and how much data a training round needs.
-
trainer_config(TrainerConfig, default:None) –Which training algorithm to run and when. Required before training can start; may also be passed to
start. -
stream_configs(list[StreamConfig], default:None) –Inference and reward streams to bring up at
start. Streams can equally be started later viamanager.stream.start(...), or omitted entirely by workflows that only want the data + training halves. -
ddict(DDict, default:None) –Share the host workflow's dictionary instead of allocating one. ROME namespaces all of its keys, so sharing is safe, and passing the DDict object into a task is all it takes to reach it from another node — Dragon attaches the receiving process automatically.
-
ddict_kwargs(dict, default:None) –Passed to
DDict(...)when ROME allocates its own. Worth setting on a real campaign: Dragon's defaulttotal_memis 3 MiB, which a corpus of a few thousand records will exhaust, so ROME asks forDEFAULT_DDICT_KWARGSinstead. -
auto_reload_streams(bool, default:True) –Wire published checkpoints to stream reloads (default). Turn off if the workflow would rather decide when inference switches models.
Source code in rome/manager.py
model_version
property
¶
Version of the newest published checkpoint (0 = never trained).
start
async
¶
start(trainer_config: Optional[TrainerConfig] = None, stream_configs: Optional[List[StreamConfig]] = None) -> 'Manager'
Start the ROME manager: bring up the streams, then the trainer.
Order matters. Streams come up first so they are already draining requests by the time the first checkpoint lands, and the checkpoint hook is registered before the trainer can fire a round — otherwise a very fast first round could publish weights nobody is listening for.
Source code in rome/manager.py
stop
async
¶
Stop the ROME manager.
Trainer first: an in-flight round is waited out rather than cancelled, and letting the streams keep serving while it finishes means the final checkpoint still reaches them.
Source code in rome/manager.py
add_training_data
¶
add_training_data(prompt: Any = None, completion: Any = None, score: Optional[float] = None, **fields: Any) -> Optional[str]
Add training data to the manager, from anywhere in the workflow.
The prompt/completion/score triple is the LLM-shaped
convenience form; any other domain passes keywords instead::
rome.add_training_data(sequence=seq, pdb_path=pdb, score=plddt)
Returns the record uid, or None when the data manager's filters
rejected the sample.
Source code in rome/manager.py
add_training_batch
¶
get_training_dataset
¶
start_training
async
¶
Trigger a training round by hand; returns the new checkpoint path.
get_training_status
¶
get_training_status() -> TrainerStatus
get_current_model
¶
ready_to_train
¶
submit
¶
get_outputs
¶
reload_model
async
¶
Push a checkpoint into the running streams.
get_stream_status
¶
get_stream_status(stream: Optional[str] = None) -> List[StreamStatus]
report
¶
One-call snapshot of all three components.