ezkl  by zkonduit

ZKML inference engine for deep learning models and computational graphs

created 3 years ago
1,113 stars

Top 35.0% on sourcepulse

GitHubView on GitHub
Project Summary

EZKL is a ZKML (Zero-Knowledge Machine Learning) engine enabling private inference for deep learning models and arbitrary computational graphs. It allows users to define models in PyTorch/TensorFlow, export them to ONNX, and generate ZK-SNARK circuits for verifiable computation. This empowers users to prove statements about private data processed by public models, public data processed by private models, or both, leveraging the Halo2 proof system for efficient verification.

How It Works

EZKL translates computational graphs (e.g., neural networks) defined in frameworks like PyTorch or TensorFlow into the ONNX format. It then quantizes these operations and converts the ONNX graph into a ZK-SNARK circuit using the Halo2 proof system. This circuit allows for the generation of proofs that a specific computation was performed correctly, with the verification process being computationally inexpensive and suitable for on-chain or browser-based execution.

Quick Start & Requirements

  • Python Bindings: pip install ezkl or pip install ezkl-gpu for GPU acceleration.
  • CLI: Download via curl https://raw.githubusercontent.com/zkonduit/ezkl/main/install_ezkl_cli.sh | bash.
  • Dependencies: Python 3.x, Rust/Cargo (for building from source), PyTorch, ONNX, TensorFlow (for tutorials). GPU acceleration requires NVIDIA hardware and building with the icicle feature.
  • Resources: Notebook examples are available in examples/notebooks.
  • Docs: https://github.com/zkonduit/ezkl

Highlighted Details

  • Leverages the Halo2 proof system for ZK-SNARK generation.
  • Supports ONNX model export and quantization for circuit conversion.
  • Offers Python bindings, a CLI tool, and an in-browser EVM verifier.
  • GPU acceleration is available via the Icicle backend.

Maintenance & Community

Licensing & Compatibility

  • Licensed under the Apache 2.0 license.
  • Contributions are subject to a CLA with Zkonduit Inc.

Limitations & Caveats

  • Outputs in EZKL may differ slightly from Python due to quantization.
  • The project is provided "AS IS" without warranty.
  • Security considerations for ZKML, quantization, and ML models are detailed in docs/advanced_security.
Health Check
Last commit

2 days ago

Responsiveness

1 day

Pull Requests (30d)
11
Issues (30d)
1
Star History
43 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.