Skip to content

Allow to Bring Your Own Accountant #780

@evgri243

Description

@evgri243

🚀 Feature

Instead of a hardcoded accountants allow to register and use any accountant implementing IAccountant.

Motivation

There is comprehensive accountant research happening including dp_accounting and riskcal. The latter even implements IAccountant.

Giving the ability to use other accountants for experimentation and production in the unified interface would make the library considerably more flexible.

Pitch

To support 3rd party accountants I suggest to:

  • introduce a global dictionary with accountants
  • paraphrase create_accountant(mechanism: str) -> IAccountant to return classes from this dictionary
  • introduce register_accountant(mechanism: str, accountant: type[IAccountant]) to register those in the function.

Alternatives

  • Redesign get_noise_multiplier to accept IAccountant instead of the string. This approach brakes back compatibility although may be cleaner in the long run.

Additional context

Personally, we explore hypothesis testing approach of riskal to noise_multiplier search instead of epsilon/delta operation. It would be nicer to have an injection interface instead of copy-patching of Opacus functions to make it work.

I believe I know how to do it both the suggested and the alternative way, so I can implement it after some design approval.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions