DFTracer
Version: $(cat PACKAGE_VERSION 2>/dev/null || echo "2.0.2")
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
Requirements for DFTracer
- Python>=3.7
- pybind11
Requirements for DFAnalyzer
- bokeh>=2.4.2
- dask>=2023.5.0
- distributed
- matplotlib>=3.7.3
- numpy>=1.24.3
- pandas>=2.0.3
- pyarrow>=12.0.1
- pybind11
- python-intervals>=1.10.0.post1
- rich>=13.6.0
- seaborn>=0.13.2
- zindex_py
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
pip install dftracer[dfanalyzer]
# if you want to use old version of DFAnalyzer
# pip install dftracer[dfanalyzer_old]
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. They are prereleases, so pip only takes them when asked:
pip install --pre dftracer # newest prerelease
pip install dftracer==2.1.0.post5 # a specific one
From Github
DFTRACER_VERSION=develop
pip install git+https://github.com/LLNL/dftracer.git@${DFTRACER_VERSION}
pip install git+https://github.com/LLNL/dftracer.git@${DFTRACER_VERSION}#egg=dftracer[dfanalyzer]
# if you want to use old version of DFAnalyzer
# pip install git+https://github.com/LLNL/dftracer.git@${DFTRACER_VERSION}#egg=dftracer[dfanalyzer_old]
From Source
git clone git@github.com:LLNL/dftracer.git
cd dftracer
# You can skip this for installing the dev branch.
# for latest stable version use master branch.
git checkout tags/<Release> -b <Release>
pip install .
With MPI, HDF5 or HIP support
These are compile-time options, so they need a build against the libraries you
actually run with. The prebuilt wheel cannot carry them: DFTracer intercepts
calls into the MPI/HDF5 library the application loads, and the interception is
generated for a specific implementation and version, so a wheel built elsewhere
would trace nothing. Build from the source distribution instead, 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 built automatically. Their source archives ship inside the source distribution, so a source install needs no access to their repositories. When building from a git clone, fetch the ones that are not committed first:
scripts/wheel/fetch_deps.sh
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
from dftracer.python import dftracer, dft_fn
log_inst = dftracer.initialize_log(logfile=None, data_dir=None, process_id=-1)
dft_fn = dft_fn("COMPUTE")
# 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)
with get_context('spawn').Pool(1, initializer=init) as pool:
pool.map(posix_calls, ((2, True),))
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
- Building DFTracer: https://dftracer.readthedocs.io/en/latest/build.html
- Integrating DFTracer: https://dftracer.readthedocs.io/en/latest/examples.html
- Visualizing DFTracer Traces: https://dftracer.readthedocs.io/en/latest/perfetto.html
- Building DFAnalyzer: https://dftracer.readthedocs.io/en/latest/dfanalyzer_build.html
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/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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dftracer-2.1.0.post21-cp314-cp314-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: dftracer-2.1.0.post21-cp314-cp314-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 10.9 MB
- Tags: CPython 3.14, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b605dccfe8d53967e3e4fa5a7c78b1d0c7cb0b768526172ae1962612ab3386b
|
|
| MD5 |
d06a22cf4eecbe4be8bf916b5db22a34
|
|
| BLAKE2b-256 |
1f17c42ab2fd219d57fab5dffcb4b287c4e7036a087234b98dd6735d3612bc79
|
File details
Details for the file dftracer-2.1.0.post21-cp313-cp313-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: dftracer-2.1.0.post21-cp313-cp313-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 10.9 MB
- Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0dbd295fb6afda1df23f5ecf3861d13209417294d70ca885c4eb809351a68610
|
|
| MD5 |
d8266ccb0c16761360c7fc6e852ee463
|
|
| BLAKE2b-256 |
6bb1939f7054c2ab69447933b7cbaf09e3e70971867a8636418779b737ffedfd
|
File details
Details for the file dftracer-2.1.0.post21-cp312-cp312-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: dftracer-2.1.0.post21-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 10.9 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
193fcc8fcc8baef71f4df9e460d7dfaae3690a95a310bdc54ebb674bb23630b4
|
|
| MD5 |
8817ddcec184e52694d1112a64543891
|
|
| BLAKE2b-256 |
5a4aa42576b872a12d50f8ade24b579859d6d66fa8aaf361bfff6c73c214f9e0
|
File details
Details for the file dftracer-2.1.0.post21-cp311-cp311-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: dftracer-2.1.0.post21-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 10.9 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a44ff242f51ba8f664433bce458e969f4fea4a859ecca6714b61845b9414f818
|
|
| MD5 |
b5324a782ad89e8d1ba154a4b1fe7a1d
|
|
| BLAKE2b-256 |
d4feba1389458da9dc78db908b633f0ab85e15e2e16bdfc81bd41cfb0947caf9
|
File details
Details for the file dftracer-2.1.0.post21-cp310-cp310-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: dftracer-2.1.0.post21-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 10.9 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c065bd255c89f4beeca90b8cc09412a1e3ba447c00076b10ac2f7939069ab882
|
|
| MD5 |
cc5ee70532ce85564430f28b164fd7f3
|
|
| BLAKE2b-256 |
8b0a3047828713f0268e495a7bb7f17ce6919cb8aeb7ae3072b876df9389c48f
|
File details
Details for the file dftracer-2.1.0.post21-cp39-cp39-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: dftracer-2.1.0.post21-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 10.9 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c999cea7d1255db97a0904db44c03fb4f2780ef50f50020c5d3736cc61a16f4
|
|
| MD5 |
243365c19e8e6196da525d0d34b7e8f0
|
|
| BLAKE2b-256 |
80b25534964087864db6ac9a0b7a357e08d5855de60855cfeb02bffe3f4647a9
|