Skip to content

Commit

Permalink
libcudf_s3_io
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Sep 3, 2024
1 parent 4701b52 commit 2bd411e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
8 changes: 4 additions & 4 deletions python/kvikio/kvikio/benchmarks/aws_s3_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ def run() -> float:
yield run()


def run_cudf(args, use_kvikio_s3: bool):
def run_cudf(args, libcudf_s3_io: bool):
import cudf

cudf.set_option("native_s3_io", use_kvikio_s3)
cudf.set_option("libcudf_s3_io", libcudf_s3_io)

# Upload data to S3 server
create_client_and_bucket()
Expand All @@ -127,8 +127,8 @@ def run() -> float:
API = {
"cupy-kvikio": partial(run_numpy_like, xp=cupy),
"numpy-kvikio": partial(run_numpy_like, xp=numpy),
"cudf-kvikio": partial(run_cudf, use_kvikio_s3=True),
"cudf-fsspec": partial(run_cudf, use_kvikio_s3=False),
"cudf-kvikio": partial(run_cudf, libcudf_s3_io=True),
"cudf-fsspec": partial(run_cudf, libcudf_s3_io=False),
}


Expand Down
18 changes: 16 additions & 2 deletions python/kvikio/tests/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,21 @@ def test_zarr_io(run_cmd, tmp_path, api):
assert retcode == 0


def skipif_libcudf_s3_io_option_is_not_available() -> None:
"""Call pytest.skip() if cudf or its "libcudf_s3_io" option isn't available
See <https://github.com/rapidsai/cudf/pull/16499>
"""
cudf = pytest.importorskip("cudf")
try:
cudf.get_option("libcudf_s3_io")
except KeyError:
pytest.skip(
"""cudf doesn't has the "libcudf_s3_io" option, """
"see <https://github.com/rapidsai/cudf/pull/16499>"
)


@pytest.mark.parametrize(
"api",
[
Expand All @@ -102,9 +117,8 @@ def test_aws_s3_io(run_cmd, api):
import boto3 # noqa: F401
import moto # noqa: F401

# TODO: change to import once https://github.com/rapidsai/cudf/pull/16499 is merged
if "cudf" in api:
pytest.importorskip("cudf")
skipif_libcudf_s3_io_option_is_not_available()

retcode = run_cmd(
cmd=[
Expand Down

0 comments on commit 2bd411e

Please sign in to comment.