Skip to main content

I/O profiler for deep learning python apps. Specifically for dlio_benchmark.

Project description

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

Requirements for DFTracer

  1. Python>=3.7
  2. pybind11

Requirements for DFAnalyzer

  1. bokeh>=2.4.2
  2. dask>=2023.5.0
  3. distributed
  4. matplotlib>=3.7.3
  5. numpy>=1.24.3
  6. pandas>=2.0.3
  7. pyarrow>=12.0.1
  8. pybind11
  9. python-intervals>=1.10.0.post1
  10. rich>=13.6.0
  11. seaborn>=0.13.2
  12. 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]

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]

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 .

For detailed build instructions, click here.

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

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.

Project details


Download files

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

Source Distribution

dftracer-2.0.0.tar.gz (13.7 MB view details)

Uploaded Source

Built Distributions

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

dftracer-2.0.0-cp312-cp312-manylinux_2_39_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

dftracer-2.0.0-cp312-cp312-manylinux_2_34_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

dftracer-2.0.0-cp311-cp311-manylinux_2_39_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

dftracer-2.0.0-cp311-cp311-manylinux_2_34_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

dftracer-2.0.0-cp310-cp310-manylinux_2_39_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

dftracer-2.0.0-cp310-cp310-manylinux_2_34_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

dftracer-2.0.0-cp39-cp39-manylinux_2_39_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.39+ x86-64

dftracer-2.0.0-cp39-cp39-manylinux_2_34_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

File details

Details for the file dftracer-2.0.0.tar.gz.

File metadata

  • Download URL: dftracer-2.0.0.tar.gz
  • Upload date:
  • Size: 13.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.24

File hashes

Hashes for dftracer-2.0.0.tar.gz
Algorithm Hash digest
SHA256 6e9df5dc10657ffa66511cff989d2297dab2961fa97ef8e7a53687f225abc84a
MD5 9e4a63ba5e11ece3d444ee7605dd0797
BLAKE2b-256 c52902046cd6083cfd29f4b1c2c8b7e68d91855d6a099cc6d215690d3cd74810

See more details on using hashes here.

File details

Details for the file dftracer-2.0.0-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.0.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 61957652b6ac4b801ffbc4e2e42680052fa83a30e77a35712e1fae9d5f73cc8a
MD5 05da215423dfe7898ebb194482974661
BLAKE2b-256 9c8938dab148d878a790c890d94e62710c4ef48cd21d7714524efd2fb9a217e4

See more details on using hashes here.

File details

Details for the file dftracer-2.0.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.0.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 53820d0e31cd3646fca129e9685cf8dc65cf742dbdb72b14ba81dc97f7a7247f
MD5 c491d0efdc72fefaa41468805d5a4001
BLAKE2b-256 d505567859b070ca98e6774fecdceccf300eb185f56c9082ebb8487309e15b72

See more details on using hashes here.

File details

Details for the file dftracer-2.0.0-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.0.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 0b1c90854fd32ccf2e98ee95321e07a42b77d35237a09673d3c7b1b47d2e5bf1
MD5 518f7569b8f29520ffa87d80652f609b
BLAKE2b-256 533f4472a6c14a8eb453a0d174a2294ad9d9d4bdf3a2d9fc413213ab03d7b401

See more details on using hashes here.

File details

Details for the file dftracer-2.0.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.0.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a8d71bd96ef60382e64e743c3619fadfdda4121881a721cadfc9a1551a61a57e
MD5 db6288017af2f6920d0687b65b12bfc8
BLAKE2b-256 2078c08800064aacbe9f469b5cec2a3824ba941107f0077917b45cc61c52d67e

See more details on using hashes here.

File details

Details for the file dftracer-2.0.0-cp310-cp310-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.0.0-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 425906227675f75c2810dd77fecdf1914620768df5bbc0ae7101f5a91a72e081
MD5 d47d0340e123f5b00e41c2da871f3912
BLAKE2b-256 5f08877369594d1bd125443b737a10e9bc5b2a5d9b953694214c9a5b4dad6a18

See more details on using hashes here.

File details

Details for the file dftracer-2.0.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.0.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 deb0e06eee9b019685ed3eb17300da55884c99c662170d77d0fbecba55609d9e
MD5 6a8ab39962bfdd1f9ccca02c44ca9cd8
BLAKE2b-256 c473daf8cc8329e0324a455c2a236fbfc5ce4e3612d4a481f3e70f9e194f3739

See more details on using hashes here.

File details

Details for the file dftracer-2.0.0-cp39-cp39-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.0.0-cp39-cp39-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 42844226b8c4e4f66f58d8c58e84908a65dee161eebf9f0129dc8de362fd2082
MD5 7e9333025cb4baf6ee4148cbd9e5c2da
BLAKE2b-256 65a656daaf6c820696d3272f038681cca51c2538f4bb3e9113fc2af2614b9da1

See more details on using hashes here.

File details

Details for the file dftracer-2.0.0-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.0.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 84d3d3eb40ba210d251fb1cdecae0036f637f2a4cc333fd37d58ab407457445d
MD5 2c3e97330d2f36c40029b2ad0fa3e608
BLAKE2b-256 c6fab178f61f89750cb62291a9e06beea40b40e3538e7f6dc577ec00a1c88150

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page