[codex] Implement FedDF server aggregation example#411
Merged
Conversation
Add a new FedDF server-aggregation example that transports proxy-set logits from clients and distills the next global model on the server. - add the FedDF client, server, aggregation strategy, algorithm, and shared proxy helpers - add a runnable MNIST/LeNet-5 example config and documentation mapping the code to the paper - cover the logits transport and server-side distillation paths with targeted tests Validation: - uv run pytest -- tests/clients/test_feddf_strategy.py tests/servers/test_feddf_server_strategy.py - uv run pytest -- tests/clients/test_feddf_strategy.py tests/servers/test_feddf_server_strategy.py tests/clients/test_fednova_strategy.py tests/servers/test_fedavg_strategy.py - uv run ruff check examples/server_aggregation/feddf tests/clients/test_feddf_strategy.py tests/servers/test_feddf_server_strategy.py - git diff --check - uv run python import/config smoke check for the FedDF example
Address the DT-335 review findings by making the proxy protocol explicit instead of assuming that every client can reconstruct the same proxy subset locally. - send the server-selected proxy inputs together with the global weights in the FedDF server payload - load and reuse the shared proxy payload on the client before emitting logits - update the tests to exercise the real proxy-resolution path and document the repaired protocol Validation: - uv run pytest -- tests/clients/test_feddf_strategy.py tests/servers/test_feddf_server_strategy.py - uv run pytest -- tests/clients/test_feddf_strategy.py tests/servers/test_feddf_server_strategy.py tests/clients/test_fednova_strategy.py tests/servers/test_fedavg_strategy.py - uv run ruff check examples/server_aggregation/feddf tests/clients/test_feddf_strategy.py tests/servers/test_feddf_server_strategy.py - git diff --check - uv run python import/config smoke check for the FedDF example
Prefer the datasource unlabeled split for FedDF proxy selection before falling back to the test split. Added deterministic Torchvision subset slicing so CIFAR-10 can reserve a non-overlapping training holdout for proxy distillation while preserving classes and targets metadata. Expanded datasource and FedDF strategy coverage for the new subset semantics and unlabeled-first proxy path.
Match the FedDF server distillation path more closely to the paper/reference recipe by defaulting teacher fusion to uniform AVGLOGITS, switching the student distillation loop to Adam with optional cosine annealing, and shuffling proxy batches during server training. Keep sample-weighted fusion and SGD available as explicit opt-in settings for experiments that need them. Add a focused server-side regression test to lock the uniform teacher-logit averaging default and keep the existing FedDF distillation test green under the new optimizer/scheduler path. Validation: uv run pytest tests/servers/test_feddf_server_strategy.py tests/clients/test_feddf_strategy.py -q; uv run ruff check examples/server_aggregation/feddf tests/servers/test_feddf_server_strategy.py tests/clients/test_feddf_strategy.py
Summary: - moved the detailed MOON walkthrough under customized client training loops - left the server-aggregation page with a pointer that explains MOON keeps FedAvg aggregation unchanged - aligned the example docs with the manuscript taxonomy used for the TKDE revision Validation: - documentation-only change; no runtime behavior changed
Summary: - marked the MOON pointer in the server-aggregation docs as a client-training customization - avoided leaving MOON visually classified as a server aggregation rule in the packaged docs Validation: - documentation-only change; no runtime behavior changed
Include the proxy-logit generation pass in the client-reported training time and record server distillation time on the FedDF server so logged round_time and elapsed_time reflect FedDF-specific work.\n\nAlso cache the stacked proxy inputs on the server and add focused tests for the FedDF timing path.
✅ Deploy Preview for platodocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
baochunli
added a commit
that referenced
this pull request
Apr 16, 2026
* Implemented the FedDF server-aggregation example. Add a new FedDF server-aggregation example that transports proxy-set logits from clients and distills the next global model on the server. - add the FedDF client, server, aggregation strategy, algorithm, and shared proxy helpers - add a runnable MNIST/LeNet-5 example config and documentation mapping the code to the paper - cover the logits transport and server-side distillation paths with targeted tests Validation: - uv run pytest -- tests/clients/test_feddf_strategy.py tests/servers/test_feddf_server_strategy.py - uv run pytest -- tests/clients/test_feddf_strategy.py tests/servers/test_feddf_server_strategy.py tests/clients/test_fednova_strategy.py tests/servers/test_fedavg_strategy.py - uv run ruff check examples/server_aggregation/feddf tests/clients/test_feddf_strategy.py tests/servers/test_feddf_server_strategy.py - git diff --check - uv run python import/config smoke check for the FedDF example * Shared the FedDF proxy payload between server and clients. Address the DT-335 review findings by making the proxy protocol explicit instead of assuming that every client can reconstruct the same proxy subset locally. - send the server-selected proxy inputs together with the global weights in the FedDF server payload - load and reuse the shared proxy payload on the client before emitting logits - update the tests to exercise the real proxy-resolution path and document the repaired protocol Validation: - uv run pytest -- tests/clients/test_feddf_strategy.py tests/servers/test_feddf_server_strategy.py - uv run pytest -- tests/clients/test_feddf_strategy.py tests/servers/test_feddf_server_strategy.py tests/clients/test_fednova_strategy.py tests/servers/test_fedavg_strategy.py - uv run ruff check examples/server_aggregation/feddf tests/clients/test_feddf_strategy.py tests/servers/test_feddf_server_strategy.py - git diff --check - uv run python import/config smoke check for the FedDF example * Reserved deterministic FedDF proxy holdouts. Prefer the datasource unlabeled split for FedDF proxy selection before falling back to the test split. Added deterministic Torchvision subset slicing so CIFAR-10 can reserve a non-overlapping training holdout for proxy distillation while preserving classes and targets metadata. Expanded datasource and FedDF strategy coverage for the new subset semantics and unlabeled-first proxy path. * Aligned FedDF distillation with uniform AVGLOGITS and Adam. Match the FedDF server distillation path more closely to the paper/reference recipe by defaulting teacher fusion to uniform AVGLOGITS, switching the student distillation loop to Adam with optional cosine annealing, and shuffling proxy batches during server training. Keep sample-weighted fusion and SGD available as explicit opt-in settings for experiments that need them. Add a focused server-side regression test to lock the uniform teacher-logit averaging default and keep the existing FedDF distillation test green under the new optimizer/scheduler path. Validation: uv run pytest tests/servers/test_feddf_server_strategy.py tests/clients/test_feddf_strategy.py -q; uv run ruff check examples/server_aggregation/feddf tests/servers/test_feddf_server_strategy.py tests/clients/test_feddf_strategy.py * Clarified MOON documentation taxonomy. Summary: - moved the detailed MOON walkthrough under customized client training loops - left the server-aggregation page with a pointer that explains MOON keeps FedAvg aggregation unchanged - aligned the example docs with the manuscript taxonomy used for the TKDE revision Validation: - documentation-only change; no runtime behavior changed * Clarified MOON taxonomy heading. Summary: - marked the MOON pointer in the server-aggregation docs as a client-training customization - avoided leaving MOON visually classified as a server aggregation rule in the packaged docs Validation: - documentation-only change; no runtime behavior changed * Timed FedDF client and server overhead. Include the proxy-logit generation pass in the client-reported training time and record server distillation time on the FedDF server so logged round_time and elapsed_time reflect FedDF-specific work.\n\nAlso cache the stacked proxy inputs on the server and add focused tests for the FedDF timing path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
This PR adds a full FedDF server-aggregation example and the supporting plumbing needed to run it reproducibly.
examples/server_aggregation/feddf/AVGLOGITShandling and Adam-based optimizationWhy
Plato did not yet have a complete, documented FedDF server-aggregation workflow in the examples tree. This change makes the workflow runnable end-to-end and tightens the supporting datasource and aggregation behavior so the example is deterministic and test-covered.
Impact
Users can now run a documented FedDF example directly from the repository, and contributors have regression coverage around the new strategy and datasource behavior.
Validation
uv run pytest tests/clients/test_feddf_strategy.py tests/servers/test_feddf_server_strategy.py tests/datasources/test_torchvision_datasource.py