Skip to main content

Dragon

Dragon is a distributed environment for developing high-performance tools, libraries, and applications at scale. This distribution package provides the necessary components to run the Python multiprocessing library using the Dragon implementation which provides greater scaling and performance improvements over the legacy multiprocessing that is currently distributed with Python.

For examples and the actual source code for Dragon, please visit its github repository: https://github.com/DragonHPC/dragon

Installing Dragon

Dragon currently supports python versions 3.11, 3.12 and 3.13. Otherwise, just do a pip install:

pip install dragonhpc

After doing the pip install of the package, you have completed the prerequisites for running Dragon multiprocessing programs.

If running in a multi-node environment with a high speed interconnect, you'll need to configure dragon to use the interconnect's libraries. Some example configuration commands appear below. For more information, see the "Configuring Dragon's high performance network backend for HSTA" section below:

# For a UCX backend, provide a library path that contains a libucp.so:
dragon-config add --ucx-runtime-lib=/opt/nvidia/hpc_sdk/Linux_x86_64/23.11/comm_libs/12.3/hpcx/hpcx-2.16/ucx/prof/lib

# For an OFI backend, provide a library path that contains a libfabric.so:
dragon-config add --ofi-runtime-lib=/opt/cray/libfabric/1.22.0/lib64

Dragon is built with manylinux_2_28 support and should function on most Linux distros.

Extra requirements

Beyond its foundational distributed communication architecture, Dragon includes support for AI and scientific workflows as well as monitoring system performance via its telemetry feature. Dependencies for these supported features is not installed by default when you install the dragonhpc package.

Rather, those extra dependencies are defined as optional requirements that you can install as needed. For instance, installing AI workflow dependencies can be done via

pip install dragonhpc[ai]

And telemetry dependencies can be installed via

pip install dragonhpc[telemetry]

If you were interested in installing both sets of those dependencies, a comma separated list will achieve the result:

pip install dragonhpc[ai,telemetry]

To install the dependencies for all the optional features, you can use the all tag:

pip install dragonhpc[all]

For a complete list of the currently supported extra requirement tags, refer to extra-requirements.txt in the open source repository.

Configuring Dragon's high performance network backend for HSTA

Dragon includes two separate network backend services for communication across compute nodes. The first is referred as the "TCP transport agent". This backend uses common TCP to perform any communication over the compute network. However, this backend is relatively low performing and can be a performance bottleneck.

Dragon also includes the "High Speed Transport Agent (HSTA)", which supports UCX for Infiniband networks and OpenFabrics Interface (OFI) for HPE Slingshot. However, Dragon can only use these networks if its environment is properly configured.

To configure HSTA, use dragon-config to provide an "ofi-runtime-lib" or "ucx-runtime-lib". The input should be a library path that contains a libfabric.so for OFI or a libucp.so for UCX. These are libraries are dynamically opened by HSTA at runtime. Without them, dragon will fallback to using the lower performing TCP transport agent

Example configuration commands appear below:

# For a UCX backend, provide a library path that contains a libucp.so:
dragon-config add --ucx-runtime-lib=/opt/nvidia/hpc_sdk/Linux_x86_64/23.11/comm_libs/12.3/hpcx/hpcx-2.16/ucx/prof/lib

# For an OFI backend, provide a library path that contains a libfabric.so:
dragon-config add --ofi-runtime-lib=/opt/cray/libfabric/1.22.0/lib64

As mentioned, if dragon-config is not run as above to tell Dragon where to appropriate libraries exist, Dragon will fall back to using the TCP transport agent. You'll know this because a message similar to the following will print to stdout:

Dragon was unable to find a high-speed network backend configuration.
Please refer to `dragon-config --help`, DragonHPC documentation, and README.md
to determine the best way to configure the high-speed network backend to your
compute environment (e.g., ofi or ucx). In the meantime, we will use the
lower performing TCP transport agent for backend network communication.

If you get tired of seeing this message and plan to only use TCP communication over ethernet, you can use the following dragon-config command to silence it:

dragon-config add --tcp-runtime=True

For help without referring to this README.md, you can always use dragon-config --help

Running a Program using Dragon and python multiprocessing

