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

feat(datasets) Add a check for same object partitioners #4335

Merged
merged 7 commits into from
Dec 4, 2024

Conversation

adam-narozniak
Copy link
Member

@adam-narozniak adam-narozniak commented Oct 14, 2024

Issue

The partitioners specification as dict of split to the partitioner object should not have the same objects (value of the dict) assigned to different keys (even if the same type of partitioning happens for different splits).

Proposal

This PR adds a check to ensure this correctness (without it, the code "fails" silently, the non-first used split will not be partitioned but the partitions of the first divided split will be returned).

Examples

This would fail silently

iid = IidPartitioner(num_partitions=10)
fds = FederatedDatasets("mnist", partitioners={"train": iid, "test": iid})

With this PR, it would raise an error.

@adam-narozniak adam-narozniak marked this pull request as ready for review November 29, 2024 13:47
@jafermarq jafermarq enabled auto-merge (squash) December 4, 2024 08:37
@jafermarq jafermarq merged commit 93d6ae4 into main Dec 4, 2024
61 checks passed
@jafermarq jafermarq deleted the fds-improve-multipartitioners-checks branch December 4, 2024 08:59
flydump pushed a commit to flydump/flower that referenced this pull request Dec 8, 2024
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