You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Improve and shorten.
* Include links to blogs and tutorials.
* Remove incorrect info about non-existent branches.
* Add a header and a diagram.
* Add a note about incremental deduplication.
Signed-off-by: Mehran Maghoumi <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+62-50Lines changed: 62 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -1,49 +1,56 @@
1
-
# NeMo Curator
1
+
<divalign="center">
2
2
3
-
NeMo Curator is a Python library specifically designed for scalable and efficient dataset preparation. It greatly accelerates data curation by leveraging GPUs with [Dask](https://www.dask.org/) and [RAPIDS](https://developer.nvidia.com/rapids), resulting in significant time savings. The library provides a customizable and modular interface, simplifying pipeline expansion and accelerating model convergence through the preparation of high-quality tokens.
At the core of the NeMo Curator is the `DocumentDataset` which serves as the the main dataset class. It acts as a straightforward wrapper around a Dask `DataFrame`. The Python library offers easy-to-use methods for expanding the functionality of your curation pipeline while eliminating scalability concerns.
9
+
</div>
6
10
7
-
## Key Features
11
+
# NeMo Curator
12
+
🚀 **The GPU-Accelerated Open Source Framework for Efficient Large Language Model Data Curation** 🚀
8
13
9
-
NeMo Curator provides a collection of scalable data-mining modules. Some of the key features include:
[Data download and text extraction](docs/user-guide/download.rst)
18
+
NeMo Curator is a Python library specifically designed for fast and scalable dataset preparation and curation for [large language model (LLM)](https://www.nvidia.com/en-us/glossary/large-language-models/) use-cases such as foundation model pretraining, domain-adaptive pretraining (DAPT), supervised fine-tuning (SFT) and paramter-efficient fine-tuning (PEFT). It greatly accelerates data curation by leveraging GPUs with [Dask](https://www.dask.org/) and [RAPIDS](https://developer.nvidia.com/rapids), resulting in significant time savings. The library provides a customizable and modular interface, simplifying pipeline expansion and accelerating model convergence through the preparation of high-quality tokens.
12
19
13
-
- Default implementations for downloading and extracting Common Crawl, Wikipedia, and ArXiv data
14
-
- Easily customize the download and extraction and extend to other datasets
20
+
At the core of the NeMo Curator is the `DocumentDataset` which serves as the the main dataset class. It acts as a straightforward wrapper around a Dask `DataFrame`. The Python library offers easy-to-use methods for expanding the functionality of your curation pipeline while eliminating scalability concerns.
15
21
16
-
[Language identification and separation](docs/user-guide/languageidentificationunicodeformatting.rst)
22
+
## Key Features
17
23
18
-
- Language identification with [fastText](https://fasttext.cc/docs/en/language-identification.html) and [pycld2](https://pypi.org/project/pycld2/)
24
+
NeMo Curator provides a collection of scalable data-mining modules. Some of the key features include:
19
25
20
-
[Text reformatting and cleaning](docs/user-guide/languageidentificationunicodeformatting.rst)
26
+
-[Data download and text extraction](docs/user-guide/download.rst)
21
27
22
-
- Fix unicode decoding errors via [ftfy](https://ftfy.readthedocs.io/en/latest/)
28
+
- Default implementations for downloading and extracting Common Crawl, Wikipedia, and ArXiv data
29
+
- Easily customize the download and extraction and extend to other datasets
-[Language identification and separation](docs/user-guide/languageidentificationunicodeformatting.rst) with [fastText](https://fasttext.cc/docs/en/language-identification.html) and [pycld2](https://pypi.org/project/pycld2/)
25
32
26
-
- Multilingual heuristic-based filtering
27
-
- Classifier-based filtering via [fastText](https://fasttext.cc/)
33
+
-[Text reformatting and cleaning](docs/user-guide/languageidentificationunicodeformatting.rst) to fix unicode decoding errors via [ftfy](https://ftfy.readthedocs.io/en/latest/)
- Our implementation follows the approach of [OpenAI GPT3](https://arxiv.org/pdf/2005.14165.pdf) and [Microsoft Turing NLG 530B](https://arxiv.org/abs/2201.11990)
42
+
- Both exact and fuzzy (near-identical) deduplication are accelerated using cuDF and Dask
43
+
- For fuzzy deduplication, our implementation follows the method described in [Microsoft Turing NLG 530B](https://arxiv.org/abs/2201.11990)
37
44
38
-
[Distributed data classification](docs/user-guide/distributeddataclassification.rst)
45
+
-[Multilingual downstream-task decontamination](docs/user-guide/taskdecontamination.rst) following the approach of [OpenAI GPT3](https://arxiv.org/pdf/2005.14165.pdf) and [Microsoft Turing NLG 530B](https://arxiv.org/abs/2201.11990)
39
46
40
-
- Multi-node, multi-GPU classifier inference
41
-
- Provides sophisticated domain and quality classification
42
-
- Flexible interface for extending to your own classifier network
47
+
-[Distributed data classification](docs/user-guide/distributeddataclassification.rst)
43
48
44
-
[Personal identifiable information (PII) redaction](docs/user-guide/personalidentifiableinformationidentificationandremoval.rst)
49
+
- Multi-node, multi-GPU classifier inference
50
+
- Provides sophisticated domain and quality classification
51
+
- Flexible interface for extending to your own classifier network
45
52
46
-
-Identification tools for removing addresses, credit card numbers, social security numbers, and more
53
+
-[Personal identifiable information (PII) redaction](docs/user-guide/personalidentifiableinformationidentificationandremoval.rst) for removing addresses, credit card numbers, social security numbers, and more
47
54
48
55
These modules offer flexibility and permit reordering, with only a few exceptions. In addition, the [NeMo Framework Launcher](https://github.com/NVIDIA/NeMo-Megatron-Launcher) provides pre-built pipelines that can serve as a foundation for your customization use cases.
49
56
@@ -52,12 +59,18 @@ These modules offer flexibility and permit reordering, with only a few exception
52
59
-[Documentation](docs/)
53
60
-[Examples](examples/)
54
61
-[Tutorials](tutorials/)
62
+
- Blog posts
63
+
-[Curating Trillion-Token Datasets: Introducing NVIDIA NeMo Data Curator](https://developer.nvidia.com/blog/curating-trillion-token-datasets-introducing-nemo-data-curator/)
64
+
-[Scale and Curate High-Quality Datasets for LLM Training with NVIDIA NeMo Curator](https://developer.nvidia.com/blog/scale-and-curate-high-quality-datasets-for-llm-training-with-nemo-curator/)
65
+
-[Curating Custom Datasets for LLM Training with NVIDIA NeMo Curator](https://developer.nvidia.com/blog/curating-custom-datasets-for-llm-training-with-nvidia-nemo-curator/)
55
66
56
67
## Get Started
57
68
58
69
This section explains how to install NeMo Curator and use the Python library, Python modules, and CLI scripts. It also includes a list of tutorials to help you get started right away. Finally, this section explains how to use the NeMo Framework Launcher as an alternative method for interfacing with NeMo Curator.
59
70
60
-
## Requirements
71
+
### Install NeMo Curator
72
+
73
+
#### Requirements
61
74
62
75
Before installing NeMo Curator, ensure that the following requirements are met:
63
76
@@ -67,13 +80,9 @@ Before installing NeMo Curator, ensure that the following requirements are met:
67
80
- Volta™ or higher ([compute capability 7.0+](https://developer.nvidia.com/cuda-gpus))
68
81
- CUDA 12 (or above)
69
82
70
-
## Install NeMo Curator
71
-
72
83
You can install NeMo-Curator from PyPi, from source or get it through the NeMo Framework container.
73
84
74
-
### PyPi
75
-
76
-
NeMo Curator can be installed via PyPi as follows -
85
+
#### From PyPi
77
86
78
87
To install the CPU-only modules:
79
88
@@ -87,7 +96,7 @@ To install the CPU and CUDA-accelerated modules:
NeMo Curator is available in the [NeMo Framework Container](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/nemo/tags). The latest release of NeMo Curator comes preinstalled in the container.
122
+
#### From the NeMo Framework Container
116
123
117
-
If you want the latest commit inside the container, uninstall the existing version using:
124
+
The latest release of NeMo Curator comes preinstalled in the [NeMo Framework Container](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/nemo/tags). If you want the latest commit inside the container, uninstall the existing version using:
118
125
119
126
```bash
120
127
pip uninstall nemo-curator
121
128
```
122
129
And follow the instructions for installing from source from [above](#from-source).
123
130
124
-
## Use the Python Library
131
+
## Use NeMo Curator
132
+
### Python API Quick Example
125
133
126
134
The following snippet demonstrates how to create a small data curation pipeline that downloads and curates a small subset of the Common Crawl dataset.
127
135
@@ -130,32 +138,38 @@ The following snippet demonstrates how to create a small data curation pipeline
To get started with NeMo Curator, you can follow the tutorials available here: [Tutorials]
145
-
(https://github.com/NVIDIA/NeMo-Curator/tree/main/tutorials). These tutorials include:
156
+
To get started with NeMo Curator, you can follow the tutorials [available here](https://github.com/NVIDIA/NeMo-Curator/tree/main/tutorials). These tutorials include:
146
157
147
-
- `tinystories` which focuses on data curation for training from scratch.
148
-
- `peft-curation` which focuses on data curation for parameter-efficient fine-tuning use-cases.
158
+
- [`tinystories`](https://github.com/NVIDIA/NeMo-Curator/tree/main/tutorials/tinystories) which focuses on data curation for training LLMs from scratch.
159
+
- [`peft-curation`](https://github.com/NVIDIA/NeMo-Curator/tree/main/tutorials/peft-curation) which focuses on data curation for LLM parameter-efficient fine-tuning (PEFT) use-cases.
160
+
- [`distributed_data_classification`](https://github.com/NVIDIA/NeMo-Curator/tree/main/tutorials/distributed_data_classification) which focuses on using the quality and domain classifiers to help with data annotation.
161
+
- [`single_node_tutorial`](https://github.com/NVIDIA/NeMo-Curator/tree/main/tutorials/single_node_tutorial) which demonstrates an end-to-end data curation pipeline forcurating Wikipedia datain Thai.
149
162
150
-
## Access Python Modules
151
163
152
-
The Data Curation section of the [NeMo Framework User Guide](https://docs.nvidia.com/nemo-framework/user-guide/latest/datacuration/index.html) provides in-depth information about how the Python modules work. The [examples](examples/) directory in the GitHub repository provides scripts that showcase these modules.
164
+
### Access Python Modules
153
165
154
-
## Use CLI Scripts
166
+
The NeMo Curator section of the [NeMo Framework User Guide](https://docs.nvidia.com/nemo-framework/user-guide/latest/datacuration/index.html) provides in-depth information about how the Python modules work. The [examples](examples/) directory in the GitHub repository provides scripts that showcase these modules.
167
+
168
+
### Use CLI Scripts
155
169
156
170
NeMo Curator also offers CLI scripts foryou to use. The scriptsin`nemo_curator/scripts` map closely to the supplied Python modules. Refer to the [NeMo Framework User Guide](https://docs.nvidia.com/nemo-framework/user-guide/latest/datacuration/index.html) for more information about the Python modules and scripts.
157
171
158
-
## Use NeMo Framework Launcher
172
+
### Use NeMo Framework Launcher
159
173
160
174
As an alternative method for interfacing with NeMo Curator, you can use the [NeMo Framework Launcher](https://github.com/NVIDIA/NeMo-Megatron-Launcher). The launcher enables you to easily configure the parameters and cluster. It can also automatically generate the SLURM batch scripts that wrap around the CLI scripts required to run your pipeline.
161
175
@@ -211,5 +225,3 @@ Additionally, using the CPU-based modules, the following table shows the time re
211
225
## Contribute to NeMo Curator
212
226
213
227
We welcome community contributions! Please refer to [CONTRIBUTING.md](https://github.com/NVIDIA/NeMo/blob/stable/CONTRIBUTING.md) for the process.
214
-
215
-
To contribute an article to the collection, please submit a pull request to the ``gh-pages-src`` branch of this repository. For detailed information, please consult the README located at the [gh-pages-src branch](https://github.com/NVIDIA/NeMo/tree/gh-pages-src#readme).
Copy file name to clipboardExpand all lines: docs/user-guide/gpudeduplication.rst
+33Lines changed: 33 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -160,6 +160,39 @@ steps (all scripts are included in the :code:`nemo_curator/scripts/` subdirector
160
160
--jaccard-threshold 0.8
161
161
# --scheduler-file /path/to/file.json
162
162
163
+
* Incremental Fuzzy Dedup
164
+
To incrementally perform fuzzy dedup, organize your incremental dataset snapshots into separate directories and pass a list of all your directories to :code:`gpu_compute_minhashes`. All other subsequent steps can be done as described above without modification.
165
+
166
+
- Input (assuming incremental snapshots are all under :code:`/input/`):
In addition to the scripts, there are examples in the `examples` directory that showcase using the python module
165
198
directly in your own code. It also has examples on how to remove documents from the corpus using the list of duplicate IDs generated from exact or fuzzy
Copy file name to clipboardExpand all lines: tutorials/tinystories/README.md
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,10 @@ This tutorial demonstrates the usage of NeMo Curator's Python API to curate the
4
4
5
5
For simplicity, this tutorial uses the validation split of this dataset, which contains around 22,000 samples.
6
6
7
+
## Walkthrough
8
+
For a detailed walkthrough of this tutorial, please see this [blog post](https://developer.nvidia.com/blog/curating-custom-datasets-for-llm-training-with-nvidia-nemo-curator/).
9
+
10
+
7
11
## Usage
8
12
After installing the NeMo Curator package, you can simply run the following command:
0 commit comments