-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hierarchical accountant #123
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks it looks cool, I left some comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good, 1 minor comment and could you please run
make format
linting is failing
@@ -90,7 +90,6 @@ class SumParams: | |||
max_contributions_per_partition: int | |||
low: float | |||
high: float | |||
budget_weight: float |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please return back this as well
@@ -52,6 +52,13 @@ def aggregate(self, col, params: AggregateParams, | |||
""" | |||
if params is None: | |||
return None | |||
|
|||
with self._budget_accountant.scope(weight=params.budget_weight): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like an idea to create internal aggregate instead of having with on the entire function!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this ready to merge?
Tests are failing. Please return back |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Description
Introducing budget accounting scopes.
The current budget accountant supports proportional budget allocation, where each DP operation can specify some relative “weight” and the budget accountant looks at all operations and distributes the global budget proportionally. This is nice.
However, if an operation contains multiple sub-operations, they all need to be aware of the weight of the parent operation, which needs manual piping of the weight, and multiplying weights of the sub-operations by the parent weight.
Manually ensuring that the sub-operations sum up to the parent weight is error-prone. This change suggests a convenient API that allows to scope DP operations and automatically ensure that the weight of each sub-operation is correctly normalised.
How has this been tested?
A unit test.
Checklist