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

Migrate dask/notebooks/HPO_demo.ipynb to deployment #174

Merged
merged 13 commits into from
Apr 11, 2023
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
add docs for localcudacluster
skirui-source committed Apr 6, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 16e712833d1d1090a9f92589d486da36de26c2f3
55 changes: 55 additions & 0 deletions source/guides/cuda/localcluster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# LocalCUDACluster
Create a cluster of one or more GPUs on your local machine. You can launch a Dask scheduler on LocalCUDACluster to parallelize and distribute your RAPIDS workflows across multiple GPUs on a single node.

In addition to enabling multi-GPU computation, `LocalCUDACluster` also provides a simple interface for managing the cluster, such as starting and stopping the cluster, querying the status of the nodes, and monitoring the workload distribution.


## Pre-requisites
Before running these instructions, ensure you have installed the [`dask`](https://docs.dask.org/en/stable/install.html) and [`dask_cuda`](https://docs.rapids.ai/api/dask-cuda/nightly/install.html) packages in your local environment


## Cluster setup

### Instantiate a LocalCUDACluster object.
In this example, we create a cluster with two workers, each of which is responsible for executing tasks on a separate GPU.

```console
cluster = LocalCUDACluster(n_workers=2)
```

### Connecting a Dask client
Dask scheduler coordinates the execution of tasks, whereas Dask client is the user-facing interface that submits tasks to the scheduler and monitors their progress.

```console
client = Client(cluster)
```

## Test RAPIDS

To test RAPIDS, create a distributed client for the cluster and query for the GPU model.

```Python
from dask_cuda import LocalCUDACluster
from dask.distributed import Client

cluster = LocalCUDACluster()
client = Client(cluster)

def get_gpu_model():
import pynvml

pynvml.nvmlInit()
return pynvml.nvmlDeviceGetName(pynvml.nvmlDeviceGetHandleByIndex(0))


client.submit(get_gpu_model).result()
```

## Clean up
Be sure to shut down and clean LocalCUDACluster when you are done:

```console
client.close()
cluster.close()
```