dataflex 1.0.0__tar.gz → 1.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. {dataflex-1.0.0/src/dataflex.egg-info → dataflex-1.2.0}/PKG-INFO +54 -22
  2. {dataflex-1.0.0 → dataflex-1.2.0}/README.md +39 -8
  3. {dataflex-1.0.0 → dataflex-1.2.0}/pyproject.toml +8 -4
  4. dataflex-1.2.0/requirements.txt +30 -0
  5. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/cli.py +115 -22
  6. dataflex-1.2.0/src/dataflex/configs/components.yaml +906 -0
  7. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/core/registry.py +4 -3
  8. dataflex-1.2.0/src/dataflex/launcher.py +235 -0
  9. dataflex-1.2.0/src/dataflex/offline_selector/offline_presel_selector.py +824 -0
  10. dataflex-1.2.0/src/dataflex/offline_selector/prepare_dynamic_presel.py +173 -0
  11. dataflex-1.2.0/src/dataflex/offline_selector/record_presel_pipeline.py +218 -0
  12. dataflex-1.2.0/src/dataflex/offline_selector/record_presel_selector.py +264 -0
  13. dataflex-1.2.0/src/dataflex/train/data/loader.py +726 -0
  14. dataflex-1.2.0/src/dataflex/train/hooks.py +249 -0
  15. dataflex-1.2.0/src/dataflex/train/hparams/dynamic_data_params.py +53 -0
  16. dataflex-1.2.0/src/dataflex/train/hparams/dynamic_params.py +120 -0
  17. dataflex-1.2.0/src/dataflex/train/lego/__init__.py +47 -0
  18. dataflex-1.2.0/src/dataflex/train/lego/checkpoint.py +191 -0
  19. dataflex-1.2.0/src/dataflex/train/lego/context.py +182 -0
  20. dataflex-1.2.0/src/dataflex/train/lego/domain_view.py +93 -0
  21. dataflex-1.2.0/src/dataflex/train/lego/pipeline.py +646 -0
  22. dataflex-1.2.0/src/dataflex/train/lego/plan.py +104 -0
  23. dataflex-1.2.0/src/dataflex/train/lego/scoreboard.py +461 -0
  24. dataflex-1.2.0/src/dataflex/train/lego/stages.py +760 -0
  25. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/mixer/doremi_mixer.py +128 -74
  26. dataflex-1.2.0/src/dataflex/train/mixer/odm_mixer.py +476 -0
  27. dataflex-1.2.0/src/dataflex/train/reorder/__init__.py +58 -0
  28. dataflex-1.2.0/src/dataflex/train/reorder/base_reorder.py +255 -0
  29. dataflex-1.2.0/src/dataflex/train/reorder/dynamic_reorder.py +267 -0
  30. dataflex-1.2.0/src/dataflex/train/reorder/patterns.py +316 -0
  31. dataflex-1.2.0/src/dataflex/train/reorder/score_provider.py +565 -0
  32. dataflex-1.2.0/src/dataflex/train/reorder/static_reorder.py +170 -0
  33. dataflex-1.2.0/src/dataflex/train/selector/__init__.py +16 -0
  34. dataflex-1.2.0/src/dataflex/train/selector/adapt_inf_selector.py +699 -0
  35. dataflex-1.2.0/src/dataflex/train/selector/base_selector.py +152 -0
  36. dataflex-1.2.0/src/dataflex/train/selector/cluster_base_selector.py +413 -0
  37. dataflex-1.2.0/src/dataflex/train/selector/cluster_less_selector.py +287 -0
  38. dataflex-1.2.0/src/dataflex/train/selector/cluster_loss_selector.py +181 -0
  39. dataflex-1.2.0/src/dataflex/train/selector/cluster_tracin_selector.py +247 -0
  40. dataflex-1.2.0/src/dataflex/train/selector/coincide_selector.py +816 -0
  41. dataflex-1.2.0/src/dataflex/train/selector/delta_loss_selector.py +272 -0
  42. dataflex-1.2.0/src/dataflex/train/selector/dynamic_presel_selector.py +232 -0
  43. dataflex-1.2.0/src/dataflex/train/selector/icons_selector.py +528 -0
  44. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/selector/less_selector.py +21 -1
  45. dataflex-1.2.0/src/dataflex/train/selector/loss_selector.py +228 -0
  46. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/selector/nice_selector.py +5 -1
  47. dataflex-1.2.0/src/dataflex/train/selector/tracin_selector.py +210 -0
  48. dataflex-1.2.0/src/dataflex/train/trainer/lego_trainer.py +507 -0
  49. dataflex-1.2.0/src/dataflex/train/trainer/mix_trainer.py +439 -0
  50. dataflex-1.2.0/src/dataflex/train/trainer/reorder_trainer.py +143 -0
  51. dataflex-1.2.0/src/dataflex/train/trainer/select_trainer.py +458 -0
  52. dataflex-1.2.0/src/dataflex/train/trainer/weight_trainer.py +269 -0
  53. dataflex-1.2.0/src/dataflex/train/weighter/__init__.py +8 -0
  54. dataflex-1.2.0/src/dataflex/train/weighter/adapt_weighter.py +90 -0
  55. dataflex-1.2.0/src/dataflex/train/weighter/base_weighter.py +477 -0
  56. dataflex-1.2.0/src/dataflex/train/weighter/joint_update_aware_weighter.py +393 -0
  57. dataflex-1.2.0/src/dataflex/train/weighter/multimodal_adapt_weighter.py +356 -0
  58. dataflex-1.2.0/src/dataflex/train/weighter/multimodal_deltaloss_weighter.py +252 -0
  59. dataflex-1.2.0/src/dataflex/train/weighter/multimodal_loss_weighter.py +203 -0
  60. dataflex-1.2.0/src/dataflex/utils/llava_v1d5_ckpt_merge.py +441 -0
  61. dataflex-1.2.0/src/dataflex/utils/load_component.py +55 -0
  62. dataflex-1.2.0/src/dataflex/utils/loss_utils.py +81 -0
  63. dataflex-1.2.0/src/dataflex/utils/multimodal_scoring.py +119 -0
  64. dataflex-1.2.0/src/dataflex/utils/multimodal_selection.py +104 -0
  65. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/utils/selector_io.py +3 -3
  66. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/version.py +1 -1
  67. {dataflex-1.0.0 → dataflex-1.2.0/src/dataflex.egg-info}/PKG-INFO +54 -22
  68. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex.egg-info/SOURCES.txt +39 -0
  69. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex.egg-info/requires.txt +15 -14
  70. dataflex-1.0.0/requirements.txt +0 -32
  71. dataflex-1.0.0/src/dataflex/configs/components.yaml +0 -151
  72. dataflex-1.0.0/src/dataflex/launcher.py +0 -147
  73. dataflex-1.0.0/src/dataflex/train/data/loader.py +0 -164
  74. dataflex-1.0.0/src/dataflex/train/hparams/dynamic_data_params.py +0 -200
  75. dataflex-1.0.0/src/dataflex/train/hparams/dynamic_params.py +0 -649
  76. dataflex-1.0.0/src/dataflex/train/mixer/odm_mixer.py +0 -278
  77. dataflex-1.0.0/src/dataflex/train/selector/__init__.py +0 -8
  78. dataflex-1.0.0/src/dataflex/train/selector/base_selector.py +0 -56
  79. dataflex-1.0.0/src/dataflex/train/selector/delta_loss_selector.py +0 -271
  80. dataflex-1.0.0/src/dataflex/train/selector/loss_selector.py +0 -197
  81. dataflex-1.0.0/src/dataflex/train/trainer/mix_trainer.py +0 -1102
  82. dataflex-1.0.0/src/dataflex/train/trainer/select_trainer.py +0 -887
  83. dataflex-1.0.0/src/dataflex/train/trainer/weight_trainer.py +0 -773
  84. dataflex-1.0.0/src/dataflex/train/weighter/__init__.py +0 -3
  85. dataflex-1.0.0/src/dataflex/train/weighter/base_weighter.py +0 -147
  86. dataflex-1.0.0/src/dataflex/utils/load_component.py +0 -24
  87. {dataflex-1.0.0 → dataflex-1.2.0}/LICENSE +0 -0
  88. {dataflex-1.0.0 → dataflex-1.2.0}/MANIFEST.in +0 -0
  89. {dataflex-1.0.0 → dataflex-1.2.0}/setup.cfg +0 -0
  90. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/__init__.py +0 -0
  91. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/core/__init__.py +0 -0
  92. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/offline_selector/offline_near_selector.py +0 -0
  93. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/offline_selector/offline_tsds_selector.py +0 -0
  94. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/__init__.py +0 -0
  95. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/data/__init__.py +0 -0
  96. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/dataset/__init__.py +0 -0
  97. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/dataset/mixed_proportion_manager.py +0 -0
  98. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/hparams/__init__.py +0 -0
  99. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/mixer/__init__.py +0 -0
  100. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/mixer/base_mixer.py +0 -0
  101. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/mixer/dynamic_moe_mixer.py +0 -0
  102. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/mixer/random_mixer.py +0 -0
  103. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/mixer/static_mixer.py +0 -0
  104. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/selector/custom_selector.py +0 -0
  105. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/selector/near_selector.py +0 -0
  106. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/selector/random_selector.py +0 -0
  107. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/selector/tsds_selector.py +0 -0
  108. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/trainer/__init__.py +0 -0
  109. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/weighter/custom_weighter.py +0 -0
  110. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/train/weighter/loss_weighter.py +0 -0
  111. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/utils/__init__.py +0 -0
  112. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex/utils/logging.py +0 -0
  113. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex.egg-info/dependency_links.txt +0 -0
  114. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex.egg-info/entry_points.txt +0 -0
  115. {dataflex-1.0.0 → dataflex-1.2.0}/src/dataflex.egg-info/top_level.txt +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dataflex
