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

Example for Secure Aggregation with low-level API #4967

Draft
wants to merge 2 commits into
base: sa-aggregator
Choose a base branch
from

Conversation

panh99
Copy link
Contributor

@panh99 panh99 commented Feb 27, 2025

No description provided.

Comment on lines +61 to +74
# Example `on_send`/`on_receive`/`on_stage_complete` callback functions
def on_send(msgs: Iterable[Message], state: SecAggPlusAggregatorState) -> None:
"""Intercept messages before sending."""
log(INFO, "Intercepted messages before sending.")


def on_receive(msgs: Iterable[Message], state: SecAggPlusAggregatorState) -> None:
"""Intercept reply messages after receiving."""
log(INFO, "Intercepted reply messages after receiving.")


def on_stage_complete(success: bool, state: SecAggPlusAggregatorState) -> None:
"""Handle stage completion event."""
log(INFO, "Handled stage completion event.")
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you see these functions to be useful for (in addition to logging purposes)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, for sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it would be a bit useful for some advanced user to adjust the protocol, but generally it's more for me to implement things like weighted averaging based on the original SecAggPlusInsAggregator.

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.

None yet

2 participants