kvikio-cu12


Namekvikio-cu12 JSON
Version 24.12.1 PyPI version JSON
download
home_pageNone
SummaryKvikIO - GPUDirect Storage
upload_time2024-12-13 02:27:10
maintainerNone
docs_urlNone
authorNVIDIA Corporation
requires_python>=3.10
licenseApache 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # KvikIO: High Performance File IO

## Summary

KvikIO (pronounced "kuh-VICK-eye-oh", see [here](https://ordnet.dk/ddo_en/dict?query=kvik) for pronunciation of kvik) is a Python and C++ library for high performance file IO. It provides C++ and Python
bindings to [cuFile](https://docs.nvidia.com/gpudirect-storage/api-reference-guide/index.html),
which enables [GPUDirect Storage (GDS)](https://developer.nvidia.com/blog/gpudirect-storage/).
KvikIO also works efficiently when GDS isn't available and can read/write both host and device data seamlessly.


### Features

* Object oriented API of [cuFile](https://docs.nvidia.com/gpudirect-storage/api-reference-guide/index.html) with C++/Python exception handling.
* A Python [Zarr](https://zarr.readthedocs.io/en/stable/) backend for reading and writing GPU data to file seamlessly.
* Concurrent reads and writes using an internal thread pool.
* Non-blocking API.
* Transparently handles reads and writes to/from memory on both host and device.
* Provides Python bindings to [nvCOMP](https://github.com/NVIDIA/nvcomp).


### Documentation
 * Python: <https://docs.rapids.ai/api/kvikio/nightly/>
 * C++: <https://docs.rapids.ai/api/libkvikio/nightly/>


### Examples

#### Python
```python
import cupy
import kvikio

def main(path):
    a = cupy.arange(100)
    f = kvikio.CuFile(path, "w")
    # Write whole array to file
    f.write(a)
    f.close()

    b = cupy.empty_like(a)
    f = kvikio.CuFile(path, "r")
    # Read whole array from file
    f.read(b)
    assert all(a == b)
    f.close()

    # Use contexmanager
    c = cupy.empty_like(a)
    with kvikio.CuFile(path, "r") as f:
        f.read(c)
    assert all(a == c)

    # Non-blocking read
    d = cupy.empty_like(a)
    with kvikio.CuFile(path, "r") as f:
        future1 = f.pread(d[:50])
        future2 = f.pread(d[50:], file_offset=d[:50].nbytes)
        # Note: must wait for futures before exiting block
        # at which point the file is closed.
        future1.get()  # Wait for first read
        future2.get()  # Wait for second read
    assert all(a == d)


if __name__ == "__main__":
    main("/tmp/kvikio-hello-world-file")
```

#### C++
```c++
#include <cstddef>
#include <future>
#include <cuda_runtime.h>
#include <kvikio/file_handle.hpp>

int main()
{
  // Create two arrays `a` and `b`
  constexpr std::size_t size = 100;
  void *a = nullptr;
  void *b = nullptr;
  cudaMalloc(&a, size);
  cudaMalloc(&b, size);

  // Write `a` to file
  kvikio::FileHandle fw("test-file", "w");
  std::size_t written = fw.write(a, size);
  fw.close();

  // Read file into `b`
  kvikio::FileHandle fr("test-file", "r");
  std::size_t read = fr.read(b, size);
  fr.close();

  // Read file into `b` in parallel using 16 threads
  kvikio::default_thread_pool::reset(16);
  {
    // FileHandles have RAII semantics
    kvikio::FileHandle f("test-file", "r");
    std::future<std::size_t> future = f.pread(b_dev, sizeof(a), 0);  // Non-blocking
    std::size_t read = future.get(); // Blocking
    // Notice, `f` closes automatically on destruction.
  }
}
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "kvikio-cu12",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "NVIDIA Corporation",
    "author_email": null,
    "download_url": null,
    "platform": null,
    "description": "# KvikIO: High Performance File IO\n\n## Summary\n\nKvikIO (pronounced \"kuh-VICK-eye-oh\", see [here](https://ordnet.dk/ddo_en/dict?query=kvik) for pronunciation of kvik) is a Python and C++ library for high performance file IO. It provides C++ and Python\nbindings to [cuFile](https://docs.nvidia.com/gpudirect-storage/api-reference-guide/index.html),\nwhich enables [GPUDirect Storage (GDS)](https://developer.nvidia.com/blog/gpudirect-storage/).\nKvikIO also works efficiently when GDS isn't available and can read/write both host and device data seamlessly.\n\n\n### Features\n\n* Object oriented API of [cuFile](https://docs.nvidia.com/gpudirect-storage/api-reference-guide/index.html) with C++/Python exception handling.\n* A Python [Zarr](https://zarr.readthedocs.io/en/stable/) backend for reading and writing GPU data to file seamlessly.\n* Concurrent reads and writes using an internal thread pool.\n* Non-blocking API.\n* Transparently handles reads and writes to/from memory on both host and device.\n* Provides Python bindings to [nvCOMP](https://github.com/NVIDIA/nvcomp).\n\n\n### Documentation\n * Python: <https://docs.rapids.ai/api/kvikio/nightly/>\n * C++: <https://docs.rapids.ai/api/libkvikio/nightly/>\n\n\n### Examples\n\n#### Python\n```python\nimport cupy\nimport kvikio\n\ndef main(path):\n    a = cupy.arange(100)\n    f = kvikio.CuFile(path, \"w\")\n    # Write whole array to file\n    f.write(a)\n    f.close()\n\n    b = cupy.empty_like(a)\n    f = kvikio.CuFile(path, \"r\")\n    # Read whole array from file\n    f.read(b)\n    assert all(a == b)\n    f.close()\n\n    # Use contexmanager\n    c = cupy.empty_like(a)\n    with kvikio.CuFile(path, \"r\") as f:\n        f.read(c)\n    assert all(a == c)\n\n    # Non-blocking read\n    d = cupy.empty_like(a)\n    with kvikio.CuFile(path, \"r\") as f:\n        future1 = f.pread(d[:50])\n        future2 = f.pread(d[50:], file_offset=d[:50].nbytes)\n        # Note: must wait for futures before exiting block\n        # at which point the file is closed.\n        future1.get()  # Wait for first read\n        future2.get()  # Wait for second read\n    assert all(a == d)\n\n\nif __name__ == \"__main__\":\n    main(\"/tmp/kvikio-hello-world-file\")\n```\n\n#### C++\n```c++\n#include <cstddef>\n#include <future>\n#include <cuda_runtime.h>\n#include <kvikio/file_handle.hpp>\n\nint main()\n{\n  // Create two arrays `a` and `b`\n  constexpr std::size_t size = 100;\n  void *a = nullptr;\n  void *b = nullptr;\n  cudaMalloc(&a, size);\n  cudaMalloc(&b, size);\n\n  // Write `a` to file\n  kvikio::FileHandle fw(\"test-file\", \"w\");\n  std::size_t written = fw.write(a, size);\n  fw.close();\n\n  // Read file into `b`\n  kvikio::FileHandle fr(\"test-file\", \"r\");\n  std::size_t read = fr.read(b, size);\n  fr.close();\n\n  // Read file into `b` in parallel using 16 threads\n  kvikio::default_thread_pool::reset(16);\n  {\n    // FileHandles have RAII semantics\n    kvikio::FileHandle f(\"test-file\", \"r\");\n    std::future<std::size_t> future = f.pread(b_dev, sizeof(a), 0);  // Non-blocking\n    std::size_t read = future.get(); // Blocking\n    // Notice, `f` closes automatically on destruction.\n  }\n}\n```\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "KvikIO - GPUDirect Storage",
    "version": "24.12.1",
    "project_urls": {
        "Homepage": "https://github.com/rapidsai/kvikio"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d9eb135eaf12519b2d1c278ebce5c13c59c0407b01f20110a40cb8ee0371ee95",
                "md5": "d5fc7a464aaef556ba99fa015eede037",
                "sha256": "5551b1a0aaf842c8d08153cf726454bf53144ec2c24aad08a8be7e7e21e14274"
            },
            "downloads": -1,
            "filename": "kvikio_cu12-24.12.1-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl",
            "has_sig": false,
            "md5_digest": "d5fc7a464aaef556ba99fa015eede037",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 1026377,
            "upload_time": "2024-12-13T02:27:10",
            "upload_time_iso_8601": "2024-12-13T02:27:10.507680Z",
            "url": "https://files.pythonhosted.org/packages/d9/eb/135eaf12519b2d1c278ebce5c13c59c0407b01f20110a40cb8ee0371ee95/kvikio_cu12-24.12.1-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a984fbd103b879ccfc20d324e542b2333e59881f8b83b3d761ba1dfd9371ff4c",
                "md5": "97391a28be715b0c54db17e5b5dcedee",
                "sha256": "c606760efc7395b3a2434e00e8b0c2961be41ca7b23a67d6613e9e87e591eb62"
            },
            "downloads": -1,
            "filename": "kvikio_cu12-24.12.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "97391a28be715b0c54db17e5b5dcedee",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 1106238,
            "upload_time": "2024-12-13T02:23:50",
            "upload_time_iso_8601": "2024-12-13T02:23:50.370431Z",
            "url": "https://files.pythonhosted.org/packages/a9/84/fbd103b879ccfc20d324e542b2333e59881f8b83b3d761ba1dfd9371ff4c/kvikio_cu12-24.12.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1c2b221123df249367598123d7959889b75bd3f1e497cfee5b64636359828dd0",
                "md5": "aab089404f91a8f5d0822fba39184ce2",
                "sha256": "8392e8a1bf41b5956aed75a6e84dedb9d6122c21ea389bcc4278995bbec991bb"
            },
            "downloads": -1,
            "filename": "kvikio_cu12-24.12.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl",
            "has_sig": false,
            "md5_digest": "aab089404f91a8f5d0822fba39184ce2",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.10",
            "size": 1024003,
            "upload_time": "2024-12-13T02:26:15",
            "upload_time_iso_8601": "2024-12-13T02:26:15.026155Z",
            "url": "https://files.pythonhosted.org/packages/1c/2b/221123df249367598123d7959889b75bd3f1e497cfee5b64636359828dd0/kvikio_cu12-24.12.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1b598c3ef3ab20e5145bc41ed14b01c10115a70f8930d74bff69aa699ea80317",
                "md5": "ea1e9ecf39b085d89a095965e7ce7561",
                "sha256": "7dcab1e269bb6ba8a861a3b063dd66948a01e6fb3c1b6eb0197209f18349c619"
            },
            "downloads": -1,
            "filename": "kvikio_cu12-24.12.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "ea1e9ecf39b085d89a095965e7ce7561",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.10",
            "size": 1105645,
            "upload_time": "2024-12-13T02:22:39",
            "upload_time_iso_8601": "2024-12-13T02:22:39.388903Z",
            "url": "https://files.pythonhosted.org/packages/1b/59/8c3ef3ab20e5145bc41ed14b01c10115a70f8930d74bff69aa699ea80317/kvikio_cu12-24.12.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f16ca3ded6aa230610eb13ee53b0830af6c7edbc2b682cc2920cd03b426f5e16",
                "md5": "19b0a5ebb545f8933b0ad2d541951a4e",
                "sha256": "d7e13dcebc8d7705225c6cad9f78d7be6110e3cfaff50e12318105bac29219b9"
            },
            "downloads": -1,
            "filename": "kvikio_cu12-24.12.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl",
            "has_sig": false,
            "md5_digest": "19b0a5ebb545f8933b0ad2d541951a4e",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.10",
            "size": 1006526,
            "upload_time": "2024-12-13T02:25:47",
            "upload_time_iso_8601": "2024-12-13T02:25:47.448489Z",
            "url": "https://files.pythonhosted.org/packages/f1/6c/a3ded6aa230610eb13ee53b0830af6c7edbc2b682cc2920cd03b426f5e16/kvikio_cu12-24.12.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0471efbe89e847381bab63b4c672b752c9feba41b4a42cac1e5f37eaebedd9fe",
                "md5": "55ed76d34d59bf26eaa8e61dd1bdba29",
                "sha256": "a5a607d7c66acaf40e2fc40ad697ed80593e4f884201d539ba61c5eed457eb41"
            },
            "downloads": -1,
            "filename": "kvikio_cu12-24.12.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "55ed76d34d59bf26eaa8e61dd1bdba29",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.10",
            "size": 1087589,
            "upload_time": "2024-12-13T02:22:20",
            "upload_time_iso_8601": "2024-12-13T02:22:20.786295Z",
            "url": "https://files.pythonhosted.org/packages/04/71/efbe89e847381bab63b4c672b752c9feba41b4a42cac1e5f37eaebedd9fe/kvikio_cu12-24.12.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-13 02:27:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rapidsai",
    "github_project": "kvikio",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "kvikio-cu12"
}
        
Elapsed time: 0.50325s