3
- Version: 1.0.0
3
+ Version: 1.2.0
4
4
  Summary: A data-centric training system for Large Language Models
5
5
  Author-email: Hao Liang <hao.liang@stu.pku.edu.cn>, Mingrui Chen <charmier2003@gmail.com>
6
6
  License: Apache-2.0
7
7
  Project-URL: Github, https://github.com/OpenDCAI/DataFlex
8
- Project-URL: Documentation, https://opendcai.github.io/DataFlow-Doc
8
+ Project-URL: Documentation, https://opendcai.github.io/DataFlex-Doc/
9
9
  Project-URL: Bug Reports, https://github.com/OpenDCAI/DataFlex/issues
10
10
  Keywords: AI,data-centric,LLM,training,data selection,Data Mixture
11
11
  Classifier: Development Status :: 4 - Beta
@@ -15,27 +15,21 @@ Classifier: Intended Audience :: Science/Research
15
15
  Classifier: License :: OSI Approved :: Apache Software License
16
16
  Classifier: Operating System :: OS Independent
17
17
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
19
  Classifier: Programming Language :: Python :: 3.12
21
20
  Classifier: Programming Language :: Python :: 3 :: Only
22
21
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
- Requires-Python: >=3.10
22
+ Requires-Python: >=3.11
24
23
  Description-Content-Type: text/markdown
