diff --git a/python/kvikio/kvikio/benchmarks/s3_io.py b/python/kvikio/kvikio/benchmarks/s3_io.py index 4311f5f012..c9121b9d30 100644 --- a/python/kvikio/kvikio/benchmarks/s3_io.py +++ b/python/kvikio/kvikio/benchmarks/s3_io.py @@ -102,32 +102,9 @@ def run() -> float: yield run() -def run_cudf(args, libcudf_s3_io: bool): - import cudf - - cudf.set_option("libcudf_s3_io", libcudf_s3_io) - - # Upload data to S3 server - create_client_and_bucket() - data = cupy.random.rand(args.nelem).astype(args.dtype) - df = cudf.DataFrame({"a": data}) - df.to_parquet(f"s3://{args.bucket}/data1") - - def run() -> float: - t0 = time.perf_counter() - cudf.read_parquet(f"s3://{args.bucket}/data1") - t1 = time.perf_counter() - return t1 - t0 - - for _ in range(args.nruns): - yield run() - - API = { - "cupy-kvikio": partial(run_numpy_like, xp=cupy), - "numpy-kvikio": partial(run_numpy_like, xp=numpy), - "cudf-kvikio": partial(run_cudf, libcudf_s3_io=True), - "cudf-fsspec": partial(run_cudf, libcudf_s3_io=False), + "cupy": partial(run_numpy_like, xp=cupy), + "numpy": partial(run_numpy_like, xp=numpy), } diff --git a/python/kvikio/tests/test_benchmarks.py b/python/kvikio/tests/test_benchmarks.py index 5b5602e53a..307b0b258d 100644 --- a/python/kvikio/tests/test_benchmarks.py +++ b/python/kvikio/tests/test_benchmarks.py @@ -109,3 +109,32 @@ def test_http_io(run_cmd, api): cwd=benchmarks_path, ) assert retcode == 0 + + +@pytest.mark.parametrize( + "api", + [ + "cupy", + "numpy", + ], +) +def test_s3_io(run_cmd, api): + """Test benchmarks/s3_io.py""" + + if not kvikio.is_remote_file_available(): + pytest.skip( + "RemoteFile not available, please build KvikIO " + "with libcurl (-DKvikIO_REMOTE_SUPPORT=ON)" + ) + retcode = run_cmd( + cmd=[ + sys.executable, + "http_io.py", + "-n", + "1000", + "--api", + api, + ], + cwd=benchmarks_path, + ) + assert retcode == 0