Skip to content

[codex] Implement FedDF server aggregation example#411

Merged
baochunli merged 7 commits intomainfrom
codex/tkde25-feddf
Apr 16, 2026
Merged

[codex] Implement FedDF server aggregation example#411
baochunli merged 7 commits intomainfrom
codex/tkde25-feddf

Conversation

@baochunli
Copy link
Copy Markdown
Collaborator

What changed

This PR adds a full FedDF server-aggregation example and the supporting plumbing needed to run it reproducibly.

  • added the FedDF example entrypoint, config, algorithm, client, server, strategy, and utility modules under examples/server_aggregation/feddf/
  • reserved deterministic FedDF proxy holdouts and shared the proxy payload between the server and clients
  • aligned FedDF distillation behavior around uniform AVGLOGITS handling and Adam-based optimization
  • added timing for FedDF client and server overhead
  • updated the algorithm docs, including the FedDF example and MOON taxonomy clarifications
  • added focused tests for the FedDF client strategy, FedDF server strategy, and torchvision datasource behavior

Why

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

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.
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 16, 2026

Deploy Preview for platodocs ready!

Name Link
🔨 Latest commit 3d04d89
🔍 Latest deploy log https://app.netlify.com/projects/platodocs/deploys/69e0fc8c75d35200086efddf
😎 Deploy Preview https://deploy-preview-411--platodocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@baochunli baochunli marked this pull request as ready for review April 16, 2026 15:17
@baochunli baochunli merged commit 2a999aa into main Apr 16, 2026
8 checks passed
@baochunli baochunli deleted the codex/tkde25-feddf branch April 16, 2026 15:18
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.
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.

1 participant