microsoft / dp-transformers

Differentially-private transformers using HuggingFace and Opacus
MIT License
123 stars 22 forks source link

use opt_einsum with the new version of Opacus #20

Closed huseyinatahaninan closed 2 years ago

huseyinatahaninan commented 2 years ago

Just as replaced in the new version of Opacus, here we switch to using einsum from https://optimized-einsum.readthedocs.io/en/stable/ that can significantly reduce the overall execution time of einsum-like expressions by optimizing the expression’s contraction order and dispatching many operations to canonical BLAS, cuBLAS, or other specialized routines (quoted from the website).