There are two steps that users must take to use Dragon multiprocessing.

  1. You must import the dragon module in your source code and set dragon as the start method, much as you would set the start method for spawn or fork.

     import dragon
     import multiprocessing as mp
     ...
     if __name__ == "__main__":
         # set the start method prior to using any multiprocessing methods
         mp.set_start_method('dragon')
         ...
    

    This must be done for once for each application. Dragon is an API level replacement for multiprocessing. So, to learn more about Dragon and what it can do, read up on multiprocessing.

  2. You must start your program using the dragon command. This not only starts your program, but it also starts the Dragon run-time services that provide the necessary infrastructure for running multiprocessing at scale.

     dragon myprog.py
    

    If you want to run across multiple nodes, simply obtain an allocation through Slurm (or PBS) and then run dragon.

     salloc --nodes=2 --exclusive
     dragon myprog.py
    

If you find that there are directions that would be helpful and are missing from our documentation, please make note of them and provide us with feedback. This is an early stab at documentation. We'd like to hear from you. Have fun with Dragon!

Sanity check Dragon installation

Grab the following from the DragonHPC github by cloning the repository or a quick wget: p2p_lat.py

wget https://raw.githubusercontent.com/DragonHPC/dragon/refs/heads/main/examples/multiprocessing/p2p_lat.py .

If testing on a single compute node/instance, you can just do:

dragon p2p_lat.py --dragon
using Dragon
Msglen [B]   Lat [usec]
2  28.75431440770626
4  39.88605458289385
8  37.25141752511263
16  43.31085830926895
+++ head proc exited, code 0

If you're trying to test the same across two nodes connected via a high speed network, try to get an allocation via the workload manager first and then run the test, eg:

salloc --nodes=2 --exclusive
dragon p2p_lat.py --dragon
using Dragon
Msglen [B]   Lat [usec]
2  73.80113238468765
4  73.75898555619642
8  73.52533907396719
16  72.79851596103981

Environment Variables

DRAGON_DEBUG - Set to any non-empty string to enable more verbose logging

DRAGON_DEFAULT_SEG_SZ - Set to the number of bytes for the default Managed Memory Pool. The default size is 4294967296 (4 GB). This may need to be increased for applications running with a lot of Queues or Pipes, for example.

Requirements

  • Python >= 3.11
  • GCC 9 or later
  • Slurm or PBS+PALS (for multi-node Dragon)

NOTE: The DragonHPC project is planning to discontinue packaged releases targeting Python 3.10 as Python 3.10 approaches its official end-of-life in October 2026. Consequently, future updates will prioritize more recent Python releases to ensure continued security and compatibility.

Known Issues

For any issues you encounter, it is recommended that you run with a higher level of debug output. It is often possible to find the root cause of the problem in the output from the runtime. We also ask for any issues you wish to report that this output be included in the report. To learn more about how to enable higher levels of debug logging refer to dragon --help.

Dragon Managed Memory, a low level component of the Dragon runtime, uses shared memory. It is possible that things go wrong while the runtime is coming down and files are left in /dev/shm. Dragon does attempt to clean these up in the chance of a bad exit, but it may not succeed. In that case, running dragon-cleanup on your own will clean up any zombie processes or un-freed memory.

It is possible for a user application or workflow to exhaust memory resources in Dragon Managed Memory without the runtime detecting it. Many allocation paths in the runtime use "blocking" allocations that include a timeout, but not all paths do this if the multiprocessing API in question doesn't have timeout semantics on an operation. When this happens, you may observe what appears to be a hang. If this happens, try increasing the value of the DRAGON_DEFAULT_SEG_SZ environment variable to larger sizes (default is 4 GB, try increasing to 16 or 32 GB). Note this variable takes the number of bytes.

Python multiprocessing applications that switch between start methods may fail with this due to how Queue is being patched in. The issue will be addressed in a later update.

If there is a firewall blocking port 7575 between compute nodes, dragon will hang. You will need to specify a different port that is not blocked through the --port option to dragon. Additionally, if you specify --network-prefix and Dragon fails to find a match the runtime will hang during startup. Proper error handling of this case will come in a later release.

In the event your experiment goes awry, we provide a helper script, dragon-cleanup, to clean up any zombie processes and memory.

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

