Skip to content
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

Introduce boolean variable for enabling/disabling of cross partition contribution bounding #515

Merged

Conversation

dvadym
Copy link
Collaborator

@dvadym dvadym commented May 17, 2024

No description provided.

pipeline_dp/contribution_bounders.py Outdated Show resolved Hide resolved
pipeline_dp/contribution_bounders.py Outdated Show resolved Hide resolved
pipeline_dp/contribution_bounders.py Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@dvadym dvadym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAL

tests/contribution_bounders_test.py Outdated Show resolved Hide resolved
tests/contribution_bounders_test.py Outdated Show resolved Hide resolved
self.assertLen(bound_result[('pid1', 'pk1')], 1)
self.assertLen(bound_result[('pid2', 'pk1')], 1)

def test_sampling_applied_nothing_dropped(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I would rename this methods to "test_more_contributions_than_bound_nothing_dropped" to make it clear that we expect all contributions to be kept under specific circumstances.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

unittest.mock.ANY)

@patch('pipeline_dp.contribution_bounders.NoOpSampler.bound_contributions')
def test_aggregate_computation_graph_only_no_sampling_for_sum_when_no_cross_partition(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in "test_aggregate_computation_graph_only_no_sampling_for_sum_when_no_cross_partition"

what does "only" refer to? is it "only test graph and nothing else"? In that case, I think we can drop "only". "test_computational_graph" already indicates what's being tested.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, we can drop only. Done

Copy link
Collaborator Author

@dvadym dvadym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for review!

tests/contribution_bounders_test.py Outdated Show resolved Hide resolved
self.assertLen(bound_result[('pid1', 'pk1')], 1)
self.assertLen(bound_result[('pid2', 'pk1')], 1)

def test_sampling_applied_nothing_dropped(self):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

unittest.mock.ANY)

@patch('pipeline_dp.contribution_bounders.NoOpSampler.bound_contributions')
def test_aggregate_computation_graph_only_no_sampling_for_sum_when_no_cross_partition(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, we can drop only. Done

@dvadym dvadym merged commit afbb949 into OpenMined:main May 17, 2024
6 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants