Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ImmanuelSegol committed Feb 21, 2024
1 parent a2df8a9 commit 85c01e4
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 2 deletions.
Binary file added docs/icicle/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions docs/icicle/multi-gpu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Multi GPU with ICICLE

:::info

If you are looking for the Multi GPU API documentation refer here for [Rust](./rust-bindings/multi-gpu.md).

:::

One of the givens with ZK compute can be the large input sizes, its not rare to se today circuits exceeding 2^25 MSM, such input sizes push even high end GPUs to their limits. To scale and run such large circuits we will need to combine multiple GPUs.

Multi GPU is an approach at developing software to run on multiple GPU devices. There are many ways to approach writing such software. This documentation will cover how you can develop with ICICLE for multiple GPUs.


## Approaches to Multi GPU programming

There are many [different strategies](https://github.com/NVIDIA/multi-gpu-programming-models) available for implementing multi GPU, whoever they really split into two catagories.

Check failure on line 16 in docs/icicle/multi-gpu.md

View workflow job for this annotation

GitHub Actions / Check Spelling

catagories ==> categories

### GPU Server approach

This approach usually involves a single or multiple CPUs opening threads to read / write from multiple GPUs. You can think about it as a scaled up HOST - Device model.

![alt text](image.png)

This approach wont let us tackle larger computation sizes but it will allow us to compute multiple computations which we wouldn't be able to load onto a single GPU.

Check failure on line 24 in docs/icicle/multi-gpu.md

View workflow job for this annotation

GitHub Actions / Check Spelling

wont ==> won't

For example lets say that you had to compute two MSM of size 2^20 on a 16GB VRAM GPU you would normally have preform them asynchronously. How ever if you double the number of GPUs in your system you can now run them in parallel.

Check failure on line 26 in docs/icicle/multi-gpu.md

View workflow job for this annotation

GitHub Actions / Check Spelling

preform ==> perform


### Inter GPU approach

This approach involves a more sphisticated approch to multi GPU computation. Using technologies such as [GPUDirect, NCCL, NVSHMEM](https://www.nvidia.com/en-us/on-demand/session/gtcspring21-cwes1084/) and NVLink its possible to combine multiple GPUs and split a computation amongst the different devices.

Check failure on line 31 in docs/icicle/multi-gpu.md

View workflow job for this annotation

GitHub Actions / Check Spelling

approch ==> approach

This approach requires redesigning the algorithm at the software level to be compatible with splitting amongst devices. In some cases to lower latency to a minimum special inter GPU connections would be installed on a server to allow GPU direct communication with each other.


# Writing ICICLE Code for Multi GPUs

The approach we have taken for the moment is a GPU Server approach, we assume you have a machine with multiple GPUs and you wish to run some computation on each GPU.

To dive deeper and learn about the API checkout the docs for our different ICICLE API

- [Rust Multi GPU APIs](./rust-bindings/multi-gpu.md)
- C++ Multi GPU APIs


## ZKContainer support for multi GPUs

Multi GPU support should work with ZK-Containers by simple defining which devices the docker container should interact with:

```sh
docker run -it --gpus '"device=0,2"' zk-container-image
```

If you wish to expose all GPUs

```sh
docker run --gpus all zk-container-image
```
2 changes: 2 additions & 0 deletions docs/icicle/rust-bindings/multi-gpu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Multi GPU APIs

20 changes: 18 additions & 2 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,20 @@ module.exports = {
id: "icicle/golang-bindings",
},
{
type: "doc",
type: "category",
label: "Rust bindings",
id: "icicle/rust-bindings",
link: {
type: `doc`,
id: "icicle/rust-bindings",
},
collapsed: true,
items: [
{
type: "doc",
label: "Multi GPU Support",
id: "icicle/rust-bindings/multi-gpu",
}
]
},
{
type: "category",
Expand Down Expand Up @@ -60,6 +71,11 @@ module.exports = {
}
],
},
{
type: "doc",
label: "Multi GPU Support",
id: "icicle/multi-gpu",
},
{
type: "doc",
label: "Supporting additional curves",
Expand Down

0 comments on commit 85c01e4

Please sign in to comment.