cache_model_1: save client training partitions as standalone lists, not Subset (each client's data.pt holds the full training set)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- machine-learning
Research direction
Start in cache_model_1/prepare_training_data.py at the Subset(full_train, indices[start:end]) line and the torch.save call below it, then compare with the list-of-pairs pattern in cid_services/distribute_mnist.py around lines 115-117. Move the split-and-save step out of main() into a function that takes a synthetic dataset, and check that client.py's DataLoader path still loads the file. Done when a test with 10 sentinel examples and 3 accounts shows each file holds only its own examples, with no .dataset attribute and the same counts as before.
Written by the indexing model from the issue text.
Description
Follow-up from the approval review of issue No. 329, which found this writer and left it out of that PR. Checked against origin/develop @ c871ed1.
Problem
cache_model_1/prepare_training_data.py splits the Fashion-MNIST training set across client accounts by saving a torch.utils.data.Subset for each client:
cache_model_1/prepare_training_data.py:107:subset = Subset(full_train, indices[start:end]):112:torch.save(subset, str(dest))
A Subset keeps a reference to its parent dataset, and torch.save serializes that parent too. So every client's data.pt contains all 60,000 training examples, not just its share. This is the same pattern issue No. 329 fixes for the audit shards.
Training itself is unaffected. cache_model_1/services/client.py:486 loads the file, and :508 iterates a DataLoader over it, which uses only the client's own indices. The problems are that each client's file includes the other clients' partitions, and each file is the size of the full training set.
Severity
This is low. The script is the local setup step from Documentation/public/guides/fashion-mnist-cnn.md (Step 2) and runs on public Fashion-MNIST, so no private data is exposed today. It matters because the script is the example that model owners copy. A real deployment with private client data that followed it would hand every client everyone else's data.
Proposed change
Save each partition as a standalone list of (image, label) pairs instead of a Subset. cid_services/distribute_mnist.py:115-117 already does this for MNIST:
subset_data = [(train_dataset[idx][0], train_dataset[idx][1]) for idx in idxs]
torch.save(subset_data, save_path)
Keep the existing split unchanged: the same contiguous ranges, with the remainder going to the last client. Keep the output path and the printed per-client counts too.
Out of scope
- The audit shards (
cache_model_*/services/modelowner.py:237), which are issue No. 329. - Changing the partitioning scheme (for example to shuffled or non-IID splits).
Acceptance criteria
- A test runs the partitioning on a small synthetic training set with recognizable sentinel examples, for example one with 10 examples and 3 accounts. After
torch.load, each client's file holds exactly its own examples, has no.datasetattribute, and contains no other client's sentinels. - Each client gets the same sample count it gets today, including the remainder going to the last client.
client.py'sDataLoaderpath still loads and iterates the file unchanged.- The test needs no network access. Factor the split-and-save step out of
main()so it can run without downloading Fashion-MNIST.
- Dominant language
- Python
- Stars
- 4
- Forks
- 7
- Avg merge
- 5d 15h
- Merged PRs (30d)
- 43
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from InfiniteZeroFoundation/DevNet
-
Update the 25 translated organisation READMEs to match the English versionPossibly taken @mrCabez claimed this 15 days ago. Opengood first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
InfiniteZeroFoundation/DevNet#277 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Validator income: separate protocol (i.e., network) fees from DIN issuance, stop calling both "rewards", and keep DIN for stakingPossibly taken @umermjd11 claimed this today. Openenhancement
InfiniteZeroFoundation/DevNet#340 · 3 assignees ·
Maintainers usually reply within 1 day
-
Make reference auditors honor `audit_scoring_policy` in the manifestPossibly taken @0xzoz claimed this 1 day ago. OpenApproved
Difficulty 4/5 3-5 days Newbie friendliness 54/100
InfiniteZeroFoundation/DevNet#330 · 4 comments ·
Maintainers usually reply within 1 day
-
Serialize only assigned audit examples, not the full parent datasetPossibly taken @0xzoz claimed this 1 day ago. OpenApproved
Difficulty 4/5 3-5 days Newbie friendliness 48/100
InfiniteZeroFoundation/DevNet#329 · 4 comments ·
Maintainers usually reply within 1 day
-
Remove plaintext audit dataset keys from model-owner CLI outputPossibly taken @0xzoz claimed this 1 day ago. OpenApproved
Difficulty 4/5 3-5 days Newbie friendliness 58/100
InfiniteZeroFoundation/DevNet#328 · 5 comments ·
Maintainers usually reply within 1 day
All issues in InfiniteZeroFoundation/DevNet
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dbt-labs/spark-utils#51 ·
-
bug pydanty:is-working
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pydantic/pydantic-ai#13444 ·
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
good first issue help wanted
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
changelog investigate
Difficulty 1/5 Under an hour Newbie friendliness 68/100
ramnes/notion-sdk-py#502 ·