I am proposing an optional, high-performance backend for dp-accounting that resolves the computation bottleneck in RDP accounting.
By offloading the exact RDP math (Poisson Subsampled Gaussian) to a vectorized Rust extension, I achieved a 40x-45x speedup on standard workloads while maintaining floating-point accuracy ($10^{-12}$
Proposed Solution
I have developed dp-accelerator, a drop-in Rust replacement that:
- Implements the exact
_compute_log_a_frac logic from Google's dp_accounting using statrs.
- Vectorizes computation across all $\alpha$ orders.
- Exposes a safe Python interface via
PyO3.
This package is already published on PyPI (pip install dp-accelerator) and uses Apache 2.0.
Benchmarks (Intel Mac i5 8th gen)
| Config |
Steps |
Python (ms) |
Rust (ms) |
Speedup |
| MNIST |
1k |
36.5 |
0.86 |
42x |
| ImageNet |
90k |
30.0 |
0.69 |
43x |
| Batch (10 checks) |
1k-60k |
333.4 |
8.8 |
37x |
Integration Plan
I have a working branch where this is implemented as a soft dependency:
dp-accounting does not need to compile Rust.
- If
dp-accelerator is installed, analysis.py detects it and routes the computation to the fast path.
- If not installed, it falls back to the existing Python implementation with an alert kind of warning to suggest using the
dp-accelarator package for faster
I have prepared a technical report (submitted to techrxiv) detailed in the repo: https://github.com/AxiomaticLabs/dp-accelerator
Would the team be open to a PR integrating this optional backend?
I am proposing an optional, high-performance backend for
dp-accountingthat resolves the computation bottleneck in RDP accounting.By offloading the exact RDP math (Poisson Subsampled Gaussian) to a vectorized Rust extension, I achieved a 40x-45x speedup on standard workloads while maintaining floating-point accuracy ($10^{-12}$
Proposed Solution
I have developed
dp-accelerator, a drop-in Rust replacement that:_compute_log_a_fraclogic from Google'sdp_accountingusingstatrs.PyO3.This package is already published on PyPI (
pip install dp-accelerator) and uses Apache 2.0.Benchmarks (Intel Mac i5 8th gen)
Integration Plan
I have a working branch where this is implemented as a soft dependency:
dp-accountingdoes not need to compile Rust.dp-acceleratoris installed,analysis.pydetects it and routes the computation to the fast path.dp-accelaratorpackage for fasterI have prepared a technical report (submitted to techrxiv) detailed in the repo: https://github.com/AxiomaticLabs/dp-accelerator
Would the team be open to a PR integrating this optional backend?