Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GPU and CPU packages for ANN benchmarks #1773

Merged
merged 110 commits into from
Sep 5, 2023

Conversation

dantegd
Copy link
Member

@dantegd dantegd commented Aug 25, 2023

Builds on top of #1769

  • Removes libraft-ann-bench C++ based package
  • Creates raft-ann-bench packages that includes C++ tests as well as Python scripts
    • raft-ann-bench package includes all tests for CPU and GPU
    • raft-ann-bench-cpu package that does not depend on CUDA or RAFT GPU code
  • Update docs
  • Test artifacts and scripts in CI
  • Minor code cleaning

Some changes include:

  • Use RAPIDS_DATASET_ROOT_DIR env variable to indicate location of datasets (optional) consistent with other repos: https://docs.rapids.ai/maintainers/datasets/
  • CPU and GPU packages are built in the existing GPU build GHA. Only the CUDA 12 jobs build the CPU packages.
  • Small change for invocation of scripts, for example: python bench/ann/run.py --dataset deep-image-96-inner is now python -m raft-ann-bench.run --dataset deep-image-96-inner, but still scripts meant to be invoked from the command line.

Future improvements:

  • Remove use of popen python scripts from python scripts.
  • Improve printing and logging
  • Allow functions of package to be called from python scripts.

Closes #1744

achirkin and others added 30 commits August 9, 2023 13:19
@dantegd dantegd requested review from a team as code owners September 1, 2023 18:05
build.sh Outdated
@@ -152,7 +154,7 @@ function limitTests {
# Remove the full LIMIT_TEST_TARGETS argument from list of args so that it passes validArgs function
ARGS=${ARGS//--limit-tests=$LIMIT_TEST_TARGETS/}
TEST_TARGETS=${LIMIT_TEST_TARGETS}
echo "Limiting tests to $TEST_TARGETS"
echo "Limiting tests to $TEST_TARGETS"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the original indentation was correct

Comment on lines 36 to 38
# Build ann-bench-cpu only in CUDA 12 jobs since it only depends on python
# version
if [[ ${CUDA_VERSION} == "11.8.0" ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment does not match the conditional. Also, I think the variable name that our CI containers use is RAPIDS_CUDA_VERSION. Can you verify if CUDA_VERSION is set?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, CUDA_VERSION is set, you can see it in the logs https://github.com/rapidsai/raft/actions/runs/6051700515/job/16424916331#step:7:54 which have both with and without RAPIDS_ prefix

Copy link
Contributor

@bdice bdice Sep 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use RAPIDS_CUDA_VERSION -- but better yet, use this snippet copied from cugraph (with CUDA 12 to match the comment as @divyegala noted above):

Suggested change
# Build ann-bench-cpu only in CUDA 12 jobs since it only depends on python
# version
if [[ ${CUDA_VERSION} == "11.8.0" ]]; then
# Build ann-bench-cpu only in CUDA 12 jobs since it only depends on python
# version
RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"
if [[ ${RAPIDS_CUDA_MAJOR} == "12" ]]; then

https://github.com/rapidsai/cugraph/blob/2b4118aee4af912d74ce1ebe7adc39cf596899ef/ci/build_python.sh#L49-L51

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we require to build in the CUDA 11 jobs for now, but otherwise will use it!

cpp/CMakeLists.txt Outdated Show resolved Hide resolved
@cjnolet
Copy link
Member

cjnolet commented Sep 1, 2023

/ok to test

@dantegd
Copy link
Member Author

dantegd commented Sep 1, 2023

/ok to test

@cjnolet
Copy link
Member

cjnolet commented Sep 2, 2023

/ok to test

@cjnolet
Copy link
Member

cjnolet commented Sep 2, 2023

/ok to test

rapids-bot bot pushed a commit that referenced this pull request Sep 2, 2023
Make the `cpp/bench/ann/src/common/cuda_stub.hpp` more flexible and include it in all benchmarks (instead of only `ANN_BENCH` target).
This makes the targets (benchmark libs), which define `CPU_ONLY`, on depend on CUDA headers, thus enabling the builds without GPU.
This should relief #1773 of doing extra workarounds in the bench headers to achieve the same effect.

Authors:
  - Artem M. Chirkin (https://github.com/achirkin)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)

URL: #1792
@cjnolet
Copy link
Member

cjnolet commented Sep 2, 2023

/ok to test

Co-authored-by: Artem M. Chirkin <[email protected]>
@cjnolet
Copy link
Member

cjnolet commented Sep 5, 2023

/ok to test

Copy link
Member

@ajschmidt8 ajschmidt8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving ops-codeowner file changes

Copy link
Contributor

@achirkin achirkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, long awaited feature!

@cjnolet
Copy link
Member

cjnolet commented Sep 5, 2023

/merge

@rapids-bot rapids-bot bot merged commit 2a89574 into rapidsai:branch-23.10 Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci CMake cpp improvement Improvement / enhancement to an existing function non-breaking Non-breaking change python
Projects
Development

Successfully merging this pull request may close these issues.

[FEA] New raft-ann-bench Python package for reproducible benchmarking code
6 participants