From 98e5359beb1813b3da67e1f36456f78eac8be84d Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Tue, 4 Oct 2022 09:44:22 +0200 Subject: [PATCH 1/8] test: use pytest.importorskip to impoty numpy and cupy --- python/tests/test_benchmarks.py | 1 + python/tests/test_nvcomp.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/python/tests/test_benchmarks.py b/python/tests/test_benchmarks.py index c888fdbd19..ec2ec2b395 100644 --- a/python/tests/test_benchmarks.py +++ b/python/tests/test_benchmarks.py @@ -10,6 +10,7 @@ benchmarks_path = Path(os.path.realpath(__file__)).parent / ".." / "benchmarks" +pytest.importorskip("cupy") pytest.importorskip("dask") diff --git a/python/tests/test_nvcomp.py b/python/tests/test_nvcomp.py index 5eb66bfb11..1288646c14 100644 --- a/python/tests/test_nvcomp.py +++ b/python/tests/test_nvcomp.py @@ -1,10 +1,10 @@ # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved. # See file LICENSE for terms. -import cupy -import numpy as np import pytest +np = pytest.importorskip("numpy") +cupy = pytest.importorskip("cupy") cudf = pytest.importorskip("cudf") kvikio = pytest.importorskip("kvikio") libnvcomp = pytest.importorskip("kvikio.nvcomp") From 7774c8e23c134ed55c4943178b005fb3a28a81a3 Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Tue, 4 Oct 2022 09:45:07 +0200 Subject: [PATCH 2/8] conda: require numpy and pytest --- conda/recipes/kvikio/meta.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conda/recipes/kvikio/meta.yaml b/conda/recipes/kvikio/meta.yaml index 42ba6c6b90..2d8fe17aca 100644 --- a/conda/recipes/kvikio/meta.yaml +++ b/conda/recipes/kvikio/meta.yaml @@ -42,14 +42,16 @@ requirements: - libkvikio {{ version }} run: - python + - numpy >=1.20 - cupy - zarr - {{ pin_compatible('cudatoolkit', max_pin='x', min_pin='x') }} test: + requires: + - pytest imports: - kvikio - - kvikio.cufile about: home: http://rapids.ai/ From 5a11cfff7743caf4045483413528f8d154f14867 Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Tue, 4 Oct 2022 10:01:08 +0200 Subject: [PATCH 3/8] setup.cfg: removed numpy requirement --- python/setup.cfg | 2 -- 1 file changed, 2 deletions(-) diff --git a/python/setup.cfg b/python/setup.cfg index 15159f29fb..91637a715a 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -46,6 +46,4 @@ skip= [options] packages = find: -install_requires = - numpy python_requires = >=3.8,<3.10 From e4667f77114565bc5e4e359e55895cd2e3a8375b Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Tue, 4 Oct 2022 10:01:53 +0200 Subject: [PATCH 4/8] test_hello_world: require cupy --- python/tests/test_examples.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/tests/test_examples.py b/python/tests/test_examples.py index 453d06b114..7074b02f63 100644 --- a/python/tests/test_examples.py +++ b/python/tests/test_examples.py @@ -5,10 +5,14 @@ from importlib import import_module from pathlib import Path +import pytest + examples_path = Path(os.path.realpath(__file__)).parent / ".." / "examples" def test_hello_world(tmp_path, monkeypatch): """Test examples/hello_world.py""" + pytest.importorskip("cupy") + monkeypatch.syspath_prepend(str(examples_path)) import_module("hello_world").main(tmp_path / "test-file") From 47ea01f4b4a91ad09749e673dcec916548677e2f Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Tue, 4 Oct 2022 10:11:50 +0200 Subject: [PATCH 5/8] updated README --- README.md | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 334459ae17..b6ca82e161 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,19 @@ ## Summary -This provides C++ and Python bindings to cuFile, which enables GPUDirect Storage (or GDS). +This provides C++ and Python bindings to cuFile, which enables GPUDirect Storage (GDS). +KvikIO also works efficiently when GDS isn't available and can read/write both host and +device data seamlessly. KvikIO ### Features -* Object Oriented API -* Exception handling -* Zarr reader +* Object Oriented API. +* Exception handling. +* Concurrent reads and writes using an internal thread pool. +* Non-blocking API. +* Python Zarr reader. +* Handle both host and device IO seamlessly. +* Provides Python bindings to [nvCOMP](https://github.com/NVIDIA/nvcomp). ## Requirements @@ -17,19 +23,22 @@ installed (v11.4+) and a working compiler toolchain (C++17 and cmake). ### C++ -The C++ bindings are header-only and depends on CUDA Driver and Runtime API. -In order to build and run the example code, CMake is required. +The C++ bindings are header-only and depends on the CUDA Driver API. +In order to build and run the example code, CMake and the CUDA Runtime +API is required. ### Python -The Python packages depends on the following packages: +The Python package depends on the following packages: -* Cython -* Pip -* Setuptools +* cython +* pip +* setuptools +* scikit-build -For testing: +For nvCOMP, benchmarks, examples, and tests: * pytest +* numpy * cupy ## Install From 93604d7d9409cb337f45aef3076307dcf018c55b Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Fri, 7 Oct 2022 11:21:12 +0200 Subject: [PATCH 6/8] comment --- python/tests/test_examples.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/tests/test_examples.py b/python/tests/test_examples.py index 7074b02f63..3343216c6f 100644 --- a/python/tests/test_examples.py +++ b/python/tests/test_examples.py @@ -12,7 +12,7 @@ def test_hello_world(tmp_path, monkeypatch): """Test examples/hello_world.py""" - pytest.importorskip("cupy") + pytest.importorskip("cupy") # `examples/hello_world.py` requires CuPy monkeypatch.syspath_prepend(str(examples_path)) import_module("hello_world").main(tmp_path / "test-file") From dddfab7603ebe614d7f7a6659d834934ba41b6b5 Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Fri, 7 Oct 2022 11:21:26 +0200 Subject: [PATCH 7/8] conda: require cupy >=9.5.0 --- conda/recipes/kvikio/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda/recipes/kvikio/meta.yaml b/conda/recipes/kvikio/meta.yaml index 2d8fe17aca..ef86f090f7 100644 --- a/conda/recipes/kvikio/meta.yaml +++ b/conda/recipes/kvikio/meta.yaml @@ -43,7 +43,7 @@ requirements: run: - python - numpy >=1.20 - - cupy + - cupy >=9.5.0 - zarr - {{ pin_compatible('cudatoolkit', max_pin='x', min_pin='x') }} From 883cdfdf0b192985b887c3149be6cc1ef949a016 Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Fri, 7 Oct 2022 12:25:46 +0200 Subject: [PATCH 8/8] setup.cfg: updated python_requires --- python/setup.cfg | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/setup.cfg b/python/setup.cfg index 91637a715a..753c4bceb3 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -46,4 +46,9 @@ skip= [options] packages = find: -python_requires = >=3.8,<3.10 +python_requires = >=3.8 + +[options.extras_require] +nvcomp = + numpy >=1.20 + cupy >=9.5.0