Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

DFTracer logo

DFTracer

Build and Test Documentation Status PyPI - Version PyPI - Wheel PyPI - Python Version PyPI - License

Overview

DFTracer is a tracing tool designed to capture both application-code and I/O-call level events from workflows. It provides a unified tracing interface, optimized trace format, and compression mechanism to enable efficient distributed analysis for large-scale AI-driven workloads.

Prerequisites

  1. Python>=3.7
  2. For building from source: a C++17 compiler (GCC 9 or newer) and CMake 3.24 or newer. See With MPI, HDF5 or HIP support.

The prebuilt wheel needs nothing beyond Python. Build tools such as pybind11 are installed by pip automatically.

Installation

Users can easily install DFTracer using pip, the standard tool for installing Python packages. This method works for both native Python and Conda environments.

From PyPI

pip install dftracer
# DFAnalyzer (trace analysis) is a separate package; it needs Python>=3.9
pip install dftracer[dfanalyzer]

This installs a prebuilt wheel that traces POSIX and STDIO I/O. It needs nothing from the host, but it cannot trace MPI, HDF5 or HIP — see With MPI, HDF5 or HIP support.

Development builds are published from every merge into develop, versioned <last release>.postN.dev0, as both wheels and an sdist:

pip install --pre dftracer          # newest prerelease
pip install dftracer==2.1.0.post5.dev0   # a specific one

From Github

DFTRACER_VERSION=develop
pip install git+https://github.com/llnl-asr/dftracer.git@${DFTRACER_VERSION}
pip install "dftracer[dfanalyzer] @ git+https://github.com/llnl-asr/dftracer.git@${DFTRACER_VERSION}"

From Source

git clone https://github.com/llnl-asr/dftracer.git
cd dftracer
# This builds the develop branch. For a release, check out its tag instead:
# git checkout tags/<Release> -b <Release>
pip install .

With MPI, HDF5 or HIP support

MPI, HDF5 and HIP support has to match the libraries you run with: DFTracer intercepts calls into the MPI/HDF5 library the application loads, and the interception is generated for a specific implementation and version. There are two ways to get that.

Compose prebuilt modules. dftracer-modules ships that support prebuilt for each library version, and dftracer-compose links the ones that fit the machine (building any it lacks from source). Run it in the environment you trace in, with CMake 3.24 or newer available:

pip install "dftracer[modules]"
dftracer-compose                        # link what this machine needs
dftracer_install_info --composition     # show what got linked

See Composable install for details.

Or build from source, the way mpi4py does:

# MPI and HDF5 must be discoverable by CMake (module load, spack load, ...)
DFTRACER_ENABLE_MPI=ON DFTRACER_ENABLE_HDF5=ON \
  pip install --no-binary dftracer dftracer

--no-binary dftracer is what makes pip build from source rather than take the wheel. Only dftracer itself is built from source; its build tools still come as wheels. The same works for a checkout (pip install .) or a release tarball.

The options below are read from the environment by setup.py and passed to CMake. All default to OFF unless stated:

Variable Effect
DFTRACER_ENABLE_MPI MPI rank in traces and MPI/MPI-IO interception
DFTRACER_ENABLE_HDF5 HDF5 interception
DFTRACER_ENABLE_HIP_TRACING AMD GPU tracing, needs ROCm/rocprofiler-sdk
DFTRACER_ENABLE_FTRACING function tracing via -finstrument-functions
DFTRACER_ENABLE_DYNAMIC_DETECTION detect HWLOC, MPI and HIP at run time instead of link time
DFTRACER_DISABLE_HWLOC HWLOC support, ON (disabled) by default
DFTRACER_MPI_IMPL override MPI implementation detection
DFTRACER_BUILD_TYPE Release (default) or Debug

Requirements for a source build: a C++17 compiler whose standard library provides std::filesystem (GCC 9 or newer; note that a system libstdc++ older than the compiler on the PATH can shadow it and fail the link), CMake 3.24 or newer, and the development packages of whatever you enable.

The C/C++ dependencies (cpp-logger, GOTCHA, brahma, yaml-cpp, libuv) are cloned and built automatically, so a source install needs access to their GitHub repositories.

To confirm the build traces what you enabled, run your application with DFTRACER_ENABLE=1 and check that the trace contains the matching categories (MPI, MPIIO, HDF5) and not only POSIX.

For detailed build instructions see docs/build.rst in this repository, or the rendered documentation when it is reachable.

Usage

import os
from multiprocessing import get_context
from time import sleep

import numpy as np
from dftracer.python import dftracer, dft_fn

cwd = os.getcwd()
os.makedirs(f"{cwd}/data", exist_ok=True)

log_inst = dftracer.initialize_log(logfile=None, data_dir=None, process_id=-1)
dft_fn = dft_fn("COMPUTE")

