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
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
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.

Metadata

Release files for dragonhpc 0.15.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for dragonhpc 0.15.0
File
dragonhpc-0.15.0-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details
dragonhpc-0.15.0-cp313-cp313-manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ ARM64 Details
dragonhpc-0.15.0-cp313-cp313-macosx_26_0_arm64.whl CPython 3.13 CPython 3.13 macOS 26.0+ ARM64 Details
dragonhpc-0.15.0-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details
dragonhpc-0.15.0-cp312-cp312-manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ ARM64 Details
dragonhpc-0.15.0-cp312-cp312-macosx_26_0_arm64.whl CPython 3.12 CPython 3.12 macOS 26.0+ ARM64 Details
dragonhpc-0.15.0-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details
dragonhpc-0.15.0-cp311-cp311-manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ ARM64 Details
dragonhpc-0.15.0-cp311-cp311-macosx_26_0_arm64.whl CPython 3.11 CPython 3.11 macOS 26.0+ ARM64 Details

Total release size: 118.2 MB

Release files / dragonhpc-0.15.0-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL dragonhpc-0.15.0-cp313-cp313-manylinux_2_28_x86_64.whl
Size 16.8 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
05301a6a1c0750f51222e38200429bd61eec36aaef06149f75c6dc353fd53aaa
BLAKE2b-256 checksum
How to use checksums
fa0bd176aef57569bb8c8e047ac08b38bfb068ec3133f6d33a72eeb10da2262e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / dragonhpc-0.15.0-cp313-cp313-manylinux_2_28_aarch64.whl

Download URL dragonhpc-0.15.0-cp313-cp313-manylinux_2_28_aarch64.whl
Size 16.4 MB
Tags CPython 3.13 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
b642fe87c3eecdbae306d18a333dc94a915fa6e7112bfb0231a8e6bd1c2ac1ad
BLAKE2b-256 checksum
How to use checksums
bd532e2c7c51fd0b7c3ced5e629a3dbb8a8677959ed56d88a1e6c435db56a753
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / dragonhpc-0.15.0-cp313-cp313-macosx_26_0_arm64.whl

Download URL dragonhpc-0.15.0-cp313-cp313-macosx_26_0_arm64.whl
Size 5.8 MB
Tags CPython 3.13 macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
224c1b8bff414b668c9d632d857e77b33b041c1c8595c8a5ede5eb2e19abab5f
BLAKE2b-256 checksum
How to use checksums
301571faebc6772a1fae345da93cb4a29a8e0921b8a5549a3f8e3a4f41ef2eac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / dragonhpc-0.15.0-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL dragonhpc-0.15.0-cp312-cp312-manylinux_2_28_x86_64.whl
Size 16.9 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c738e8a5c82c9505324c13b616300578f8e1d3cba0be28f8402e37895100c143
BLAKE2b-256 checksum
How to use checksums
4e7d57727b027389f5b416759133da029d3f40dee2340bb4768159d220963f85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / dragonhpc-0.15.0-cp312-cp312-manylinux_2_28_aarch64.whl

Download URL dragonhpc-0.15.0-cp312-cp312-manylinux_2_28_aarch64.whl
Size 16.5 MB
Tags CPython 3.12 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
df1aa75694a6e068ee3fecbe9927c41fc587a704acbea51b6609fe0f4f2bd806
BLAKE2b-256 checksum
How to use checksums
81c58cf19efaa11db047c643ee0aee25e4a0d1a165ed771dd650a6c3e20617b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / dragonhpc-0.15.0-cp312-cp312-macosx_26_0_arm64.whl

Download URL dragonhpc-0.15.0-cp312-cp312-macosx_26_0_arm64.whl
Size 5.8 MB
Tags CPython 3.12 macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
9d8c84d7d67acccf86da225a9e39eb2f9dfed0d8f64aeca2d6f7e35314d5add8
BLAKE2b-256 checksum
How to use checksums
3ab461af387c7e6a1a08d3cc1ba3eccef01bc51e65932f4ddcc3d2f4afd72062
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / dragonhpc-0.15.0-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL dragonhpc-0.15.0-cp311-cp311-manylinux_2_28_x86_64.whl
Size 17.2 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c92d399aa514183b4e245d5a6ebfc8c359a9bacf7ebe5ecdaf88f1e2822d4731
BLAKE2b-256 checksum
How to use checksums
a9b579ab933e464efe50fa2b7acacf60842e38c7d96859dc1fa7aa05d8d253cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / dragonhpc-0.15.0-cp311-cp311-manylinux_2_28_aarch64.whl

Download URL dragonhpc-0.15.0-cp311-cp311-manylinux_2_28_aarch64.whl
Size 16.8 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
b819095b82700132d1aedf78969d50c65db3cb2922b8eab3cb0473a81a9ed8cf
BLAKE2b-256 checksum
How to use checksums
5da1593f96d003bf70c8b920301e44e99defa7f6efaf572e0c5d9ab09058b97d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / dragonhpc-0.15.0-cp311-cp311-macosx_26_0_arm64.whl

Download URL dragonhpc-0.15.0-cp311-cp311-macosx_26_0_arm64.whl
Size 5.9 MB
Tags CPython 3.11 macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
611db0d4301d8bbe9d8378f7009524b904753dfd446103afa11e3834759f388c
BLAKE2b-256 checksum
How to use checksums
0453c882a8ec98a819129f594a8755dd5a0c9bcf9395b81d8abb124af63ba23f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for dragonhpc 0.15.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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