I/O profiler for deep learning python apps. Specifically for dlio_benchmark.
Project description
DFTracer v1.0.3
A multi-level profiler for capturing application functions and low-level system I/O calls from deep learning workloads.
Requirements for profiler
- Python > 3.7
- pybind11
Requirements for analyzer
- bokeh>=2.4.2
- pybind11
- zindex_py
- pandas>=2.0.3
- dask>=2023.5.0
- distributed
- numpy>=1.24.3
- pyarrow>=12.0.1
- rich>=13.6.0
- python-intervals>=1.10.0.post1
- matplotlib>=3.7.3
Installation
Users can easily install DFTracer using pip. This is the way most Python packages are installed. This method would work for both native Python environments and Conda environments.
From PyPI
pip install pydftracer
From Github
DFT_VERSION=dev
pip install git+https://github.com/hariharan-devarajan/dftracer.git@${DFT_VERSION}
From source
git clone git@github.com:hariharan-devarajan/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 more build instructions check here.
Usage
from dftracer.logger 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):
# print(f"{cwd}/data/demofile2.npz")
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 the profiler for each app and process.
# The name of the final log file is ~/log_file-<APP_NAME>-<PID>.pfw
DFTRACER_LOG_FILE=~/log_file
# Colon separated paths for including for profiler
DFTRACER_DATA_DIR=/dev/shm/:/p/gpfs1/$USER/dataset:$PWD/data
# Enable profiler
DFTRACER_ENABLE=1
For more example check Examples.
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
Built Distributions
Hashes for pydftracer-1.0.3-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 940a82586fa89899fd114a3e0edb2c6edb3acff25dd7e0a5044a5d614611bbf5 |
|
MD5 | a00bfc9a1dfaa1a5c6c7d975ed834856 |
|
BLAKE2b-256 | e09b1dc3cb48051a8987445f35ecd85e53b85eefefea41f490f1397aca45c8ba |
Hashes for pydftracer-1.0.3-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c4b2337c3ea7092c06456866225a1b60c442d718c140b8470a0c338e3d039b6 |
|
MD5 | db47239af7762a202339484a2f502a5d |
|
BLAKE2b-256 | 679ac03a430c110295549d741e6cfc1178d832929d09559bf7d844050645a86e |
Hashes for pydftracer-1.0.3-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdab5b92cd8c900901d26492deb60d1139e291e0182c46b963c2028090361a90 |
|
MD5 | 6add3af1275dcd2ad934af785aef81f4 |
|
BLAKE2b-256 | c6b24dc40a4eb30bd7eb29ef4988c197a4b800212281003f8b7a1ee0068a67a4 |
Hashes for pydftracer-1.0.3-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fed27ccc3863c999b5802ebee6456f34c4448198cb90b6e1b6724de002a91b52 |
|
MD5 | e4118e9fc4725592d0fe179819dfd330 |
|
BLAKE2b-256 | 30ad4a579fb147a2d7abb61c408add38d8e9bfdc59e9ba83aaf403d52e4b72fe |
Hashes for pydftracer-1.0.3-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c30f62ae29bc446981652b4317d879f8e666fe05858a92ce244776b841ea4725 |
|
MD5 | 3f85009f02785969fe6e7e637aef26be |
|
BLAKE2b-256 | 5cb67b1c76567a31574a2908d409c4dd0c8557efe91f56c00f7d4f27e8523e0d |
Hashes for pydftracer-1.0.3-cp310-cp310-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91b8b8ab3ee252a40b6ee47fc40ebca6611f4d9b52d90e6f5b0cdd065e2d14f9 |
|
MD5 | 9195f1d809528772ca0f4b52bc259fb0 |
|
BLAKE2b-256 | 8665c1e50e075a6383da4f5690c1c72ae9ef9e3e304cf853ce6786debf9208e5 |
Hashes for pydftracer-1.0.3-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b16379a9b492b938b73b3265dd97801dab1a29649f729f6a365aa083f7b18e86 |
|
MD5 | 7e6a9aab01d86df85091fa6666541315 |
|
BLAKE2b-256 | 96b8786fd9efb170af801fe7cfa3c1b7073f1ad2b6eab6c21d2b941e52dac51c |
Hashes for pydftracer-1.0.3-cp39-cp39-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b2c58d89400af1779da5379b192c915c4ae826f7786019fe258a82747990f8d |
|
MD5 | adc458ff7097e4f475127d707eaa07ca |
|
BLAKE2b-256 | 0e7b340c36a5abd2b46a88d8f513c390bbaf8ea986b662ab15ab76f51aaee6ee |
Hashes for pydftracer-1.0.3-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 921ee89ffb1f12cc3ccb0cc736d15e51b55d5feaf80b8ec1f2cb405d036f878a |
|
MD5 | 036520cf07266883bf179dd872657eb1 |
|
BLAKE2b-256 | 14d0c396d4bb5fcd4f9441b4d8e7900925e27317df28a300d720e3d7c05af762 |
Hashes for pydftracer-1.0.3-cp38-cp38-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 171c27c1e7cbc7fb0eb80c660360776d97298654fde0269fa4a8f3bd8b58a734 |
|
MD5 | 8d6cb2072f1edb97af8b2df24ee52a08 |
|
BLAKE2b-256 | 7b2a572e6ef2eaf33a3d0e168d084df0eae67bae24e570c179c0b15ace7a4bbf |
Hashes for pydftracer-1.0.3-cp37-cp37m-manylinux_2_34_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62534c0ec5b93eb9270c9621bbceebadacb3705101f7143c6a2cdbcf33671734 |
|
MD5 | 1fd9a105cf133a57fe5bb76b31f28dcc |
|
BLAKE2b-256 | 080dbb41a947222932ee8f9cba1ef03548c853bfcb7388059f9b74f8d5ee5364 |
Hashes for pydftracer-1.0.3-cp37-cp37m-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96475f70360d5557585c3a9010ba62127c9b098c65ca777fd7e4d2c1719d5be8 |
|
MD5 | b7d188e06fe42a0503f1342fc251a7b5 |
|
BLAKE2b-256 | b1161569f9d027a4d7eef2009f3381196fa548ea52c647785bba9d679ab90ab1 |