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

Add logic for finding max_sum_per_partition candidates #484

Merged
merged 9 commits into from
Aug 29, 2023

Conversation

RamSaw
Copy link
Collaborator

@RamSaw RamSaw commented Aug 25, 2023

Uses linf_sum_contributions_histogram to compute that, candidates are taken as max values of bins, bins are sampled uniformly.

min_sum_per_partition is not implemented and is always zero.

utility analysis for sum was not implemented, this PR also adds support for it modifying _sum_metrics_to_data_dropped method.

@RamSaw RamSaw requested a review from dvadym August 25, 2023 11:36
Copy link
Collaborator

@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, it looks great! I left some comments

analysis/tests/parameter_tuning_test.py Show resolved Hide resolved
@@ -139,6 +138,11 @@ def _find_candidate_parameters(
l0_bounds = linf_bounds = None
max_sum_per_partition_bounds = min_sum_per_partition_bounds = None

if calculate_sum_per_partition_param:
assert not parameters_to_tune.min_sum_per_partition, "Tuning of min_sum_per_partition is not supported yet"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please put this check in _check_tune_args

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added, wdyt? afaiu options.parameters_to_tune.min_sum_per_partition should never be true because we don't support it in any cases.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, agree that tuning min_sum_per_partition should be false for now

analysis/cross_partition_combiners.py Outdated Show resolved Hide resolved
analysis/parameter_tuning.py Outdated Show resolved Hide resolved
analysis/parameter_tuning.py Outdated Show resolved Hide resolved
analysis/parameter_tuning.py Outdated Show resolved Hide resolved
analysis/parameter_tuning.py Show resolved Hide resolved
find_candidates_func1: Callable[[histograms.Histogram, int],
Sequence[Number]],
find_candidates_func2: Callable[[histograms.Histogram, int],
Sequence[Number]], max_candidates: int):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: please add docstring for this function (it has pretty complicated API)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added, wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

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

SGTM, thanks

@RamSaw RamSaw requested a review from dvadym August 28, 2023 13:59
Copy link
Collaborator

@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.

LGTM! Just a minor comment

analysis/parameter_tuning.py Show resolved Hide resolved
find_candidates_func1: Callable[[histograms.Histogram, int],
Sequence[Number]],
find_candidates_func2: Callable[[histograms.Histogram, int],
Sequence[Number]], max_candidates: int):
Copy link
Collaborator

Choose a reason for hiding this comment

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

SGTM, thanks

@@ -139,6 +138,11 @@ def _find_candidate_parameters(
l0_bounds = linf_bounds = None
max_sum_per_partition_bounds = min_sum_per_partition_bounds = None

if calculate_sum_per_partition_param:
assert not parameters_to_tune.min_sum_per_partition, "Tuning of min_sum_per_partition is not supported yet"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, agree that tuning min_sum_per_partition should be false for now

@dvadym dvadym merged commit 6e922ad into OpenMined:main Aug 29, 2023
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