Skip to content

Commit

Permalink
Small fixes to docs and pairwise distances (#570)
Browse files Browse the repository at this point in the history
Authors:
  - Corey J. Nolet (https://github.com/cjnolet)

Approvers:
  - Ben Frederickson (https://github.com/benfred)

URL: #570
  • Loading branch information
cjnolet authored Jan 16, 2025
1 parent c49ba7b commit 8aae706
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
24 changes: 14 additions & 10 deletions docs/source/cuvs_bench/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This tool offers several benefits, including

* `Docker`_

- `How to run the benchmarks`_
- `How benchmarks are run`_

* `Step 1: Prepare the dataset`_

Expand Down Expand Up @@ -93,32 +93,36 @@ We provide images for GPU enabled systems, as well as systems without a GPU. The
- `cuvs-bench-datasets`: Contains the GPU and CPU benchmarks with million-scale datasets already included in the container. Best suited for users that want to run multiple million scale datasets already included in the image.
- `cuvs-bench-cpu`: Contains only CPU benchmarks with minimal size. Best suited for users that want the smallest containers to reproduce benchmarks on systems without a GPU.

Nightly images are located in `dockerhub <https://hub.docker.com/r/rapidsai/cuvs-bench/tags>`_, meanwhile release (stable) versions are located in `NGC <https://hub.docker.com/r/rapidsai/cuvs-bench>`_, starting with release 24.10.
Nightly images are located in `dockerhub <https://hub.docker.com/r/rapidsai/cuvs-bench/tags>`_.

The following command pulls the nightly container for Python version 3.10, CUDA version 12.0, and cuVS version 24.10:
The following command pulls the nightly container for Python version 3.10, CUDA version 12.5, and cuVS version 24.12:

.. code-block:: bash
docker pull rapidsai/cuvs-bench:24.10a-cuda12.0-py3.10 #substitute cuvs-bench for the exact desired container.
docker pull rapidsai/cuvs-bench:24.12a-cuda12.5-py3.10 #substitute cuvs-bench for the exact desired container.
The CUDA and python versions can be changed for the supported values:
- Supported CUDA versions: 11.4 and 12.x
- Supported Python versions: 3.9 and 3.10.
- Supported CUDA versions: 11.8 and 12.5
- Supported Python versions: 3.10 and 3.11.

You can see the exact versions as well in the dockerhub site:
- `cuVS bench images <https://hub.docker.com/r/rapidsai/cuvs-bench/tags>`_
- `cuVS bench with datasets preloaded images <https://hub.docker.com/r/rapidsai/cuvs-bench-cpu/tags>`_
- `cuVS bench with pre-loaded million-scale datasets images <https://hub.docker.com/r/rapidsai/cuvs-bench-cpu/tags>`_
- `cuVS bench CPU only images <https://hub.docker.com/r/rapidsai/cuvs-bench-datasets/tags>`_

**Note:** GPU containers use the CUDA toolkit from inside the container, the only requirement is a driver installed on the host machine that supports that version. So, for example, CUDA 11.8 containers can run in systems with a CUDA 12.x capable driver. Please also note that the Nvidia-Docker runtime from the `Nvidia Container Toolkit <https://github.com/NVIDIA/nvidia-docker>`_ is required to use GPUs inside docker containers.

How to run the benchmarks
=========================
How benchmarks are run
======================

The `cuvs-bench` package contains lightweight Python scripts to run the benchmarks. There are 4 general steps to running the benchmarks and visualizing the results.

We provide a collection of lightweight Python scripts to run the benchmarks. There are 4 general steps to running the benchmarks and visualizing the results.
#. Prepare Dataset

#. Build Index and Search Index

#. Data Export

#. Plot Results

Step 1: Prepare the dataset
Expand Down
6 changes: 3 additions & 3 deletions python/cuvs/cuvs/distance/distance.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ SUPPORTED_DISTANCES = ["euclidean", "l1", "cityblock", "l2", "inner_product",

@auto_sync_resources
@auto_convert_output
def pairwise_distance(X, Y, out=None, metric="euclidean", metric_arg=2.0,
def pairwise_distance(X, Y, out=None, metric="euclidean", p=2.0,
resources=None):
"""
Compute pairwise distances between X and Y
Expand All @@ -74,7 +74,7 @@ def pairwise_distance(X, Y, out=None, metric="euclidean", metric_arg=2.0,
Y : CUDA array interface compliant matrix shape (n, k)
out : Optional writable CUDA array interface matrix shape (m, n)
metric : string denoting the metric type (default="euclidean")
metric_arg : metric parameter (currently used only for "minkowski")
p : metric parameter (currently used only for "minkowski")
{resources_docstring}
Examples
Expand Down Expand Up @@ -139,6 +139,6 @@ def pairwise_distance(X, Y, out=None, metric="euclidean", metric_arg=2.0,
y_dlpack,
out_dlpack,
distance_type,
metric_arg))
p))

return out
6 changes: 2 additions & 4 deletions python/cuvs/cuvs/test/test_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"jensenshannon",
"russellrao",
"cosine",
"minkowski",
"sqeuclidean",
"inner_product",
],
Expand Down Expand Up @@ -70,10 +71,7 @@ def test_distance(n_rows, n_cols, inplace, order, metric, dtype):
output_device = device_ndarray(output) if inplace else None

ret_output = pairwise_distance(
input1_device,
input1_device,
output_device,
metric,
input1_device, input1_device, output_device, metric, p=2.0
)

output_device = ret_output if not inplace else output_device
Expand Down

0 comments on commit 8aae706

Please sign in to comment.