or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
Steps in Hardware, Leaps in Performance
ZKML with Acceleration
We've recently integrated the open-source Icicle GPU acceleration library built by the Ingonyama team. This enables developers to leverage hardware acceleration with a simple environment configuration.
The integration is a strategic enhancement to the EZKL engine, addressing the computational bottlenecks inherent in current ZK proof systems. It is especially relevant for large circuits, like those generated for machine learning models.
We observe a ~98% reduction in MSM times against baseline CPU runs for aggregate circuits, and a ~35% reduction in total aggregate proof time against baseline CPU prover times.
This is the first step in a comprehensive hardware integration. With the Ingonyama team, we're continuing to work towards full range support for GPU operations. And further, we're working towards integration with alternative hardware providers — ideally demonstrating tangible benchmarks for the broader domain.
We provide context and technical specification below. Or feel free to jump right into the libraries here.
Zero Knowledge Bottlenecks
Citing Hardware Review: GPUs, FPGAs, and Zero Knowledge Proofs, there are two components to zero knowledge applications:
The major bottlenecks in in the most widely deployed ZK systems are:
The Role of Hardware
Hardware accelerations, such as GPUs and FPGAs, offer significant advantages over software optimizations by enhancing parallelism and optimizing memory access:
For more extensive discussion around optimal hardware design and performance, see here. The domain is evolving rapidly and many approaches remain competitive.
GPU-Acceleration for Halo2
In the Halo2 proof system, bottlenecks can vary depending on the specific circuit being proven. These bottlenecks fall into two main categories:
Thus, the bulk of the complexity arises from commitments (MSM), a computational problem effectively solvable with GPU acceleration.
For the scope of this integration, we've chosen to focus on commitment bottlenecks. It's low hanging fruit, but also an optimization for core component of the engine (KZG aggregation). This is only one step — there remains a lot of work to be done.
Icicle: CUDA-Enabled GPUs
The team at Ingonyama has developed Icicle as an open-source library designed for ZK acceleration using CUDA-enabled GPUs. CUDA, or Compute Unified Device Architecture, is a parallel computing platform and API model created by Nvidia. It allows software to utilize Nvidia GPUs for general-purpose processing. The primary objective of Icicle is to offload a significant portion of the prover code to the GPU and harnesses parallel processing power.
Icicle hosts APIs in Rust and Golang, which simplifies integration. The design is also customizable, featuring:
Notably, Icicle supports essential functionalities like:
Integration with EZKL
The Icicle library has been seamlessly integrated with the EZKL engine, offering GPU acceleration for users with direct access to NVIDIA GPUs or simply with access to Colab. This integration enhances the performance of the EZKL engine by leveraging the parallel processing capabilities of GPUs. Here's how to enable and manage this feature:
icicle
feature and set the environment variable as follows:export ENABLE_ICICLE_GPU=true
ENABLE_ICICLE_GPU
environment variable rather than setting it to false:unset ENABLE_ICICLE_GPU
ICICLE_SMALL_K
environment variable to a desired value. This allows for greater control over when GPU acceleration is employed.Key Affordances
This integration provides several technical affordances.
Most importantly, the integration supports plug and play MSM operations in the GPU using the Icicle library. As a target and testing environment, we focused on replacing CPU-based KZG commitments in the EZKL's aggregation command. This is where multiple proofs are consolidated into a single proof. More specifically,
commit
andcommit_lagrange
for KZG commitments (done on the CPU) with MSM operations (on the GPU) for the BN254 elliptic curve.We have also enabled environment variables and crate features, allowing developers to toggle between CPU and GPU for different circuits on the same binary/build of EZKL. In order to optimize GPU toggling, GPU acceleration is only enabled by default for large k circuits (k > 8).
Benchmarking Results
Our benchmarking results demonstrate a substantial improvement in performance with the integration of the Icicle library into the EZKL engine:
These results highlight the effectiveness of GPU acceleration in optimizing ZK proof systems, particularly in computational aspects like MSM operations. For verification, you can view our continuous integration tests here.
Future Directions
Looking ahead, we plan to further optimize and expand the capabilities of EZKL and Icicle integration:
More broadly, we seek to see integration with alternative hardware systems. This will enable functional benchmarking and developer flexibility for the broader domain.
Through these future developments, we aim to continue pushing the boundaries of performance in ZK proof systems, making them more efficient and accessible for a wider range of applications.
Appendix
Notes for Future Integrations
For contributors and developers, we tested this integration with the aggregate command tutorial on a custom instance with four proofs. A few notes for future integrations