DP Accelerator
Universal High-Performance Differential Privacy Accounting Engine
A framework-agnostic Rust-accelerated library for computing differential privacy guarantees with 3000x+ speedup over pure Python implementations.
Features
- 🚀 3000x faster than pure Python DP accounting
- 🔧 Framework-agnostic: Works with JAX, PyTorch, TensorFlow
- 🦀 Rust-powered: Zero-cost abstractions with memory safety
- 📦 Easy installation:
pip install dp-accelerator - 🎯 Drop-in replacement: Compatible APIs for existing libraries
Quick Start
from dp_accelerator import DPSGDAccountant
# Initialize accountant
accountant = DPSGDAccountant(
noise_multiplier=1.0,
batch_size=600,
dataset_size=60000
)
# Compute privacy guarantee
epsilon = accountant.get_epsilon(steps=10000, delta=1e-5)
print(f"Privacy guarantee: ε = {epsilon:.2f}")
Framework Adapters
JAX Privacy
from dp_accelerator.jax_adapter import compute_dpsgd_epsilon
epsilon = compute_dpsgd_epsilon(
noise_multiplier=1.0,
batch_size=600,
dataset_size=60000,
num_steps=10000,
delta=1e-5
)
Performance
| Implementation | Time | Speedup |
|---|---|---|
| Pure Python | 0.613s | 1x |
| DP Accelerator | 0.0002s | 3000x |
Installation
pip install dp-accelerator
Development
git clone https://github.com/yourusername/dp-accelerator
cd dp-accelerator
maturin develop
Contributing
Contributions welcome! Please see our contributing guide.
License
Apache License 2.0
Metadata
Release files for dp-accelerator 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dp_accelerator-0.1.0.tar.gz | 13.2 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dp_accelerator-0.1.0-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details |
| dp_accelerator-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.34+ x86-64 | Details |
| dp_accelerator-0.1.0-cp311-cp311-macosx_11_0_arm64.whl | CPython 3.11 | CPython 3.11 | macOS 11.0+ ARM64 | Details |
Total release size: 591.2 kB
Release files / dp_accelerator-0.1.0.tar.gz
| Download URL | dp_accelerator-0.1.0.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
888b1df9b2364ad1be2dc317c5931e4107dd237f8ca96c6ffe65747f91ba1883
|
|
BLAKE2b-256 checksum How to use checksums |
3b64032287486d3cb3e4a7996e4135baf305e1e3792fadaedf5e91baa4e0fc9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.11.5
|
Release files / dp_accelerator-0.1.0-cp311-cp311-win_amd64.whl
| Download URL | dp_accelerator-0.1.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 110.6 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a79629ec75cd99c474df04f5483b01ed75f0438974c8f2d4e1b3f19e252b6037
|
|
BLAKE2b-256 checksum How to use checksums |
379b04f6b3cddf9d1e5a5135bb8b643f3591bb2fad41ed0ba3f3707063c108b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.11.5
|
Release files / dp_accelerator-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
| Download URL | dp_accelerator-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 250.4 kB |
| Tags | CPython 3.11 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
61381aef9e733fe508c1d19141e6d703587e02319583a0f213dcbff202b68919
|
|
BLAKE2b-256 checksum How to use checksums |
dda039a7a43da757301a45a40861a1430b440717dd52fdfa7ef355959196d755
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.11.5
|
Release files / dp_accelerator-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | dp_accelerator-0.1.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 216.9 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9cbd6355600ff7d64a1afa0bcefd216c2220a483719c5d63ad7081fdee246ba4
|
|
BLAKE2b-256 checksum How to use checksums |
999342554cceb41c4a77edb949ec444a92a0bd5b357ee10e28ef5552c3df2cd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.11.5
|