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

quick start and integrations guides for the docs #47

Merged
merged 30 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e851903
Getting a start on the docs
cjnolet Mar 7, 2024
73fa0c8
Progress
cjnolet Mar 7, 2024
8e48382
Getting CAGRA C++ docs to build
cjnolet Mar 7, 2024
ca465e6
Updating
cjnolet Mar 8, 2024
58743b5
Checking in
cjnolet Mar 8, 2024
d2dd4cc
New docs
cjnolet Mar 8, 2024
19319d7
Updating build.sh to build the examples
cjnolet Mar 8, 2024
f8c1015
Merge branch 'branch-24.04' into docs_2404-api_docs
cjnolet Mar 8, 2024
358df75
Fixing docs per review
cjnolet Mar 8, 2024
e6bff2b
Merge branch 'docs_2404-api_docs' of github.com:rapidsai/cuvs into do…
cjnolet Mar 8, 2024
5ac765f
Merge branch 'branch-24.04' into docs_2404-api_docs
cjnolet Mar 8, 2024
64d594b
Removing developer guide. That's unneeded int the docs
cjnolet Mar 8, 2024
620e080
Stubbing out quick start guide
cjnolet Mar 8, 2024
f1f671f
Adding quick start
cjnolet Mar 11, 2024
31d014c
Checking in
cjnolet Mar 12, 2024
f69e86e
Renaming quick_start to getting started
cjnolet Mar 12, 2024
0afe86b
Removing osexamples
cjnolet Mar 12, 2024
929e9b4
Fixing package issuey
cjnolet Mar 12, 2024
77e1cbe
Breaking apart getting started guide
cjnolet Mar 12, 2024
3a79601
MOre updates
cjnolet Mar 12, 2024
c9a50fe
Merge remote-tracking branch 'origin/branch-24.04' into docs_2404-api…
cjnolet Mar 12, 2024
935e0fc
Merge remote-tracking branch 'origin/branch-24.04' into docs_2404-api…
cjnolet Mar 12, 2024
ba7c1a7
Adding integrations page
cjnolet Mar 12, 2024
ed5b81c
More updates to integrations
cjnolet Mar 12, 2024
3841bad
Exlcluding rust docs dir
cjnolet Mar 12, 2024
841d5ec
Fixing links
cjnolet Mar 12, 2024
011af02
Fixing more links
cjnolet Mar 12, 2024
b121d32
Converting build and install guide to rst
cjnolet Mar 13, 2024
866193a
Adding rust
cjnolet Mar 13, 2024
80959bc
MOre updates
cjnolet Mar 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ _xml
# sphinx
_html
_text
docs/source/_static/rust

# clang tooling
compile_commands.json
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

## Useful Resources

- [cuVS Reference Documentation](https://docs.rapids.ai/api/cuvs/stable/): API Documentation.
- [cuVS Getting Started](./docs/source/quick_start.md): Getting started with RAFT.
- [Build and Install cuVS](./docs/source/build.md): Instructions for installing and building cuVS.
- [Example Notebooks](./notebooks): Example jupyer notebooks
- [Code Examples](https://github.com/rapidsai/cuvs/tree/HEAD/examples): Self-contained Code Examples.
- [API Reference Documentation](https://docs.rapids.ai/api/cuvs/nightly/api_docs): API Documentation.
- [Getting Started Guide](https://docs.rapids.ai/api/cuvs/nightly/getting_started): Getting started with RAFT.
- [Build and Install Guide](https://docs.rapids.ai/api/cuvs/nightly/build): Instructions for installing and building cuVS.
- [RAPIDS Community](https://rapids.ai/community.html): Get help, contribute, and collaborate.
- [GitHub repository](https://github.com/rapidsai/cuvs): Download the cuVS source code.
- [Issue tracker](https://github.com/rapidsai/cuvs/issues): Report issues or request features.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/api_docs.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
API Documentation
=================
API Reference
=============

.. toctree::
:maxdepth: 1
Expand Down
90 changes: 90 additions & 0 deletions docs/source/basics.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
cuVS API Basics
===============

- `Memory management`_
- `Resource management`_

Memory management
-----------------

Centralized memory management allows flexible configuration of allocation strategies, such as sharing the same CUDA memory pool across library boundaries. cuVS uses the [RMM](https://github.com/rapidsai/rmm) library, which eases the burden of configuring different allocation strategies globally across GPU-accelerated libraries.

RMM currently has APIs for C++ and Python.

C++
^^^

Here's an example of configuring RMM to use a pool allocator in C++ (derived from the RMM example `here <https://github.com/rapidsai/rmm?tab=readme-ov-file#example>`_):

.. code-block:: c++

rmm::mr::cuda_memory_resource cuda_mr;
// Construct a resource that uses a coalescing best-fit pool allocator
// With the pool initially half of available device memory
auto initial_size = rmm::percent_of_free_device_memory(50);
rmm::mr::pool_memory_resource<rmm::mr::cuda_memory_resource> pool_mr{&cuda_mr, initial_size};
rmm::mr::set_current_device_resource(&pool_mr); // Updates the current device resource pointer to `pool_mr`
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource(); // Points to `pool_mr`

Python
^^^^^^

And the corresponding code in Python (derived from the RMM example `here <https://github.com/rapidsai/rmm?tab=readme-ov-file#memoryresource-objects>`_):

.. code-block:: python

import rmm
pool = rmm.mr.PoolMemoryResource(
rmm.mr.CudaMemoryResource(),
initial_pool_size=2**30,
maximum_pool_size=2**32)
rmm.mr.set_current_device_resource(pool)


Resource management
-------------------

cuVS uses an API from the `RAFT <https://github.com/rapidsai/raft>`_ library of ML and data mining primitives to centralize and reuse expensive resources, such as memory management. The below code examples demonstrate how to create these resources for use throughout this guide.

See RAFT's `resource API documentation <https://docs.rapids.ai/api/raft/nightly/cpp_api/core_resources/>`_ for more information.

C
^

.. code-block:: c

#include <cuda_runtime.h>
#include <cuvs/core/c_api.h>

cuvsResources_t res;
cuvsResourcesCreate(&res);

// ... do some processing ...

cuvsResourcesDestroy(res);

C++
^^^

.. code-block:: c++

#include <raft/core/device_resources.hpp>

raft::device_resources res;

Python
^^^^^^

.. code-block:: python

import pylibraft

res = pylibraft.common.DeviceResources()


Rust
^^^^

.. code-block:: rust

let res = cuvs::Resources::new()?;
178 changes: 0 additions & 178 deletions docs/source/build.md

This file was deleted.

Loading
Loading