Skip to content

Conversation

@jafermarq
Copy link
Member

No description provided.

@github-actions github-actions bot added the Maintainer Used to determine what PRs (mainly) come from Flower maintainers. label Dec 3, 2025
@jafermarq jafermarq marked this pull request as draft December 3, 2025 15:58
@jafermarq jafermarq marked this pull request as ready for review December 3, 2025 19:37
arrc = ArrayRecord({"local-gradients": Array(embeddings_grad[pos].numpy())})
message = Message(
content=RecordDict({"gradients": arrc}),
message_type="train.apply_gradients", # target `train` method in ClientApp
Copy link
Member

Choose a reason for hiding this comment

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

Love this!

@panh99 panh99 requested a review from Copilot December 3, 2025 21:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the vertical-fl example to use the new Message API and integrate flwr-datasets for data partitioning. The refactoring modernizes the example by replacing the old NumPyClient pattern with the Message API and leveraging Flower Datasets' VerticalSizePartitioner for cleaner vertical data partitioning.

Key Changes:

  • Migrated from NumPyClient to Message API with @app.query() and @app.train() decorators
  • Integrated VerticalSizePartitioner from flwr-datasets to replace custom vertical partitioning logic
  • Updated ServerApp to use Grid API for message-based communication
  • Removed local CSV file in favor of HuggingFace dataset loading

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
vertical_fl/task.py Replaced custom data processing with flwr-datasets integration and simplified preprocessing; moved ServerModel definition from strategy.py
vertical_fl/strategy.py Removed file entirely as custom strategy is no longer needed with Message API
vertical_fl/server_app.py Complete rewrite to use Grid API and Message-based communication for coordinating vertical FL training
vertical_fl/client_app.py Migrated from NumPyClient to Message API with separate query and train handlers
pyproject.toml Updated dependency versions and configuration parameters
data/train.csv Removed local data file (now using HuggingFace dataset)
README.md Updated documentation to reflect new architecture and usage patterns

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@panh99 panh99 left a comment

Choose a reason for hiding this comment

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

LGTM! Amazing overhaul.

@panh99 panh99 enabled auto-merge (squash) December 4, 2025 08:59
@panh99 panh99 merged commit e7ad112 into main Dec 4, 2025
68 checks passed
@panh99 panh99 deleted the migrate-vertical-fl-example branch December 4, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintainer Used to determine what PRs (mainly) come from Flower maintainers. Migrate to MessageAPI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants