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.1.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.1-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.1-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.1-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.1-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.1-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.1-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.1-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.1-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.1.tar.gz.

File metadata

  • Download URL: dftracer-2.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 f44d8d6d2aa8b71adb811442066058555a5c65e84b81ac352b820db3fdd6f0a6
MD5 3417d5ef6195fab776c0d384e98635df
BLAKE2b-256 a9ef50bd2612afb363f48c5bed41e0800a143ae84ae51b5c63447e4d9d6c92f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.1-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 3e1305c011f043280d3f7a141edd7e7e4aa45c758cd24f8591e76d2531382d7e
MD5 d0e23c76a7ea5358ebee14431975964c
BLAKE2b-256 3942ae73e23cc6d853c14c5f142b6f6204b2bf91feee3d781795b93ed9c0c4d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c4025fb421d24ae49c96ee4d9bda8b857823fa917aa227af6958517fc4c39a20
MD5 8f2416c1520bf65f0b5793f679715ad4
BLAKE2b-256 d2d02e66cff005ea240015f7db168fbef4c1f14dc8215325f9f848edd46855ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.1-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 1ea8abdbbed1b7044379b0f39bb32e8ac5a84e8a7fb1ae4016d2a3179370ba2f
MD5 667ec87340d152b5c07206c906a13d95
BLAKE2b-256 360ba47ed512a23f33ecd7416a29080429b4d0e228bdeeea8e3003877f409a14

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 873839383f2c775e5cce2ec587a02b4bdb29b56a834a988fe93ac397cc3a14e7
MD5 710f4721add30e448cb710291151efbf
BLAKE2b-256 96e6ce06e21929ee893cf24288fe5cd3038dc4f7cf7a29e36ba986413f431fb5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.1-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 74a496cb450c7b4b9c0c9fb19b97c9261e7200071c580cc047b20a23352685b9
MD5 47087ed5887a34d470238531bcd0b6d9
BLAKE2b-256 f907f6a1eaa34df4bea965f08469966f8ca7e0fcc252bccddde17cee928fd651

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d72a1a2646d3a9f79ef0d4f63f44882033c8cdaaf1d5e258edc6c98f39a90174
MD5 62d3fa3232ac2a9b8e1c23d92192de1a
BLAKE2b-256 8dd2e448b12726815d5568987eef88c3b4aa53b821fe3435590e58daada97b33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.1-cp39-cp39-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 89f54a9562c091b916ee8140a7a9c142c923bd73a5ede4ff111fe476639c98cb
MD5 bfe23e6ef0ddc5ed6561cc4e0476fbc5
BLAKE2b-256 cb7951884b11a1c800fa70bb8072a9e9202d70ce59bf8932b005204b3f31a37c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.1-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d4fbc9a0839f6b796f159baeed62cede6d702961ab2a7e9bd09d1c4594685188
MD5 25961607d8b7777c6de04918850728e0
BLAKE2b-256 6106218da8fc8106f6f3d51612ccd10d70193d4376f90c21ae6df06901e5900c

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