Skip to main content

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

Project description

DFTracer

Version: $(cat PACKAGE_VERSION 2>/dev/null || echo "2.0.2")

Build and Test Coverage Status 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]
# if you want to use old version of DFAnalyzer
# pip install dftracer[dfanalyzer_old]

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 .

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.3.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.3-cp312-cp312-manylinux_2_39_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

dftracer-2.0.3-cp312-cp312-manylinux_2_34_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

dftracer-2.0.3-cp311-cp311-manylinux_2_39_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

dftracer-2.0.3-cp311-cp311-manylinux_2_34_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

dftracer-2.0.3-cp310-cp310-manylinux_2_39_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

dftracer-2.0.3-cp310-cp310-manylinux_2_34_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

dftracer-2.0.3-cp39-cp39-manylinux_2_39_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.39+ x86-64

dftracer-2.0.3-cp39-cp39-manylinux_2_34_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

File details

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

File metadata

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

File hashes

Hashes for dftracer-2.0.3.tar.gz
Algorithm Hash digest
SHA256 c1dbd5bb6dbada0e96f5f3e9ff89bd2a3dc701d140fa7ff1543cbc066401657c
MD5 f0dc1111ea9bde27b2665791f950b71c
BLAKE2b-256 6558a5e553828e6dfa2cd0c1cb963e4e09288483374659b8176e95e5117b930d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.3-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 e04d86bfdae54efe5b4776cd45fb98c38a75120e62a0a7cf96c6d944c3398f85
MD5 c8f7ce2464d907974198a304960d2ad3
BLAKE2b-256 37c8b4cf20da87cd4e726a5201ba6e78b519827be8853ef75acf9f3ba06c1e00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.3-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 dd7bd6203ee04e427d93d4e066233b1c3cc6b4e02fc680dcdbf3d582951d811b
MD5 6eb615aa7e5a6b947a0a014423d04f4f
BLAKE2b-256 9c08a8c6137c36621c0980e0ef0b1bcd20cc12dc5997edce922ca04e38202237

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.3-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 303d0aee463f57f42c56c2938a04eea2a1b97c39ad42b42f633e35da9730b65f
MD5 a21aff201b3f0ddf810b837cfb5dd589
BLAKE2b-256 5a501cd0e922cdca7ee180e8c31a00520b2053441bbc51a6015c877c1f12cc59

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.3-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 25700d75fbe6b83b9d6b61d52c5df720bc08d7c5bec8e8bdbf19e41a3a1465bb
MD5 c20cbb7d6d362b8567b51ef688c8aa12
BLAKE2b-256 5577b2e5a193762e7f2d0eb502a47d66a4d348b3d47dcc2666c02c1bae90eea7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.3-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 2233e13de1f0c086885617c99a671812fc808a3dd6b3945cf33b16eec18b4951
MD5 335600e8d2da8e3af20ef86581a8b0ec
BLAKE2b-256 98b36061d1ae2a2a6fe09f340f3233facc64d454980b58b9cebffa15bec14515

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.3-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5804957042a2dd7e067b2f7031876030aa83bc5da6013c8924f3a50bc1f1b7e9
MD5 f7aee5657dbf0906b81419094d3a41db
BLAKE2b-256 37337c49c22c70e9f62d5c0bd7900c65d8a6f29452737befb1892ad075c17ef3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.3-cp39-cp39-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 ccb82930f1c0ec509ba6556edc81fe7f5c32c6e0b8deda6a9a82a098ced0dc4d
MD5 d3ab17d9a71bfd69f0df9f6bad6e3d06
BLAKE2b-256 9f6df3041441d67a2dde6222032a1c240f650f97ce30fdf647b6707f04d396a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dftracer-2.0.3-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 03255465cd3493c4725c15cf59d067c025ff73c37cf78a773eb5bb79736b4aef
MD5 e55b2e6f9b6c762cd0e1cf1190df6cd3
BLAKE2b-256 c93d318eca57d0a4d9c6a880873b19415f147a4ab373117bbf0d6a723d25a372

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