dlio-profiler-py


Namedlio-profiler-py JSON
Version 0.0.5 PyPI version JSON
download
home_pagehttps://github.com/hariharan-devarajan/dlio-profiler
SummaryI/O profiler for deep learning python apps. Specifically for dlio_benchmark.
upload_time2024-04-06 19:21:53
maintainerNone
docs_urlNone
authorHariharan Devarajan (Hari)
requires_python>=3.7
licenseNone
keywords profiler deep learning i/o benchmark npz pytorch benchmark tensorflow benchmark
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![DLIO Profiler Build and Test](https://github.com/hariharan-devarajan/dlio-profiler/actions/workflows/ci.yml/badge.svg)](https://github.com/hariharan-devarajan/dlio-profiler/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/hariharan-devarajan/dlio-profiler/badge.svg?branch=feature/apis)](https://coveralls.io/github/hariharan-devarajan/dlio-profiler?branch=dev)
[![Documentation Status](https://readthedocs.org/projects/dlio-profiler/badge/?version=latest)](https://dlio-profiler.readthedocs.io/en/latest/?badge=latest)

# DLIO Profiler v0.0.5
A multi-level profiler for capturing application functions and low-level system I/O calls from deep learning workloads.

Requirements for profiler
1. Python > 3.7
2. pybind11


Requirements for analyzer
1. bokeh>=2.4.2
2. pybind11
3. [zindex_py](https://github.com/hariharan-devarajan/zindex.git)
4. pandas>=2.0.3
5. dask>=2023.5.0
6. distributed
7. numpy>=1.24.3
8. pyarrow>=12.0.1
9. rich>=13.6.0
10. python-intervals>=1.10.0.post1
11. matplotlib>=3.7.3

## Build DLIO Profiler with pip

Users can easily install DLIO profiler using pip. This is the way most python packages are installed.
This method would work for both native python environments and conda environments.

### From source

```bash
    git clone git@github.com:hariharan-devarajan/dlio-profiler.git
    cd dlio-profiler
    # You can skip this for installing the dev branch.
    # for latest stable version use master branch.
    git checkout tags/<Release> -b <Release>
    pip install .
```

### From Github

```bash
DLP_VERSION=dev
pip install git+https://github.com/hariharan-devarajan/dlio-profiler.git@${DLP_VERSION}
```

For more build instructions check [here](https://dlio-profiler.readthedocs.io/en/latest/build.html)

Usage

```
    from dlio_profiler.logger import dlio_logger, fn_interceptor
    log_inst = dlio_logger.initialize_log(logfile=None, data_dir=None, process_id=-1)
    dlio_log = fn_interceptor("COMPUTE")

    # Example of using function decorators
    @dlio_log.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 DLIO Profiler.
        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 DLIO_PROFILER_CPP_INIT do not pass log file or data dir, we need to set ``DLIO_PROFILER_LOG_FILE`` and ``DLIO_PROFILER_DATA_DIR``.
By default the DLIO Profiler 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.
    # name of final log file is ~/log_file-<APP_NAME>-<PID>.pfw
    DLIO_PROFILER_LOG_FILE=~/log_file
    # Colon separated paths for including for profiler
    DLIO_PROFILER_DATA_DIR=/dev/shm/:/p/gpfs1/$USER/dataset:$PWD/data
    # Enable profiler
    DLIO_PROFILER_ENABLE=1
```

For more example check [Examples](https://dlio-profiler.readthedocs.io/en/latest/examples.html).




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hariharan-devarajan/dlio-profiler",
    "name": "dlio-profiler-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "profiler, deep learning, I/O, benchmark, NPZ, pytorch benchmark, tensorflow benchmark",
    "author": "Hariharan Devarajan (Hari)",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/57/28/0f21bc99b5b081b576b371cd0bfbd5d0002030b8f30574a91d0c18f9817b/dlio_profiler_py-0.0.5.tar.gz",
    "platform": null,
    "description": "[![DLIO Profiler Build and Test](https://github.com/hariharan-devarajan/dlio-profiler/actions/workflows/ci.yml/badge.svg)](https://github.com/hariharan-devarajan/dlio-profiler/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/github/hariharan-devarajan/dlio-profiler/badge.svg?branch=feature/apis)](https://coveralls.io/github/hariharan-devarajan/dlio-profiler?branch=dev)\n[![Documentation Status](https://readthedocs.org/projects/dlio-profiler/badge/?version=latest)](https://dlio-profiler.readthedocs.io/en/latest/?badge=latest)\n\n# DLIO Profiler v0.0.5\nA multi-level profiler for capturing application functions and low-level system I/O calls from deep learning workloads.\n\nRequirements for profiler\n1. Python > 3.7\n2. pybind11\n\n\nRequirements for analyzer\n1. bokeh>=2.4.2\n2. pybind11\n3. [zindex_py](https://github.com/hariharan-devarajan/zindex.git)\n4. pandas>=2.0.3\n5. dask>=2023.5.0\n6. distributed\n7. numpy>=1.24.3\n8. pyarrow>=12.0.1\n9. rich>=13.6.0\n10. python-intervals>=1.10.0.post1\n11. matplotlib>=3.7.3\n\n## Build DLIO Profiler with pip\n\nUsers can easily install DLIO profiler using pip. This is the way most python packages are installed.\nThis method would work for both native python environments and conda environments.\n\n### From source\n\n```bash\n    git clone git@github.com:hariharan-devarajan/dlio-profiler.git\n    cd dlio-profiler\n    # You can skip this for installing the dev branch.\n    # for latest stable version use master branch.\n    git checkout tags/<Release> -b <Release>\n    pip install .\n```\n\n### From Github\n\n```bash\nDLP_VERSION=dev\npip install git+https://github.com/hariharan-devarajan/dlio-profiler.git@${DLP_VERSION}\n```\n\nFor more build instructions check [here](https://dlio-profiler.readthedocs.io/en/latest/build.html)\n\nUsage\n\n```\n    from dlio_profiler.logger import dlio_logger, fn_interceptor\n    log_inst = dlio_logger.initialize_log(logfile=None, data_dir=None, process_id=-1)\n    dlio_log = fn_interceptor(\"COMPUTE\")\n\n    # Example of using function decorators\n    @dlio_log.log\n    def log_events(index):\n        sleep(1)\n\n    # Example of function spawning and implicit I/O calls\n    def posix_calls(val):\n        index, is_spawn = val\n        path = f\"{cwd}/data/demofile{index}.txt\"\n        f = open(path, \"w+\")\n        f.write(\"Now the file has more content!\")\n        f.close()\n        if is_spawn:\n            print(f\"Calling spawn on {index} with pid {os.getpid()}\")\n            log_inst.finalize() # This need to be called to correctly finalize DLIO Profiler.\n        else:\n            print(f\"Not calling spawn on {index} with pid {os.getpid()}\")\n\n    # NPZ calls internally calls POSIX calls.\n    def npz_calls(index):\n        # print(f\"{cwd}/data/demofile2.npz\")\n        path = f\"{cwd}/data/demofile{index}.npz\"\n        if os.path.exists(path):\n            os.remove(path)\n        records = np.random.randint(255, size=(8, 8, 1024), dtype=np.uint8)\n        record_labels = [0] * 1024\n        np.savez(path, x=records, y=record_labels)\n\n    def main():\n        log_events(0)\n        npz_calls(1)\n        with get_context('spawn').Pool(1, initializer=init) as pool:\n            pool.map(posix_calls, ((2, True),))\n        log_inst.finalize()\n\n\n    if __name__ == \"__main__\":\n        main()\n\n```\n\nFor this example, as the DLIO_PROFILER_CPP_INIT do not pass log file or data dir, we need to set ``DLIO_PROFILER_LOG_FILE`` and ``DLIO_PROFILER_DATA_DIR``.\nBy default the DLIO Profiler mode is set to FUNCTION.\nExample of running this configurations are:\n\n```\n\n    # the process id, app_name and .pfw will be appended by the profiler for each app and process.\n    # name of final log file is ~/log_file-<APP_NAME>-<PID>.pfw\n    DLIO_PROFILER_LOG_FILE=~/log_file\n    # Colon separated paths for including for profiler\n    DLIO_PROFILER_DATA_DIR=/dev/shm/:/p/gpfs1/$USER/dataset:$PWD/data\n    # Enable profiler\n    DLIO_PROFILER_ENABLE=1\n```\n\nFor more example check [Examples](https://dlio-profiler.readthedocs.io/en/latest/examples.html).\n\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "I/O profiler for deep learning python apps. Specifically for dlio_benchmark.",
    "version": "0.0.5",
    "project_urls": {
        "Bug Reports": "https://github.com/hariharan-devarajan/dlio-profiler/issues",
        "Homepage": "https://github.com/hariharan-devarajan/dlio-profiler",
        "Source": "https://github.com/hariharan-devarajan/dlio-profiler"
    },
    "split_keywords": [
        "profiler",
        " deep learning",
        " i/o",
        " benchmark",
        " npz",
        " pytorch benchmark",
        " tensorflow benchmark"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6d0dcb2a28165a3454877af0d47cd64d58f1670066cf830f3896aa75b79d1cd5",
                "md5": "70005edc5de2a077588348311fb03c6c",
                "sha256": "2ada6688b9a02b5156053d0b8190668f6a75f506d0c54a90f088b21b8b1e0743"
            },
            "downloads": -1,
            "filename": "dlio_profiler_py-0.0.5-cp310-cp310-manylinux_2_31_x86_64.whl",
            "has_sig": false,
            "md5_digest": "70005edc5de2a077588348311fb03c6c",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.7",
            "size": 3550442,
            "upload_time": "2024-04-06T19:21:54",
            "upload_time_iso_8601": "2024-04-06T19:21:54.871837Z",
            "url": "https://files.pythonhosted.org/packages/6d/0d/cb2a28165a3454877af0d47cd64d58f1670066cf830f3896aa75b79d1cd5/dlio_profiler_py-0.0.5-cp310-cp310-manylinux_2_31_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9b706ab565a3fa082e4ca91bea1867d290d64140f5affd91e48e1055f1c1db24",
                "md5": "f9009b1c569402d676f7fa829a75a3c3",
                "sha256": "9ec3a0ce86029dafcafe192fdc1abb745683bf7017f7d548e0585657643f64be"
            },
            "downloads": -1,
            "filename": "dlio_profiler_py-0.0.5-cp310-cp310-manylinux_2_34_x86_64.whl",
            "has_sig": false,
            "md5_digest": "f9009b1c569402d676f7fa829a75a3c3",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.7",
            "size": 2902154,
            "upload_time": "2024-04-06T19:21:49",
            "upload_time_iso_8601": "2024-04-06T19:21:49.374115Z",
            "url": "https://files.pythonhosted.org/packages/9b/70/6ab565a3fa082e4ca91bea1867d290d64140f5affd91e48e1055f1c1db24/dlio_profiler_py-0.0.5-cp310-cp310-manylinux_2_34_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b520f05447d3d4f6d32dae0a96e0554bccda99ee92bc5388a33fd167dec3cb20",
                "md5": "7bfe61b2c0ab683d34b60bc3d34d16e7",
                "sha256": "1082103fe9e53f6d32f7b62aad7f75e5c769278b9a159e840472d8fdce181721"
            },
            "downloads": -1,
            "filename": "dlio_profiler_py-0.0.5-cp37-cp37m-manylinux_2_31_x86_64.whl",
            "has_sig": false,
            "md5_digest": "7bfe61b2c0ab683d34b60bc3d34d16e7",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7",
            "size": 3554411,
            "upload_time": "2024-04-06T19:21:49",
            "upload_time_iso_8601": "2024-04-06T19:21:49.692146Z",
            "url": "https://files.pythonhosted.org/packages/b5/20/f05447d3d4f6d32dae0a96e0554bccda99ee92bc5388a33fd167dec3cb20/dlio_profiler_py-0.0.5-cp37-cp37m-manylinux_2_31_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "beda82f785accbbbf0bee981efac3d11fea8183aca2d50b5b1b64ede6eeb4682",
                "md5": "397ee2ef8cdb90b6ba48626c6e20bd6b",
                "sha256": "025ef97dd7628118c590cd3722f040fc153afcc15c7e0973cd81fbdb643beb3a"
            },
            "downloads": -1,
            "filename": "dlio_profiler_py-0.0.5-cp37-cp37m-manylinux_2_34_x86_64.whl",
            "has_sig": false,
            "md5_digest": "397ee2ef8cdb90b6ba48626c6e20bd6b",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7",
            "size": 2902090,
            "upload_time": "2024-04-06T19:21:50",
            "upload_time_iso_8601": "2024-04-06T19:21:50.166469Z",
            "url": "https://files.pythonhosted.org/packages/be/da/82f785accbbbf0bee981efac3d11fea8183aca2d50b5b1b64ede6eeb4682/dlio_profiler_py-0.0.5-cp37-cp37m-manylinux_2_34_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8e9bac78081b86bae091b2a47ba5e3281376e890e9737d4c1f114c377d7d7a4c",
                "md5": "bca159005ef07dbf5561f123c35edebc",
                "sha256": "4a6fa29f03fdbec5fa8e11251a9da12c93f38e2ff96b3a0395ff1549306740c2"
            },
            "downloads": -1,
            "filename": "dlio_profiler_py-0.0.5-cp38-cp38-manylinux_2_31_x86_64.whl",
            "has_sig": false,
            "md5_digest": "bca159005ef07dbf5561f123c35edebc",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.7",
            "size": 3550486,
            "upload_time": "2024-04-06T19:22:07",
            "upload_time_iso_8601": "2024-04-06T19:22:07.521524Z",
            "url": "https://files.pythonhosted.org/packages/8e/9b/ac78081b86bae091b2a47ba5e3281376e890e9737d4c1f114c377d7d7a4c/dlio_profiler_py-0.0.5-cp38-cp38-manylinux_2_31_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c6ce1447f987a12f7fb33092f2cb0a0782a4f5dba9ff487512cec8cbcb5bd016",
                "md5": "68c0ed960645d08d94983c23c753a74d",
                "sha256": "b7a1606d655c597ca8b7902f2c98074d756f7058d73e4feb61579e2fefb73ad5"
            },
            "downloads": -1,
            "filename": "dlio_profiler_py-0.0.5-cp38-cp38-manylinux_2_34_x86_64.whl",
            "has_sig": false,
            "md5_digest": "68c0ed960645d08d94983c23c753a74d",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.7",
            "size": 2901873,
            "upload_time": "2024-04-06T19:21:48",
            "upload_time_iso_8601": "2024-04-06T19:21:48.026620Z",
            "url": "https://files.pythonhosted.org/packages/c6/ce/1447f987a12f7fb33092f2cb0a0782a4f5dba9ff487512cec8cbcb5bd016/dlio_profiler_py-0.0.5-cp38-cp38-manylinux_2_34_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "92fbe193570d1c3efdd31b4a4bf5f183e3aff59442ad161beeebb28fd63aeb27",
                "md5": "6a0ac037e9ee12a8ab10b65e998b28e4",
                "sha256": "e45f92e8956603451aefd9eb1f01469b32e588ac0c55c847aac8b778fc7f8253"
            },
            "downloads": -1,
            "filename": "dlio_profiler_py-0.0.5-cp39-cp39-manylinux_2_31_x86_64.whl",
            "has_sig": false,
            "md5_digest": "6a0ac037e9ee12a8ab10b65e998b28e4",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.7",
            "size": 3551236,
            "upload_time": "2024-04-06T19:21:58",
            "upload_time_iso_8601": "2024-04-06T19:21:58.424695Z",
            "url": "https://files.pythonhosted.org/packages/92/fb/e193570d1c3efdd31b4a4bf5f183e3aff59442ad161beeebb28fd63aeb27/dlio_profiler_py-0.0.5-cp39-cp39-manylinux_2_31_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c9563a4ab31ec47ee54cb1d7ba097802bfa98e646a1fe4fec8c4bb688975be45",
                "md5": "198eb510ca72848219e8a39fb6bc1c81",
                "sha256": "96fef6dd6317ce5aac8b7d70fdc40cb640d4ae7888ff93eed584980864ed2639"
            },
            "downloads": -1,
            "filename": "dlio_profiler_py-0.0.5-cp39-cp39-manylinux_2_34_x86_64.whl",
            "has_sig": false,
            "md5_digest": "198eb510ca72848219e8a39fb6bc1c81",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.7",
            "size": 2902503,
            "upload_time": "2024-04-06T19:21:47",
            "upload_time_iso_8601": "2024-04-06T19:21:47.037822Z",
            "url": "https://files.pythonhosted.org/packages/c9/56/3a4ab31ec47ee54cb1d7ba097802bfa98e646a1fe4fec8c4bb688975be45/dlio_profiler_py-0.0.5-cp39-cp39-manylinux_2_34_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "57280f21bc99b5b081b576b371cd0bfbd5d0002030b8f30574a91d0c18f9817b",
                "md5": "2646eb9cb7f1298ff7d680a6b4fb88cc",
                "sha256": "e4e8dbf8e90f14f61e63ae632ba1ce119fac152b3a1bb1506822b9f7ad4db127"
            },
            "downloads": -1,
            "filename": "dlio_profiler_py-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "2646eb9cb7f1298ff7d680a6b4fb88cc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 39524,
            "upload_time": "2024-04-06T19:21:53",
            "upload_time_iso_8601": "2024-04-06T19:21:53.286594Z",
            "url": "https://files.pythonhosted.org/packages/57/28/0f21bc99b5b081b576b371cd0bfbd5d0002030b8f30574a91d0c18f9817b/dlio_profiler_py-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-06 19:21:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hariharan-devarajan",
    "github_project": "dlio-profiler",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dlio-profiler-py"
}
        
Elapsed time: 0.27968s