# Initializer for spawned workers, so they also trace.
def init():
    dftracer.initialize_log(logfile=None, data_dir=None, process_id=-1)

# Example of using function decorators
@dft_fn.log
def log_events(index):
    sleep(1)

# Example of function spawning and implicit I/O calls
def posix_calls(val):
    index, is_spawn = val
    path = f"{cwd}/data/demofile{index}.txt"
    f = open(path, "w+")
    f.write("Now the file has more content!")
    f.close()
    if is_spawn:
        print(f"Calling spawn on {index} with pid {os.getpid()}")
        log_inst.finalize() # This need to be called to correctly finalize DFTracer.
    else:
        print(f"Not calling spawn on {index} with pid {os.getpid()}")

# NPZ calls internally calls POSIX calls.
def npz_calls(index):
    path = f"{cwd}/data/demofile{index}.npz"
    if os.path.exists(path):
        os.remove(path)
    records = np.random.randint(255, size=(8, 8, 1024), dtype=np.uint8)
    record_labels = [0] * 1024
    np.savez(path, x=records, y=record_labels)

def main():
    log_events(0)
    npz_calls(1)
    pool = get_context('spawn').Pool(1, initializer=init)
    pool.map(posix_calls, ((2, True),))
    pool.close()
    pool.join()
    log_inst.finalize()

if __name__ == "__main__":
    main()

For this example, as the dftracer.initialize_log do not pass logfile or data_dir, we need to set DFTRACER_LOG_FILE and DFTRACER_DATA_DIR. By default the DFTracer mode is set to FUNCTION. Example of running this configurations are:

# The process id, app_name and .pfw will be appended by DFTracer for each app and process.
# The name of the final log file will be ~/log_file-<APP_NAME>-<PID>.pfw
DFTRACER_LOG_FILE=~/log_file
# Colon separated paths to include in the tracing
DFTRACER_DATA_DIR=/dev/shm/:/p/gpfs1/$USER/dataset:$PWD/data
# Enable DFTracer
DFTRACER_ENABLE=1

For more examples, click here.

Documentation

Citation and Reference

The original SC'24 paper describes the design and implementation of the DFTracer code. Please cite this paper and the code if you use DFTracer in your research.

@inproceedings{devarajan_dftracer_2024,
    address = {Atlanta, GA},
    title = {{DFTracer}: {An} {Analysis}-{Friendly} {Data} {Flow} {Tracer} for {AI}-{Driven} {Workflows}},
    shorttitle = {{DFTracer}},
    urldate = {2024-07-31},
    booktitle = {{SC24}: {International} {Conference} for {High} {Performance} {Computing}, {Networking}, {Storage} and {Analysis}},
    publisher = {IEEE},
    author = {Devarajan, Hariharan and Pottier, Loic and Velusamy, Kaushik and Zheng, Huihuo and Yildirim, Izzet and Kogiou, Olga and Yu, Weikuan and Kougkas, Anthony and Sun, Xian-He and Yeom, Jae Seung and Mohror, Kathryn},
    month = nov,
    year = {2024},
}