dragonhpc-0.14.2-cp313-cp313-manylinux_2_28_x86_64.whl (16.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

dragonhpc-0.14.2-cp313-cp313-manylinux_2_28_aarch64.whl (15.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

dragonhpc-0.14.2-cp313-cp313-macosx_26_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.13macOS 26.0+ ARM64

dragonhpc-0.14.2-cp312-cp312-manylinux_2_28_x86_64.whl (16.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

dragonhpc-0.14.2-cp312-cp312-manylinux_2_28_aarch64.whl (15.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

dragonhpc-0.14.2-cp312-cp312-macosx_26_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.12macOS 26.0+ ARM64

dragonhpc-0.14.2-cp311-cp311-manylinux_2_28_x86_64.whl (16.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

dragonhpc-0.14.2-cp311-cp311-manylinux_2_28_aarch64.whl (16.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

dragonhpc-0.14.2-cp311-cp311-macosx_26_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.11macOS 26.0+ ARM64

File details

Details for the file dragonhpc-0.14.2-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dragonhpc-0.14.2-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9dc2c90a0902524f2e5e3c24e18fa941212e442c09aeab444e8004907528dd14
MD5 b8f7f6d66e2ee7e15ee56176408ba17a
BLAKE2b-256 bc8d35157906acd4e9647e4dcd87ecb742d309f383e257e05c449c8f8f1c2184

See more details on using hashes here.

File details

Details for the file dragonhpc-0.14.2-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dragonhpc-0.14.2-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c94e96fb486103ac6172ec3042d4ba48660ca64486dbbd8fc0669c2e827c3ff4
MD5 6a424c8c468f9bdfd4b54a9840ed1eaa
BLAKE2b-256 1c3b06945b01f119a30e69a0789d67336264b46221abb540b006bee7b0e461cb

See more details on using hashes here.

File details

Details for the file dragonhpc-0.14.2-cp313-cp313-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for dragonhpc-0.14.2-cp313-cp313-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 598f3444be22f3e900805fb918ba16fb733c3a8808202b7bb44743ad6c55b562
MD5 b8e052557fbcbe2dcb89dc977d5d9706
BLAKE2b-256 469966371637482eb9dd8d5b090f9ad52da20c45bfa49377514a55cbde4a61b4

See more details on using hashes here.

File details

Details for the file dragonhpc-0.14.2-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dragonhpc-0.14.2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3763d2839489dfb16d973a8a6d6cd50e31612de5ed43c8b8cfe855a2d5c5e9db
MD5 184b3f7f1f7115ca82af93ea73808e3f
BLAKE2b-256 465744a539277364edf21e95c49f49275f9bc015e2538c95cdd0a0f9d72820ee

See more details on using hashes here.

File details

Details for the file dragonhpc-0.14.2-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dragonhpc-0.14.2-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e78f466e44fdc5faad16ba4116f238ae0669d15bc523d526c945611fb428793e
MD5 ba06959ab6d7eb04aaa86ef6cbef9cab
BLAKE2b-256 c2580f2060acc2f1bde732ab6f23df08016f697302a0927cde7d4861767b21b3

See more details on using hashes here.

File details

Details for the file dragonhpc-0.14.2-cp312-cp312-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for dragonhpc-0.14.2-cp312-cp312-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 de652d5eeaed22c88cde2bd574e19cf5a4a622e229598691f6fe30a1eede5718
MD5 4934c45190703c1bcb5d5d7b19a70848
BLAKE2b-256 f049fe6b991912469afb8634bf095d3219648a638d999476454100522f3443fc

See more details on using hashes here.

File details

Details for the file dragonhpc-0.14.2-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dragonhpc-0.14.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3fce0f0fb9bab094da7877698cabc0b8e107ca217aa4413f154b5646cb816f6f
MD5 e71ffa8904dcfb8a617573433e97dff5
BLAKE2b-256 cce098fc9ad7d7da1f4b91f6c1f89e867c1eb3c95d98b099628236b8e6ba9678

See more details on using hashes here.

File details

Details for the file dragonhpc-0.14.2-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dragonhpc-0.14.2-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a24608a2d49642104de258beec87a24b2aafc59ac02be548300b095ae14d5e35
MD5 01e895ebbe39124f43bb33e637626aee
BLAKE2b-256 9d872ad4a5baa52ee28584e9f71f3a094bd01f86f4283f545dee427fc47fec2f

See more details on using hashes here.

File details

Details for the file dragonhpc-0.14.2-cp311-cp311-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for dragonhpc-0.14.2-cp311-cp311-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 f1a227408f9cc806a38735e1e13fdbe6e85075a18b019ff5698e989da2e92c8c
MD5 719a2a5265093fba71bbbe9b7ce787de
BLAKE2b-256 99cd01c57ebff14ac415d085d2f2a6c2a8677885c36de5d83117ac959b807a67

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.14.2 This release

9 files

0.14.1.1

3 files

0.14.1

9 files

0.14.0

4 files

0.13.2

3 files

0.13.1

3 files

0.13

3 files

0.12.3

3 files

0.12.2

3 files

0.12.1

3 files

0.12.0

3 files

0.11.1

3 files

0.11

3 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