Abstract
In the AI-for-science era, scientific computing scenarios such as concurrent learning and high-throughput computing demand a new generation of infrastructure that supports scalable computing resources and automated workflow management on both cloud and high-performance supercomputers. Here we introduce Dflow, an open-source Python toolkit designed for scientists to construct workflows with simple programming interfaces. It enables complex process control and task scheduling across a distributed, heterogeneous infrastructure, leveraging containers and Kubernetes for flexibility. Dflow is highly observable and can scale to thousands of concurrent nodes per workflow, enhancing the efficiency of complex scientific computing tasks. The basic unit in Dflow, known as an Operation (OP), is reusable and independent of the underlying infrastructure or context. Dozens of workflow projects have been developed based on Dflow, spanning a wide range of projects. We anticipate that the reusability of Dflow and its components will encourage more scientists to publish their workflows and OP components. These components, in turn, can be adapted and reused in various contexts, fostering greater collaboration and innovation in the scientific community.
Introduction
The "AI-for-Science" era demands massive computational throughput. Tasks like active learning for interatomic potentials or high-throughput drug screening require iterative, complex workflows that are notoriously difficult to manage. Traditionally, scientists have relied on manual task submission or brittle, hard-to-maintain scripts on supercomputers. While general-purpose workflow tools exist, they often suffer from steep learning curves or an inability to handle the recursive logic common in scientific computing.
Dflow addresses this "valley of death" between a conceptual algorithm and its practical implementation by providing a developer-friendly, Pythonic interface for cloud-native orchestration. By leveraging Kubernetes and Argo Workflows, it allows researchers to construct modular workflows that can scale to thousands of concurrent nodes across heterogeneous environments, from local workstations to massive high-performance computing (HPC) clusters.
Architecture and Methodology
Dflow’s architecture is built on top of Argo Workflows and Kubernetes, providing a robust engine for containerized task execution. A key strength of the framework is its infrastructure agnosticism; a researcher can develop and debug a workflow on a local workstation and deploy the exact same code to a cloud cluster or an HPC environment without modification.
Core Technical Components
- Operations (OPs): The fundamental unit of Dflow. An OP encapsulates a specific task (e.g., running a DFT calculation) as a standard Python class or function. OPs are designed to be reusable and independent of the underlying infrastructure.
- Workflow Control: Dflow supports sequential steps, Directed Acyclic Graphs (DAGs), and recursive loops. It also introduces "Super OPs"—nested workflows that can be treated as a single building block.
- Parallelization via Slices: A built-in "map-reduce" mechanism automatically parallelizes tasks across a list of inputs and collects the results.
- Executor Plugins: Through the
DispatcherExecutor, Dflow can dispatch tasks to traditional HPC schedulers like Slurm, PBS, or LSF, effectively treating a supercomputer as a resource within a cloud-native workflow.
Applications and Results
Dflow has demonstrated its utility across several high-impact scientific domains, showcasing significant scalability and resilience. The framework has been used to manage workflows with approximately 1,500 OPs and has achieved concurrency levels of over 1,200 GPU nodes.
Alloy Property EXplorer (APEX)
One prominent application is APEX, a Dflow-based tool that automates the evaluation of interatomic potentials. It handles the entire pipeline from structure relaxation to calculating elastic constants, phonon spectra, and other material properties.
Other High-Impact Workflows
- Virtual Screening: In drug design, Dflow was used to segment massive molecular libraries into manageable units, ensuring that computational loads on any given node were completed within a predictable window, significantly enhancing throughput.
- TESLA: A workflow for training machine learning potentials using iterative active learning, which utilizes Dflow's ability to handle complex, looping logic.
Discussion and Conclusion
Dflow's "Lego" philosophy encourages a modular ecosystem. By standardizing the "Operation," the framework fosters collaboration, as community-contributed OPs for specific simulation packages can be dropped into entirely different projects. Furthermore, Dflow implements sophisticated fault tolerance, such as the continue_on_success_ratio, which allows massive parallel jobs to proceed even if a small percentage of nodes fail.
While maximizing reusability requires careful design of OPs to abstract input/output formats, Dflow provides a powerful abstraction layer for the AI-for-Science era. Future work focuses on expanding the ecosystem of reusable components, moving toward a future where complex scientific workflows can be assembled rapidly from a library of pre-validated, standardized parts.
Summary updated