cache_model_1: save client training partitions as standalone lists, not Subset (each client's data.pt holds the full training set)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 70/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
调研方向
从 cache_model_1/prepare_training_data.py 中的 Subset(full_train, indices[start:end]) 这一行以及其下方的 torch.save 调用开始,然后与 cid_services/distribute_mnist.py 第 115-117 行附近的成对列表模式进行比较。将拆分并保存的步骤从 main() 中移出,放到一个接收合成数据集的函数中,并检查 client.py 的 DataLoader 路径是否仍能加载该文件。当使用 10 个哨兵样本和 3 个账户的测试表明每个文件只包含自己的样本、没有 .dataset 属性,并且数量与之前相同时,即完成。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 4
- 派生
- 7
- 平均合并
- 5 天 15 小时
- 30 天内合并 PR
- 43
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
InfiniteZeroFoundation/DevNet 的其他 Issue
-
Update the 25 translated organisation READMEs to match the English version可能已有人在做 @mrCabez 于 15 天前认领。 未关闭good first issue help wanted
难度 2/5 1-3 小时 新手友好度 76/100
InfiniteZeroFoundation/DevNet#277 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Validator income: separate protocol (i.e., network) fees from DIN issuance, stop calling both "rewards", and keep DIN for staking可能已有人在做 @umermjd11 今天认领。 未关闭enhancement
InfiniteZeroFoundation/DevNet#340 · 已指派 3 人 ·
维护者通常 1 天内回复
-
Make reference auditors honor `audit_scoring_policy` in the manifest可能已有人在做 @0xzoz 于 2 天前认领。 未关闭Approved
难度 4/5 3-5 天 新手友好度 54/100
InfiniteZeroFoundation/DevNet#330 · 4 条评论 ·
维护者通常 1 天内回复
-
Serialize only assigned audit examples, not the full parent dataset可能已有人在做 @0xzoz 于 2 天前认领。 未关闭Approved
难度 4/5 3-5 天 新手友好度 48/100
InfiniteZeroFoundation/DevNet#329 · 4 条评论 ·
维护者通常 1 天内回复
-
Remove plaintext audit dataset keys from model-owner CLI output可能已有人在做 @0xzoz 于 2 天前认领。 未关闭Approved
难度 4/5 3-5 天 新手友好度 58/100
InfiniteZeroFoundation/DevNet#328 · 5 条评论 ·
维护者通常 1 天内回复
查看 InfiniteZeroFoundation/DevNet 的全部 Issue
相似的 Issue
-
Email validation accepts a trailing newline可能已有人在做 @marcello-pichini 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
dbt-labs/spark-utils#51 ·
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
bug frontend
难度 2/5 1-3 小时 新手友好度 88/100
vendrabuck/HERD#1419 ·
维护者通常 1 天内回复