@misc{devarajan_dftracer_code_2024,
    type = {Github},
    title = {Github {DFTracer}},
    shorttitle = {{DFTracer}},
    url = {https://github.com/llnl-asr/dftracer.git},
    urldate = {2024-07-31},
    journal = {DFTracer: A multi-level dataflow tracer for capture I/O calls from worklows.},
    author = {Devarajan, Hariharan and Pottier, Loic and Velusamy, Kaushik and Zheng, Huihuo and Yildirim, Izzet and Kogiou, Olga and Yu, Weikuan and Kougkas, Anthony and Sun, Xian-He and Yeom, Jae Seung and Mohror, Kathryn},
    month = jun,
    year = {2024},
}

Acknowledgments

This work was performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344; and under the auspices of the National Cancer Institute (NCI) by Frederick National Laboratory for Cancer Research (FNLCR) under Contract 75N91019D00024. This research used resources of the Argonne Leadership Computing Facility, a U.S. Department of Energy (DOE) Office of Science user facility at Argonne National Laboratory and is based on research supported by the U.S. DOE Office of Science-Advanced Scientific Computing Research Program, under Contract No. DE-AC02-06CH11357. Office of Advanced Scientific Computing Research under the DOE Early Career Research Program. Also, This material is based upon work partially supported by LLNL LDRD 23-ERD-045 and 24-SI-005. LLNL-CONF-857447.

License

DFTracer is distributed under the terms of the MIT license. All new contributions must be made under this license.

See LICENSE and NOTICE for details.

SPDX-License-Identifier: MIT

LLNL-CODE-2024514 — Applied Storage Research (ASR)

Metadata

Release files for dftracer 2.3.0.post11.dev0

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

Source distribution (sdist)

Source distribution for dftracer 2.3.0.post11.dev0
File Size Uploaded Provenance Actions
dftracer-2.3.0.post11.dev0.tar.gz 13.9 MB Without provenance Details for dftracer-2.3.0.post11.dev0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for dftracer 2.3.0.post11.dev0
File Actions
dftracer-2.3.0.post11.dev0-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details for dftracer-2.3.0.post11.dev0-cp314-cp314-manylinux_2_28_x86_64.whl
dftracer-2.3.0.post11.dev0-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details for dftracer-2.3.0.post11.dev0-cp313-cp313-manylinux_2_28_x86_64.whl
dftracer-2.3.0.post11.dev0-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for dftracer-2.3.0.post11.dev0-cp312-cp312-manylinux_2_28_x86_64.whl
dftracer-2.3.0.post11.dev0-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for dftracer-2.3.0.post11.dev0-cp311-cp311-manylinux_2_28_x86_64.whl
dftracer-2.3.0.post11.dev0-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details for dftracer-2.3.0.post11.dev0-cp310-cp310-manylinux_2_28_x86_64.whl
dftracer-2.3.0.post11.dev0-cp39-cp39-manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64 Details for dftracer-2.3.0.post11.dev0-cp39-cp39-manylinux_2_28_x86_64.whl

Total release size: 176.4 MB

Release files / dftracer-2.3.0.post11.dev0.tar.gz

Download URL dftracer-2.3.0.post11.dev0.tar.gz
Size 13.9 MB
Tags Source
SHA-256 checksum
How to use checksums
21e35a39767144c018465b495e346774d919b27dfd53617daabe04dee3e9f8f9
BLAKE2b-256 checksum
How to use checksums
b3e93f703d4e109ad31aa5387dcf1e4af56e87438553ab4a68f50fb1672ece64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / dftracer-2.3.0.post11.dev0-cp314-cp314-manylinux_2_28_x86_64.whl

Download URL dftracer-2.3.0.post11.dev0-cp314-cp314-manylinux_2_28_x86_64.whl
Size 27.1 MB
Tags CPython 3.14 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f41036bbeae37bfd62593d59df15ce474a6a98147c0b4d63cb9fd974140f3eb3
BLAKE2b-256 checksum
How to use checksums
8700dff47483866a0bc92e1b761de66ad948444bae51b57b2d7af1a7c251d118
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / dftracer-2.3.0.post11.dev0-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL dftracer-2.3.0.post11.dev0-cp313-cp313-manylinux_2_28_x86_64.whl
Size 27.1 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
30482d76a54edfed0085df0ad694069c623afca2d81aa2ad3181c3db658b28fa
BLAKE2b-256 checksum
How to use checksums
92ca26fb9bf8c96f6bdbf2d565cd50ec1ec9bfe2fd15bfdde04513e8c0080c09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / dftracer-2.3.0.post11.dev0-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL dftracer-2.3.0.post11.dev0-cp312-cp312-manylinux_2_28_x86_64.whl
Size 27.1 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
5b372d5f5a35e1857554c44cc30a6fdb56fc6f47b1156c0430d7ba5c10d8319d
BLAKE2b-256 checksum
How to use checksums
4e608b61bf3ce5da27d8dece2328b558ed7678e0e6028781a8720bbacea4ba3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / dftracer-2.3.0.post11.dev0-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL dftracer-2.3.0.post11.dev0-cp311-cp311-manylinux_2_28_x86_64.whl
Size 27.1 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
4d423894940ab6479e160a374d7209f990c1870445f21e5c6d7999aa44f0eb9c
BLAKE2b-256 checksum
How to use checksums
87e6af39b5cb2edbd20792aa35f8acea6991aace8223cdf468991d11a4575ecb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / dftracer-2.3.0.post11.dev0-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL dftracer-2.3.0.post11.dev0-cp310-cp310-manylinux_2_28_x86_64.whl
Size 27.1 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8af933de985534b06f93cada2fd050dae52dc07c0e887f54710ad7e0f83b8c51
BLAKE2b-256 checksum
How to use checksums
d413f75e74b6afd93c73f217fa89e6dc487df42696ec3536ed315987619a5afb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / dftracer-2.3.0.post11.dev0-cp39-cp39-manylinux_2_28_x86_64.whl

Download URL dftracer-2.3.0.post11.dev0-cp39-cp39-manylinux_2_28_x86_64.whl
Size 27.1 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
21b05199ce4e23c729cd7815c78707e39c8e6dbd3329e924833ab3b19dd97f6d
BLAKE2b-256 checksum
How to use checksums
9f1fdacc8e0cb239647993a9fdd6adb93afbbed19685c4f78b5513173e17f383
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for dftracer 2.3.0.post11.dev0

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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