25
24
  License-File: LICENSE
26
25
  Requires-Dist: torch<=2.10.0,>=2.4.0
27
26
  Requires-Dist: torchvision<=0.21.0,>=0.19.0
28
27
  Requires-Dist: torchaudio<=2.6.0,>=2.4.0
29
- Requires-Dist: transformers<4.55.0,>=4.51.0; python_version >= "3.11"
30
- Requires-Dist: transformers<=4.50.0,>=4.41.2; python_version < "3.11"
28
+ Requires-Dist: transformers!=4.57.0,<=5.6.0,>=4.55.0
31
29
  Requires-Dist: accelerate<1.12.0,>=1.3.0
32
- Requires-Dist: trl<0.25.0,>=0.18.0
33
30
  Requires-Dist: tyro==0.8.14
34
- Requires-Dist: numpy<2.0.0,>=1.24.0
35
- Requires-Dist: peft>=0.15.2
36
- Requires-Dist: datasets<=3.2.0,>=2.16.0
37
- Requires-Dist: tokenizers>=0.21.0
38
- Requires-Dist: gradio<=5.12.0,>=4.38.0
31
+ Requires-Dist: numpy>=1.24.0
32
+ Requires-Dist: datasets<=4.0.0,>=2.16.0
39
33
  Requires-Dist: pandas<3.0.0,>=2.0.0
40
34
  Requires-Dist: scipy
41
35
  Requires-Dist: einops
@@ -53,8 +47,7 @@ Requires-Dist: pyyaml
53
47
  Requires-Dist: av
54
48
  Requires-Dist: librosa
55
49
  Requires-Dist: omegaconf
56
- Requires-Dist: traker
57
- Requires-Dist: llamafactory>=0.9.4; python_version >= "3.11"
50
+ Requires-Dist: llamafactory>=0.9.5
58
51
  Provides-Extra: torch
59
52
  Requires-Dist: torch<=2.10.0,>=2.4.0; extra == "torch"
60
53
  Requires-Dist: torchvision<=0.21.0,>=0.19.0; extra == "torch"
@@ -63,6 +56,14 @@ Provides-Extra: torch-npu
63
56
  Requires-Dist: torch==2.4.0; extra == "torch-npu"
64
57
  Requires-Dist: torch-npu==2.4.0.post2; extra == "torch-npu"
65
58
  Requires-Dist: decorator; extra == "torch-npu"
59
+ Provides-Extra: deepspeed
60
+ Requires-Dist: deepspeed<0.17.0,>=0.15.0; extra == "deepspeed"
61
+ Provides-Extra: less
62
+ Requires-Dist: traker; extra == "less"
63
+ Provides-Extra: multimodal-selection
64
+ Requires-Dist: scikit-learn>=1.3; extra == "multimodal-selection"
65
+ Requires-Dist: faiss-cpu>=1.8; extra == "multimodal-selection"
66
+ Requires-Dist: traker; extra == "multimodal-selection"
66
67
  Provides-Extra: metrics
67
68
  Requires-Dist: nltk; extra == "metrics"
68
69
  Requires-Dist: jieba; extra == "metrics"
