Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.2.1 instead.

DeepDriveSim

Python 3.9+ License: MIT Code style: ruff

Deep learning-driven Adaptive Simulations

DeepDriveSim is a toolkit developed by Brookhaven National Laboratory (BNL) / RADICAL Laboratory at Rutgers University, in collaboration with Argonne National Laboratory. It implements an AI-steered ensemble simulation workflow that uses deep learning models to guide and optimize simulations in real-time.

Features

  • Adaptive Simulation Management: Dynamically manages molecular simulations based on ML predictions
  • Active Learning Loop: Implements simulation → training → prediction → cancellation → re-submission cycle
  • Multiple Execution Backends: Supports local execution, RHAPSODY (HPC), and Dragon distributed computing
  • Resource-Aware Scheduling: Automatically balances resources between simulations and training
  • GPU Support: Automatic GPU detection and utilization
  • Extensible Architecture: Easy to customize for different simulation types and ML models

Architecture

┌─────────────────────────────────────────────────────────────┐
│                     DDSim Manager                            │
├─────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │
│  │ Simulation  │  │  Training   │  │     Prediction      │  │
│  │   Queue     │──│   Module    │──│      Module         │  │
│  └─────────────┘  └─────────────┘  └─────────────────────┘  │
│         │                │                    │             │
│         ▼                ▼                    ▼             │
│  ┌─────────────────────────────────────────────────────┐    │
│  │              ROSE / RADICAL-AsyncFlow               │    │
│  │           (Execution Backend Abstraction)           │    │
│  └─────────────────────────────────────────────────────┘    │
└─────────────────────────────────────────────────────────────┘

Installation

From Source

git clone https://github.com/radical-collaboration/DeepDriveSim.git
cd DeepDriveSim
pip install -e .

With Development Dependencies

pip install -e ".[dev]"

With Documentation Dependencies

pip install -e ".[doc]"

Documentation

DeepDriveSim Documentation

Campaign Manager Integration

DDMdWorkflow exposes a lightweight hook that lets an external Campaign Manager (CM) react to each completed iteration — for example to queue downstream analysis or inference replicas.

How it works

DDMdWorkflow.__init__ accepts an optional on_ready keyword argument. When provided, the method _signal_ready() calls it after every completed iteration (inside finalize_results()).

DDMdWorkflow iteration N completes
  └─ finalize_results()
       └─ _signal_ready()          ← fires every iteration
            └─ on_ready()          ← CM hook injected at construction
                 └─ CM queues +1 dependent replica

on_ready may be a plain callable or a coroutine function — _signal_ready handles both:

async def _signal_ready(self) -> None:
    if self._on_ready is not None:
        result = self._on_ready()
        if asyncio.iscoroutine(result):
            await result

The hook fires once per iteration, not once per replica lifetime. A single DDMdWorkflow replica that runs max_iteration=5 will call on_ready five times, each time the full simulation → training → selection loop completes.

Wrapper pattern (SPHERICAL Campaign Manager)

The SPHERICAL CM runs DDMdWorkflow via a thin DDMdWrapperWorkflow that inherits BaseWorkflow. It wires on_ready to the CM's _signal_done() so that each completed DDMd iteration cascades downstream replicas based on the pipeline config — without the workflow knowing downstream group names.

# workflows/run_campaign/ddmd_workflow.py
class DDMdWrapperWorkflow(BaseWorkflow):
    workflow_id = "ddmd"

    async def run(self, replica_id: str) -> None:
        workflow = DDMdWorkflow(
            asyncflow=self.asyncflow,
            config=replica_config_path,
            name=replica_id.replace("_", ""),
            on_ready=lambda: self._signal_done(),   # ← CM hook
            policies=self.policies,
            engine_dragon=self.engine_dragon,
        )
        await workflow.start()

_signal_done() notifies the CM, which adds +1 replica to every group whose dependencies config field lists "md". The pipeline topology lives entirely in config.yaml; neither DDMdWorkflow nor DDMdWrapperWorkflow hardcodes downstream names.

Standalone usage (no CM)

When running DDMdWorkflow directly (e.g. in tests or as a standalone script), omit on_ready or pass None:

workflow = DDMdWorkflow(
    asyncflow=asyncflow,
    config="config.yaml",
    name="ddmd",
    # on_ready omitted → _signal_ready() is a no-op
)
await workflow.start()

Constructor parameters summary

Parameter Type Default Description
asyncflow WorkflowEngine required Shared radical-asyncflow engine
config str required Path to experiment YAML config
name str "ddsim" Replica name; used to namespace experiment directories
on_ready callable or coroutine function None Hook called after each completed iteration; CM injects lambda: self._signal_done()
policies list[Policy] [] Dragon GPU policies (one per assigned GPU); split into per-GPU policies internally
debug bool False Enable verbose RHAPSODY debug logging
tf_gpu_wrapper str auto-detected Shell wrapper script for GPU training subprocess
tf_cpu_wrapper str auto-detected Shell wrapper script for CPU agent subprocess

Examples

See the examples/ directory for complete working examples:

Running Tests

# Install test dependencies
pip install -e ".[dev]"

# Run unit tests
pytest tests/unit

# Run integration tests
pytest tests/integration

# Run with coverage
pytest --cov=ddsim --cov-report=html

Development

Code Style

This project uses ruff for linting and formatting:

# Check code style
ruff check ddsim tests

# Format code
ruff format ddsim tests

Using tox

# Run all tests across Python versions
tox

# Run linting
tox -e lint

# Run formatting
tox -e format

Dependencies

Citation

If you use DeepDriveSim in your research, please cite:

@inproceedings{lee2019DeepDriveSim,
  author={Lee, Hyungro and Turilli, Matteo and Jha, Shantenu and Bhowmik, Debsindhu and Ma, Heng and Ramanathan, Arvind},
  booktitle={2019 IEEE/ACM Third Workshop on Deep Learning on Supercomputers (DLS)},
  title={DeepDriveSim: Deep-Learning Driven Adaptive Molecular Simulations},
  year={2019},
  pages={12-19},
  doi={10.1109/DLS49591.2019.00007}
}

Paper: IEEE Xplore

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Brookhaven National Laboratory (BNL)
  • RADICAL Laboratory at Rutgers University
  • Argonne National Laboratory
  • This work was supported by the DOE Office of Science

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ddsim-0.2.0.tar.gz (113.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ddsim-0.2.0-py3-none-any.whl (145.5 kB view details)

Uploaded Python 3

File details

Details for the file ddsim-0.2.0.tar.gz.

File metadata

  • Download URL: ddsim-0.2.0.tar.gz
  • Upload date:
  • Size: 113.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for ddsim-0.2.0.tar.gz
Algorithm Hash digest
SHA256 eb206f10d01791797b553bfc33268d2e66ace4b1e492fcc85f57e838195ac2d9
MD5 9eca4188b5c5b150fc2927685d1e0ac2
BLAKE2b-256 e91c00f7c5bd97a8bdf1546487d1e371dcbab78b9f6882b8b15e0213d41852a2

See more details on using hashes here.

File details

Details for the file ddsim-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ddsim-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 145.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for ddsim-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9123ea3feaf06725df1c6b1f5acd0e78e6691639e318db857535b7e82682eda1
MD5 5295f89f20c15f9d6acbf0198161493e
BLAKE2b-256 7e81e56ce7c0ca3272e8e8b359a2cd8b793021275ceefff2fa0558d5488f2129

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

2 files

This release

0.2.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page