Redpajama 配置文件¶
Data-Juicer-Hub 中的文件夹包含的配置文件用于轻松复现 Redpajama 的处理流程。
在开始前,请将 data-juicer-hub 仓库克隆到本地,其已经包含了大量的数据处理菜谱。
git clone https://github.com/datajuicer/data-juicer-hub.git
arXiv¶
原始数据文件从 Redpajama/arXiv 中相同的 AWS 链接下载。
下载完成后,使用 raw_arxiv_to_jsonl.py 将原始格式转换为 Data-Juicer 易于处理的格式:
python tools/preprocess/raw_arxiv_to_jsonl.py \
--arxiv_src_dir <arxiv_src_dir> \
--target_dir <target_dir> \
--temp_dir <temp_dir> \
--num_proc <num_proc>
预处理完成后,修改 redpajama-arxiv.yaml 中的数据路径,执行以下命令复现 RedPajama 的处理流程:
python tools/process_data.py --config <path-to-data-juicer-hub>/reproduced_redpajama/redpajama-arxiv.yaml
指标对比¶
样本数 |
令牌数 |
峰值内存 |
运行时间 |
|
|---|---|---|---|---|
redpajama |
1,724,497 |
30,667,506,934 |
35GB |
|
Data-Juicer |
2,675,426 |
30,338,153,178 |
21GB |
preprocess: 5h21min |
Books¶
原始数据文件从 Redpajama/Books 中相同的 HuggingFace 链接下载。
下载完成后,修改 redpajama-books.yaml 中的数据路径,执行以下命令复现 RedPajama 的处理流程:
python tools/process_data.py --config <path-to-data-juicer-hub>/reproduced_redpajama/redpajama-books.yaml
指标对比¶
样本数 |
令牌数 |
峰值内存 |
运行时间 |
|
|---|---|---|---|---|
redpajama |
205,183 |
25,962,395,123 |
450GB |
split_for_dedup: 5min |
Data-Juicer |
207,902 |
26,108,635,683 |
96GB |
read+unify: 20min |
Code¶
原始数据文件从 Redpajama/Code 中相同的 Google BigQuery 获取。
下载完成后,解压缩并删除扩展名不在以下白名单中的其他文件:
.asm, .bat, .cmd, .c, .h, .cs, .cpp, .hpp, .c++, .h++, .cc, .hh, .C, .H, .cmake, .css, .dockerfile, .f90, .f, .f03, .f08, .f77, .f95, .for, .fpp, .go, .hs, .html, .java, .js, .jl, .lua, .md, .markdown, .php, .php3, .php4, .php5, .phps, .phpt, .pl, .pm, .pod, .perl, ps1, .psd1, .psm1, .py, .rb, .rs, .sql, .scala, .sh, .bash, .command, .zsh, .ts, .tsx, .tex, .vb, Dockerfile, Makefile, .xml, .rst, .m, .smali
修改 redpajama-code.yaml 中的数据路径,执行以下命令复现 redpajama 的处理流程:
python tools/process_data.py --config <path-to-data-juicer-hub>/reproduced_redpajama/redpajama-code.yaml
指标对比¶
样本数 |
令牌数 |
峰值内存 |
运行时间 |
|
|---|---|---|---|---|
redpajama |
73,208,524 |
150,390,270,060 |
212GB |
local-dedup: 37h |
Data-Juicer |
73,169,889 |
150,310,903,230 |
370GB |
preprocess: 5h21min |
StackExchange¶
原始数据文件从 Redpajama/Stack_exchange 中相同的 Archive 链接获取。
下载完成后,使用 raw_stackexchange_to_jsonl.py 将原始格式转换为 Data-Juicer 易于处理的格式:
python tools/preprocess/raw_arxiv_stackexchange_to_jsonl.py \
--src_dir <src_dir> \
--target_dir <target_dir> \
--topk <topk> \
--num_proc <num_proc> \
预处理完成后,修改 redpajama-stackexchange.yaml 中的数据路径,执行以下命令复现 redpajama 的处理流程:
python tools/process_data.py --config <path-to-data-juicer-hub>/reproduced_redpajama/redpajama-stackexchange.yaml
指标对比¶
样本数 |
令牌数 |
峰值内存 |
运行时间 |
|
|---|---|---|---|---|
redpajama |
29,825,086 |
20,502,757,123 |
>500GB |
filter: 170min |
Data-Juicer |
29,825,086 |
20,628,082,262 |
100GB |
preprocess: 210min |