Support datasets 5.1.0 shard-based streaming distribution to avoid read amplification at large DP scale
I maintainer di solito rispondono entro 1 giorno
@hjh0119 ci sta già lavorando.
Dal 10/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Checklist / 检查清单
- I have searched existing issues, and this is a new feature request. / 我已经搜索过现有的 issues,确认这是一个新的 Feature Request。
Feature Request Description / Feature Request 描述
Description
我之前在分析 ms-swift 的 streaming 数据处理流程时,发现当前数据读取与预处理主要集中在 rank 0,再由 DataLoaderDispatcher 将batch 分发给其他 rank。随着 DP 并行度增加,rank 0 容易成为数据供给瓶颈。为解决这一问题,我在 Hugging Face datasets 提出了适用于 streaming dataset 的高效 source-shard 分片策略datasets issue #8253 该能力现已合入datasets 5.1.0。
希望 ms-swift 接入这一能力:让不同 DP rank 直接读取各自负责的 source shards,并在本 rank 内由 DataLoader workers 继续分配读取任务,以减少重复读取和 rank 0 的集中处理压力。
Proposed changes
-
升级并验证依赖:适配 datasets 5.1.0。
-
在预处理前划分数据:对 streaming 的 HF IterableDataset,在 encode 和 packing 包装之前调用 split_dataset_by_node(...,strategy="shards" | "examples"),使用 DP rank/world size,而非全局进程 rank/world size。
-
调整 rank 间数据分发:为该模式增加 rank-local DataLoader 路径,不再由 rank 0 为所有 DP rank 读取并 scatter batch;模型并行场景仍需保持并行组内正确的 batch 共享。
-
兼容 packing 与现有模式:优先落地普通 DDP、streaming、non-packing;随后处理 streaming packing 与 Megatron。暂不满足条件的场景继续使用现有 dispatcher 路径。
-
保证训练语义:覆盖各 rank 提前耗尽、max_steps、shuffle seed/epoch、checkpoint resume,以及 shards 数量不足或负载不均时的行为。
Expected outcome
在具备足够 source shards 的 streaming 数据集上,各 DP rank 只读取分配给自己的 shards,shards数不足时,可按照example级别做数据划分,消除现有 rank 0 集中预处理的瓶颈。在我们的内部环境测试下,多dp并行度模式下,数据部分的处理吞吐可提升n倍。
Pull Request / Pull Request 信息
No response
- Lingua principale
- Python
- Stelle
- 16.2k
- Fork
- 1.8k
- Merge medio
- 1g 14h
- PR unite (30g)
- 68
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di modelscope/ms-swift
-
get_multimodal_target_regex(..., exclude_router=True) does not exclude shared_expert_gateForse già presa @KonnyakuMatcha l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
modelscope/ms-swift#10696 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] GRPO REAL loss crashes with beta>0 and kl_in_reward=True (NoneType * Tensor)Forse già presa @newcloud123 l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
modelscope/ms-swift#10690 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] GRPO REAL loss divides by all groups instead of valid groups, silently scaling gradientsForse già presa @newcloud123 l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
modelscope/ms-swift#10688 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 Mezza giornata Idoneità per principianti 62/100
modelscope/ms-swift#10621 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] `get_seed` consumes a draw from the shared RandomState even when decision augmentation is disabled, changing the train/val split and dataset shuffleForse già presa @ryznren l’ha presa 38 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
modelscope/ms-swift#10466 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di modelscope/ms-swift
Issue simili
-
Test: to_hijri() accepts datetime.datetime and uses only the date partForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertagood first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
omarelshamy25x/shamy-hijri#63 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
polish
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresForse già presa @AshutoshSingh840 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
UKGovernmentBEIS/control-arena#992 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
mvalentsev/awesome-free-ai-coding#70 ·
I maintainer di solito rispondono entro 1 giorno