@@ -120,6 +121,7 @@ Dynamic: license-file
120
121
  [![](https://img.shields.io/github/contributors/OpenDCAI/DataFlex)](https://github.com/OpenDCAI/DataFlex/graphs/contributors)
121
122
  [![](https://img.shields.io/github/repo-size/OpenDCAI/DataFlex?color=green)](https://github.com/OpenDCAI/DataFlex)
122
123
  [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/OpenDCAI/DataFlex)
124
+ [![NeurIPS 2026](https://img.shields.io/badge/NeurIPS_2026-Accepted-success)](https://neurips.cc/Conferences/2026)
123
125
 
124
126
  <!-- [![](https://img.shields.io/github/last-commit/OpenDCAI/DataFlex)](https://github.com/OpenDCAI/DataFlex/commits/main/) -->
125
127
  <!--[![](https://img.shields.io/github/issues-raw/OpenDCAI/DataFlex)](https://github.com/OpenDCAI/DataFlex/issues) -->
@@ -131,6 +133,7 @@ Dynamic: license-file
131
133
  </div>
132
134
 
133
135
  ## 📰 1. News
136
+ - **[2026-09-25] 🎉 DataFlex has been accepted to the NeurIPS 2026 Evaluation & Dataset Track!** Our paper, *DataFlex: A Unified Benchmark and Evaluation Platform for Data-Centric Training of Large Language Models*, will appear at **NeurIPS 2026**.
134
137
  - [2026-04-04] 🎉 Our [technical report](https://huggingface.co/papers/2603.26164) ranked #1 on the Hugging Face Daily Papers leaderboard for that day.
135
138
  - [2026-03-17] We now support gradient computation under DeepSpeed ZeRO-3, enabling training and analysis of larger-scale models.
136
139
  - [2025-12-23] 🎉 We’re excited to announce the first Data-Centric Training System DataFlex, is now released! Stay tuned for future updates.
@@ -184,6 +187,7 @@ We summarize repositories related to Data Selection, Data Mixture, and Data Rewe
184
187
  | Method | Category | Requires Model-in-the-Loop? | Official Repo |
185
188
  |:------:|:--------:|:---------------------------:|:-------------:|
186
189
  | **Loss Reweighting** | Loss-Based | ✅ Yes | ❌ |
190
+ | **Joint-Update-Aware Reweighting** | Batch-Aware | ✅ Yes | ❌ |
187
191
 
188
192
  </div>
189
193
 
@@ -193,13 +197,39 @@ We summarize repositories related to Data Selection, Data Mixture, and Data Rewe
193
197
 
194
198
  Please use the following commands for environment setup and installation👇
195
199
 
200
+ Install torch first, so pip does not resolve a different build and then have to replace it:
201
+
202
+ ```bash
203
+ pip install --index-url https://download.pytorch.org/whl/cu124 \
204
+ torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0
205
+ python -c "import torch; print(torch.__version__, torch.cuda.is_available())"
206
+ ```
207
+
208
+ Then install DataFlex:
209
+
210
+ ```bash
211
+ pip install dataflex
212
+ ```
213
+
214
+ Or install from source for development:
215
+
196
216
  ```bash
197
217
  git clone https://github.com/OpenDCAI/DataFlex.git
198
218
  cd DataFlex
199
219
  pip install -e .
200
220
  ```
201
221
 
202
- > **Note:** Python 3.11+ is recommended. The core dependencies (including `llamafactory`) will be installed automatically. If you are using Python 3.10, you need to install a compatible version of `llamafactory` manually.
222
+ Every config under `examples/deepspeed` needs DeepSpeed, which ships as an optional extra:
223
+
224
+ ```bash
225
+ pip install "dataflex[deepspeed]" # from source: pip install -e ".[deepspeed]"
226
+ ```
227
+
228
+ > **Note:** Requires Python 3.11+ and LlamaFactory 0.9.5+, installed automatically along with the other core dependencies. Works on transformers 4.55 through 5.6; the newer model families (Qwen3.5, Gemma 4) need transformers 5.5+. We recommend transformers 5.3+ if you need `train_from_scratch` under DeepSpeed ZeRO-3.
229
+ >
230
+ > The `deepspeed` extra stays below 0.17 on purpose: 0.17+ fails to import on the torch pinned above. On a newer torch you are free to lift that cap.
231
+ >
232
+ > The LESS selector needs TRAK, which is another optional extra: `pip install dataflex[less]`.
203
233
 
204
234
  The launch command is similar to [LLaMA-Factory](https://github.com/hiyouga/LLaMA-Factory).
205
235
  Below is an example using [LESS](https://arxiv.org/abs/2402.04333) :
@@ -345,18 +375,20 @@ The two projects are independent with no code dependency, connected only by stan
345
375
 
346
376
  ## 🤝 6. Acknowledgements
347
377
  We thank [LLaMA-Factory](https://github.com/hiyouga/LLaMA-Factory) for offering an efficient and user-friendly framework for large model fine-tuning, which greatly facilitated rapid iteration in our training and experimentation workflows.
348
- We thank Zhongguancun Academy for their API and GPU support.
378
+ We thank Zhongguancun Academy for their API and GPU support [![中关村学院 GitHub 组织](https://img.shields.io/badge/Linked%20to-bjzgcai%20Org-blue?logo=github)](https://github.com/bjzgcai).
349
379
  Our gratitude extends to all contributors in the open-source community—their efforts collectively drive the development of DataFlex.
350
380
 
351
381
  ## 📜 7. Citation
352
382
 
353
- If you use DataFlex in your research, feel free to give us a cite.
383
+ The DataFlex paper has been accepted to the **NeurIPS 2026 Evaluation & Dataset Track**. If you find DataFlex useful in your research, please consider citing our papers:
354
384
  ```bibtex
355
- @article{liang2026dataflex,
356
- title={DataFlex: A Unified Framework for Data-Centric Dynamic Training of Large Language Models},
357
- author={Liang, Hao and Zhao, Zhengyang and Qiang, Meiyi and Chen, Mingrui and Ma, Lu and Yu, Rongyi and Feng, Hengyi and Sun, Shixuan and Meng, Zimo and Ma, Xiaochen and others},
358
- journal={arXiv preprint arXiv:2603.26164},
359
- year={2026}
385
+ @inproceedings{
386
+ liang2026dataflex,
387
+ title={DataFlex: A Unified Benchmark and Evaluation Platform for Data-Centric Training of Large Language Models},
388
+ author={Hao Liang and Zhengyang Zhao and Mingrui Chen and Meiyi Qiang and Lu Ma and Rongyi Yu and Hengyi Feng and Shixuan Sun and Zimo Meng and Xiaochen Ma and Xuanlin Yang and Qifeng Cai and Ruichuan An and Bohan Zeng and Zhen Hao Wong and Chengyu Shen and Runming He and Zhaoyang Han and Yaowei Zheng and Fangcheng Fu and Conghui He and Bin Cui and Zhiyu Li and Weinan E and Wentao Zhang},
389
+ booktitle={The Fortieth Annual Conference on Neural Information Processing Systems Evaluations and Datasets Track},
390
+ year={2026},
391
+ url={https://openreview.net/forum?id=Uaf41CPesH}
360
392
  }
361
393
 
362
394
  @article{liang2026towards,
@@ -13,6 +13,7 @@
13
13
  [![](https://img.shields.io/github/contributors/OpenDCAI/DataFlex)](https://github.com/OpenDCAI/DataFlex/graphs/contributors)
14
14
  [![](https://img.shields.io/github/repo-size/OpenDCAI/DataFlex?color=green)](https://github.com/OpenDCAI/DataFlex)
15
15
  [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/OpenDCAI/DataFlex)
16
+ [![NeurIPS 2026](https://img.shields.io/badge/NeurIPS_2026-Accepted-success)](https://neurips.cc/Conferences/2026)
16
17
 
17
18
  <!-- [![](https://img.shields.io/github/last-commit/OpenDCAI/DataFlex)](https://github.com/OpenDCAI/DataFlex/commits/main/) -->
18
19
  <!--[![](https://img.shields.io/github/issues-raw/OpenDCAI/DataFlex)](https://github.com/OpenDCAI/DataFlex/issues) -->
@@ -24,6 +25,7 @@
24
25
  </div>
25
26
 
26
27
  ## 📰 1. News
28
+ - **[2026-09-25] 🎉 DataFlex has been accepted to the NeurIPS 2026 Evaluation & Dataset Track!** Our paper, *DataFlex: A Unified Benchmark and Evaluation Platform for Data-Centric Training of Large Language Models*, will appear at **NeurIPS 2026**.
27
29
  - [2026-04-04] 🎉 Our [technical report](https://huggingface.co/papers/2603.26164) ranked #1 on the Hugging Face Daily Papers leaderboard for that day.
28
30
  - [2026-03-17] We now support gradient computation under DeepSpeed ZeRO-3, enabling training and analysis of larger-scale models.
29
31
  - [2025-12-23] 🎉 We’re excited to announce the first Data-Centric Training System DataFlex, is now released! Stay tuned for future updates.
@@ -77,6 +79,7 @@ We summarize repositories related to Data Selection, Data Mixture, and Data Rewe
77
79
  | Method | Category | Requires Model-in-the-Loop? | Official Repo |
78
80
  |:------:|:--------:|:---------------------------:|:-------------:|
79
81
  | **Loss Reweighting** | Loss-Based | ✅ Yes | ❌ |
82
+ | **Joint-Update-Aware Reweighting** | Batch-Aware | ✅ Yes | ❌ |
80
83
 
81
84
  </div>
82
85
 
@@ -86,13 +89,39 @@ We summarize repositories related to Data Selection, Data Mixture, and Data Rewe
86
89
 
87
90
  Please use the following commands for environment setup and installation👇
88
91
 
92
+ Install torch first, so pip does not resolve a different build and then have to replace it:
93
+
94
+ ```bash
95
+ pip install --index-url https://download.pytorch.org/whl/cu124 \
96
+ torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0
97
+ python -c "import torch; print(torch.__version__, torch.cuda.is_available())"
98
+ ```
99
+
100
+ Then install DataFlex:
101
+
102
+ ```bash
103
+ pip install dataflex
104
+ ```
105
+
106
+ Or install from source for development:
107
+
89
108
  ```bash
90
109
  git clone https://github.com/OpenDCAI/DataFlex.git
91
110
  cd DataFlex
92
111
  pip install -e .
93
112
  ```
94
113
 
95
- > **Note:** Python 3.11+ is recommended. The core dependencies (including `llamafactory`) will be installed automatically. If you are using Python 3.10, you need to install a compatible version of `llamafactory` manually.
114
+ Every config under `examples/deepspeed` needs DeepSpeed, which ships as an optional extra:
115
+
116
+ ```bash
117
+ pip install "dataflex[deepspeed]" # from source: pip install -e ".[deepspeed]"
118
+ ```
119
+
120
+ > **Note:** Requires Python 3.11+ and LlamaFactory 0.9.5+, installed automatically along with the other core dependencies. Works on transformers 4.55 through 5.6; the newer model families (Qwen3.5, Gemma 4) need transformers 5.5+. We recommend transformers 5.3+ if you need `train_from_scratch` under DeepSpeed ZeRO-3.
121
+ >
122
+ > The `deepspeed` extra stays below 0.17 on purpose: 0.17+ fails to import on the torch pinned above. On a newer torch you are free to lift that cap.
123
+ >
124
+ > The LESS selector needs TRAK, which is another optional extra: `pip install dataflex[less]`.
96
125
 
97
126
  The launch command is similar to [LLaMA-Factory](https://github.com/hiyouga/LLaMA-Factory).
98
127
  Below is an example using [LESS](https://arxiv.org/abs/2402.04333) :
@@ -238,18 +267,20 @@ The two projects are independent with no code dependency, connected only by stan
238
267
 
239
268
  ## 🤝 6. Acknowledgements
240
269
  We thank [LLaMA-Factory](https://github.com/hiyouga/LLaMA-Factory) for offering an efficient and user-friendly framework for large model fine-tuning, which greatly facilitated rapid iteration in our training and experimentation workflows.
241
- We thank Zhongguancun Academy for their API and GPU support.
270
+ We thank Zhongguancun Academy for their API and GPU support [![中关村学院 GitHub 组织](https://img.shields.io/badge/Linked%20to-bjzgcai%20Org-blue?logo=github)](https://github.com/bjzgcai).
242
271
  Our gratitude extends to all contributors in the open-source community—their efforts collectively drive the development of DataFlex.
243
272
 
244
273
  ## 📜 7. Citation
245
274
 
246
- If you use DataFlex in your research, feel free to give us a cite.
275
+ The DataFlex paper has been accepted to the **NeurIPS 2026 Evaluation & Dataset Track**. If you find DataFlex useful in your research, please consider citing our papers:
247
276
  ```bibtex
248
- @article{liang2026dataflex,
249
- title={DataFlex: A Unified Framework for Data-Centric Dynamic Training of Large Language Models},
250
- author={Liang, Hao and Zhao, Zhengyang and Qiang, Meiyi and Chen, Mingrui and Ma, Lu and Yu, Rongyi and Feng, Hengyi and Sun, Shixuan and Meng, Zimo and Ma, Xiaochen and others},
251
- journal={arXiv preprint arXiv:2603.26164},
252
- year={2026}
277
+ @inproceedings{
278
+ liang2026dataflex,
279
+ title={DataFlex: A Unified Benchmark and Evaluation Platform for Data-Centric Training of Large Language Models},
280
+ author={Hao Liang and Zhengyang Zhao and Mingrui Chen and Meiyi Qiang and Lu Ma and Rongyi Yu and Hengyi Feng and Shixuan Sun and Zimo Meng and Xiaochen Ma and Xuanlin Yang and Qifeng Cai and Ruichuan An and Bohan Zeng and Zhen Hao Wong and Chengyu Shen and Runming He and Zhaoyang Han and Yaowei Zheng and Fangcheng Fu and Conghui He and Bin Cui and Zhiyu Li and Weinan E and Wentao Zhang},
281
+ booktitle={The Fortieth Annual Conference on Neural Information Processing Systems Evaluations and Datasets Track},
282
+ year={2026},
283
+ url={https://openreview.net/forum?id=Uaf41CPesH}
253
284
  }
254
285
 
255
286
  @article{liang2026towards,
@@ -10,7 +10,7 @@ authors = [
10
10
  ]
11
11
  description = "A data-centric training system for Large Language Models"
12
12
  readme = {file = "README.md", content-type = "text/markdown"}
13
- requires-python = ">=3.10"
13
+ requires-python = ">=3.11"
14
14
  license = {text = "Apache-2.0"}
15
15
  classifiers = [
16
16
  "Development Status :: 4 - Beta",
@@ -20,7 +20,6 @@ classifiers = [
20
20
  "License :: OSI Approved :: Apache Software License",
21
21
  "Operating System :: OS Independent",
22
22
  "Programming Language :: Python :: 3",
23
- "Programming Language :: Python :: 3.10",
24
23
  "Programming Language :: Python :: 3.11",
25
24
  "Programming Language :: Python :: 3.12",
26
25
  "Programming Language :: Python :: 3 :: Only",
@@ -31,7 +30,7 @@ dynamic = ["version", "dependencies"]
31
30
 
32
31
  [project.urls]
33
32
  Github = "https://github.com/OpenDCAI/DataFlex"
34
- Documentation = "https://opendcai.github.io/DataFlow-Doc"
33
+ Documentation = "https://opendcai.github.io/DataFlex-Doc/"
35
34
  "Bug Reports" = "https://github.com/OpenDCAI/DataFlex/issues"
36
35
 
37
36
  [project.scripts]
@@ -40,6 +39,11 @@ dataflex-cli = "dataflex.cli:main"
40
39
  [project.optional-dependencies]
41
40
  torch = ["torch>=2.4.0,<=2.10.0", "torchvision>=0.19.0,<=0.21.0", "torchaudio>=2.4.0,<=2.6.0"]
42
41
  torch-npu = ["torch==2.4.0", "torch-npu==2.4.0.post2", "decorator"]
42
+ # Needed by every examples/deepspeed config; 0.17+ cannot import on the torch 2.6 the README pins.
43
+ deepspeed = ["deepspeed>=0.15.0,<0.17.0"]
44
+ # TRAK is used by LESS and Adapt-inf; install it only with those extras.
45
+ less = ["traker"]
46
+ multimodal-selection = ["scikit-learn>=1.3", "faiss-cpu>=1.8", "traker"]
43
47
  metrics = ["nltk", "jieba", "rouge-chinese"]
44
48
  flash-attn = ["flash-attn>=2.5.0"]
45
49
  liger-kernel = ["liger-kernel>=0.5.5"]
@@ -69,7 +73,7 @@ version = {attr = "dataflex.version.__version__"}
69
73
  dependencies = {file = "requirements.txt"}
70
74
 
71
75
  [tool.ruff]
72
- target-version = "py310"
76
+ target-version = "py311"
73
77
  line-length = 119
74
78
  indent-width = 4
75
79
 
@@ -0,0 +1,30 @@
1
+ torch>=2.4.0,<=2.10.0
2
+ torchvision>=0.19.0,<=0.21.0
3
+ torchaudio>=2.4.0,<=2.6.0
4
+ # Same window LlamaFactory 0.9.5 accepts, spanning transformers v4 and v5.
5
+ # Qwen3.5 and Gemma 4 need >=5.5.0; the rest works across the whole range.
6
+ # 5.3.0+ is recommended: train_from_scratch under ZeRO-3 needs it.
7
+ transformers>=4.55.0,!=4.57.0,<=5.6.0
8
+ accelerate>=1.3.0,<1.12.0
9
+ tyro==0.8.14
10
+ # Uncapped: the v5 stack resolves to numpy 2.x.
11
+ numpy>=1.24.0
12
+ datasets>=2.16.0,<=4.0.0
13
+ pandas>=2.0.0,<3.0.0
14
+ scipy
15
+ einops
16
+ sentencepiece
17
+ tiktoken
18
+ protobuf
19
+ uvicorn
20
+ pydantic
21
+ fastapi
22
+ sse-starlette
23
+ matplotlib>=3.7.0
24
+ fire
25
+ packaging
26
+ pyyaml
27
+ av
28
+ librosa
29
+ omegaconf
30
+ llamafactory>=0.9.5
@@ -55,7 +55,7 @@ def patch_trainer(train_type: str):
55
55
  train_type (str): Must be one of ["static", "dynamic_select", "dynamic_mix", "dynamic_weight"].
56
56
  Determines which trainer class to inject.
57
57
  """
58
- valid_types = ["static", "dynamic_select", "dynamic_mix", "dynamic_weight"]
58
+ valid_types = ["static", "dynamic_select", "dynamic_mix", "dynamic_weight", "dynamic_reorder", "dynamic_lego"]
59
59
  if train_type not in valid_types:
60
60
  raise ValueError(f"Invalid train_type '{train_type}'. Must be one of {valid_types}.")
61
61
 
@@ -68,27 +68,33 @@ def patch_trainer(train_type: str):
68
68
  elif train_type == "dynamic_weight":
69
69
  from dataflex.train.trainer.weight_trainer import WeightTrainer
70
70
  TrainerCls = WeightTrainer
71
+ elif train_type == "dynamic_reorder":
72
+ from dataflex.train.trainer.reorder_trainer import ReorderTrainer
73
+ TrainerCls = ReorderTrainer
74
+ elif train_type == "dynamic_lego":
75
+ from dataflex.train.trainer.lego_trainer import LegoTrainer
76
+ TrainerCls = LegoTrainer
71
77
  else: # static
72
78
  TrainerCls = None
73
79
 
74
80
  if TrainerCls is not None:
75
- # 1) 替换源头模块
81
+ # 1) Replace source module
76
82
  tmod = importlib.import_module("llamafactory.train.sft.trainer")
77
83
  tmod.CustomSeq2SeqTrainer = TrainerCls
78
84
 
79
- # 2) 替换包层 re-export
85
+ # 2) Replace package layer re-export
80
86
  sft_pkg = importlib.import_module("llamafactory.train.sft")
81
87
  setattr(sft_pkg, "CustomSeq2SeqTrainer", TrainerCls)
82
88
 
83
- # 3) 替换 workflow 内部引用
89
+ # 3) Replace workflow internal references
84
90
  wflow = importlib.import_module("llamafactory.train.sft.workflow")
85
91
  setattr(wflow, "CustomSeq2SeqTrainer", TrainerCls)
86
92
 
87
- # 4) 替换 PT 训练器
93
+ # 4) Replace PT trainer
88
94
  pt_tmod = importlib.import_module("llamafactory.train.pt.trainer")
89
95
  pt_tmod.CustomTrainer = TrainerCls
90
96
 
91
- # 5) 替换 PT workflow 内部引用
97
+ # 5) Replace PT workflow internal references
92
98
  pt_wflow = importlib.import_module("llamafactory.train.pt.workflow")
93
99
  setattr(pt_wflow, "CustomTrainer", TrainerCls)
94
100
 
@@ -97,31 +103,106 @@ def patch_trainer(train_type: str):
97
103
 
98
104
  def patch_get_dataset(do_uncache_reload: bool = False):
99
105
  """
100
- 将 LlamaFactory 的 get_dataset 替换为 dataflex 版本。
101
- - 源头: llamafactory.data.loader.get_dataset -> dataflex.train.data.loader.get_dataset
102
- - 包层 re-export: 覆盖 llamafactory.data.get_dataset(如有)
103
- - 就地覆盖: 对已 from-import 的使用方(包含 workflow)直接改其全局符号
106
+ Replace LlamaFactory's get_dataset with dataflex version.
107
+ - Source: llamafactory.data.loader.get_dataset -> dataflex.train.data.loader.get_dataset
108
+ - Package layer re-export: Overwrite llamafactory.data.get_dataset (if any)
109
+ - In-place overwrite: Directly modify the global symbol for already from-imported users (including workflow)
104
110
 
105
111
  Args:
106
- do_uncache_reload: 为 True 时,会清理下游依赖缓存并预热导入,以确保后续 import 也拿到新函数。
107
- 默认为 False(与“就地打补丁”策略一致)。
112
+ do_uncache_reload: When True, will clear downstream dependency cache and warm up imports to ensure subsequent imports also get the new function.
113
+ Default is False (consistent with "in-place patching" strategy).
108
114
  """
109
- # 1) 引入新实现
115
+ # 1) Introduce new implementation
110
116
  from dataflex.train.data.loader import get_dataset as _new_get_dataset
111
- # 2) 覆盖源头模块
117
+ # 2) Overwrite source module
112
118
  data_loader_mod = importlib.import_module("llamafactory.data.loader")
113
119
  setattr(data_loader_mod, "get_dataset", _new_get_dataset)
114
- # 3) 覆盖包层 re-export(若其它代码从包层 import)
120
+ # 3) Overwrite package layer re-export (if other code imports from package layer)
115
121
  data_pkg = importlib.import_module("llamafactory.data")
116
122
  setattr(data_pkg, "get_dataset", _new_get_dataset)
117
- # 4) 就地覆盖已 from-import 的使用方(包含 workflow)
123
+ # 4) In-place overwrite already from-imported users (including workflow)
118
124
  wflow = importlib.import_module("llamafactory.train.sft.workflow")
119
125
  setattr(wflow, "get_dataset", _new_get_dataset)
120
126
 
121
- # 5) 也要patch PT workflow
127
+ # 5) Also patch PT workflow
122
128
  pt_wflow = importlib.import_module("llamafactory.train.pt.workflow")
123
129
  setattr(pt_wflow, "get_dataset", _new_get_dataset)
124
130
 
131
+ def patch_reorder_get_dataset(cfg):
132
+ """
133
+ Replace get_dataset with the version that "first reorder raw rows by score, then preprocess".
134
+
135
+ Only needed when apply_at == 'raw': the score field is removed in align_dataset,
136
+ and preprocessing does not preserve index (dirty samples are discarded, packing merges rows),
137
+ so we directly reorder the raw dataset to pass the order naturally.
138
+ When apply_at == 'index', the order is applied in trainer, and the data loading process remains unchanged.
139
+
140
+ Returns:
141
+ bool: Whether the patch is actually applied.
142
+ """
143
+ from dataflex.utils.load_component import load_component
144
+
145
+ name = cfg.get('component_name')
146
+ cfg_file = cfg.get('components_cfg_file', 'src/dataflex/configs/components.yaml')
147
+ if not name:
148
+ raise ValueError("train_type='dynamic_reorder' requires `component_name`.")
149
+
150
+ from dataflex.core.registry import REGISTRY
151
+ from dataflex.train.data.loader import make_reorder_get_dataset
152
+ from dataflex.train.reorder import resolve_reorder_kind # also registers the reorders
153
+
154
+ params = load_component('reorders', cfg_file, name, runtime_vars={})
155
+ kind = resolve_reorder_kind(name, params)
156
+
157
+ # Only "static + reorder on raw rows" needs to modify data loading. The dynamic sorting scores come from the current model,
158
+ # the order must be applied in trainer by dataset index.
159
+ if kind != 'static' or params.get('apply_at', 'raw') != 'raw':
160
+ print(f"[PatchReorder] reorder '{name}' orders by dataset index; dataset loading left untouched.")
161
+ return False
162
+
163
+ def reorder_factory():
164
+ return REGISTRY.build('reorder', kind, runtime={}, cfg=params)
165
+
166
+ _new_get_dataset = make_reorder_get_dataset(reorder_factory)
167
+
168
+ # Same four patches as patch_get_dataset: source module, package layer re-export, and
169
+ # already from-imported global symbols in sft/pt workflows.
170
+ data_loader_mod = importlib.import_module("llamafactory.data.loader")
171
+ setattr(data_loader_mod, "get_dataset", _new_get_dataset)
172
+ data_pkg = importlib.import_module("llamafactory.data")
173
+ setattr(data_pkg, "get_dataset", _new_get_dataset)
174
+ wflow = importlib.import_module("llamafactory.train.sft.workflow")
175
+ setattr(wflow, "get_dataset", _new_get_dataset)
176
+ pt_wflow = importlib.import_module("llamafactory.train.pt.workflow")
177
+ setattr(pt_wflow, "get_dataset", _new_get_dataset)
178
+
179
+ print(f"[PatchReorder] reorder '{name}' will permute raw rows before preprocessing.")
180
+ return True
181
+
182
+
183
+ def patch_lego_get_dataset():
184
+ """
185
+ Replace get_dataset with the version for combined training.
186
+
187
+ The key difference from dynamic_mix: dynamic_mix makes each data source an independent dataset and sets train_dataset to None, so selector/reorder have no indexed datasets.
188
+ The combined path goes the other way around: combine into a dataset, then give an array of domain_id labels for each sample, so the mixer becomes pure index operations, and the other three families work as usual.
189
+ """
190
+ from dataflex.train.data.loader import lego_get_dataset as _new_get_dataset
191
+
192
+ # Same four patches as patch_get_dataset: source module, package layer re-export, and
193
+ # already from-imported global symbols in sft/pt workflows.
194
+ data_loader_mod = importlib.import_module("llamafactory.data.loader")
195
+ setattr(data_loader_mod, "get_dataset", _new_get_dataset)
196
+ data_pkg = importlib.import_module("llamafactory.data")
197
+ setattr(data_pkg, "get_dataset", _new_get_dataset)
198
+ wflow = importlib.import_module("llamafactory.train.sft.workflow")
199
+ setattr(wflow, "get_dataset", _new_get_dataset)
200
+ pt_wflow = importlib.import_module("llamafactory.train.pt.workflow")
201
+ setattr(pt_wflow, "get_dataset", _new_get_dataset)
202
+
203
+ print("[PatchLego] dataset will carry a per-sample domain_id for the pipeline.")
204
+
205
+
125
206
  def read_args():
126
207
  file_path = sys.argv[1]
127
208
  override_config = OmegaConf.from_cli(sys.argv[2:])
@@ -130,7 +211,7 @@ def read_args():
130
211
  dict_config = OmegaConf.load(Path(file_path).absolute())
131
212
  cfg = OmegaConf.merge(dict_config, override_config)
132
213
  else:
133
- cfg = OmegaConf.create({}) # CLI 直接传参时
214
+ cfg = OmegaConf.create({}) # When passing CLI arguments directly
134
215
 
135
216
  return OmegaConf.to_container(cfg)
136
217
 
@@ -157,16 +238,28 @@ def print_welcome():
157
238
  def main():
158
239
  command = sys.argv.pop(1)
159
240
  if command == "version":
160
- # 只打印版本和欢迎
241
+ # Only print version and welcome
161
242
  print_welcome()
162
243
  return
244
+ elif command == "presel":
245
+ from dataflex.offline_selector.offline_presel_selector import main as presel_main
246
+
247
+ presel_main(sys.argv[1:])
248
+ return
163
249
  elif command != 'train':
164
250
  raise ValueError(f'Unknown command: {command}')
165
251
  cfg = read_args()
252
+ train_type = cfg.get('train_type', 'static')
166
253
  patch_finetune_params()
167
- patch_trainer(cfg['train_type'] if 'train_type' in cfg else 'static')
168
- if cfg['train_type'] == 'dynamic_mix':
254
+ patch_trainer(train_type)
255
+ if train_type == 'dynamic_mix':
169
256
  patch_get_dataset()
257
+ elif train_type == 'dynamic_reorder':
258
+ patch_reorder_get_dataset(cfg)
259
+ elif train_type == 'dynamic_lego' or (
260
+ train_type == 'dynamic_select' and cfg.get('component_name') == 'dynamic_presel'
261
+ ):
262
+ patch_lego_get_dataset()
170
263
 
171
264
  from llamafactory.train.tuner import run_exp
172
265
  from llamafactory.extras.misc import is_env_enabled, get_device_count, use_ray
@@ -199,4 +292,4 @@ def main():
199
292
  )
200
293
  sys.exit(process.returncode)
201
294
  else:
202
- run_exp()
295
+ run_exp(cfg)