nvidia_ai
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.1%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: bcebel
- License: mit
- Language: Jupyter Notebook
- Default Branch: main
- Size: 1.46 MB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README copy.md
NeMo Curator
🚀 The GPU-Accelerated Open Source Framework for Efficient Large Language Model Data Curation 🚀
NeMo Curator is a Python library specifically designed for fast and scalable dataset preparation and curation for large language model (LLM) 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 and 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.
Key Features
NeMo Curator provides a collection of scalable data-mining modules. Some of the key features include:
Data download and text extraction
- Default implementations for downloading and extracting Common Crawl, Wikipedia, and ArXiv data
- Easily customize the download and extraction and extend to other datasets
Language identification and separation with fastText and pycld2
Text reformatting and cleaning to fix unicode decoding errors via ftfy
-
- Multilingual heuristic-based filtering
- Classifier-based filtering via fastText
-
- exact and fuzzy (near-identical) deduplication are accelerated using cuDF and Dask
- For fuzzy deduplication, our implementation follows the method described in Microsoft Turing NLG 530B
- For semantic deduplication, our implementation follows the method described in SemDeDup by Meta AI (FAIR) facebookresearch/SemDeDup
Multilingual downstream-task decontamination following the approach of OpenAI GPT3 and Microsoft Turing NLG 530B
Distributed data classification
- Multi-node, multi-GPU classifier inference
- Provides sophisticated domain and quality classification
- Flexible interface for extending to your own classifier network
Personal identifiable information (PII) redaction for removing addresses, credit card numbers, social security numbers, and more
These modules offer flexibility and permit reordering, with only a few exceptions. In addition, the NeMo Framework Launcher provides pre-built pipelines that can serve as a foundation for your customization use cases.
Resources
- Documentation
- Examples
- Tutorials
- Blog posts
- Curating Trillion-Token Datasets: Introducing NVIDIA NeMo Data Curator
- Scale and Curate High-Quality Datasets for LLM Training with NVIDIA NeMo Curator
- Curating Custom Datasets for LLM Training with NVIDIA NeMo Curator
- Curating Custom Datasets for LLM Parameter-Efficient Fine-Tuning with NVIDIA NeMo Curator
Get Started
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.
Install NeMo Curator
Requirements
Before installing NeMo Curator, ensure that the following requirements are met:
- Python 3.10
- Ubuntu 22.04/20.04
- NVIDIA GPU (optional)
- Volta™ or higher (compute capability 7.0+)
- CUDA 12 (or above)
You can install NeMo-Curator from PyPi, from source or get it through the NeMo Framework container.
From PyPi
To install the CPU-only modules:
bash
pip install cython
pip install nemo-curator
To install the CPU and CUDA-accelerated modules:
bash
pip install cython
pip install --extra-index-url https://pypi.nvidia.com nemo-curator[cuda12x]
From Source
Clone the NeMo Curator repository in GitHub.
bash git clone https://github.com/NVIDIA/NeMo-Curator.git cd NeMo-CuratorInstall the modules that you need.
To install the CPU-only modules:
bash pip install cython pip install .To install the CPU and CUDA-accelerated modules:
bash pip install cython pip install --extra-index-url https://pypi.nvidia.com ".[cuda12x]"
From the NeMo Framework Container
The latest release of NeMo Curator comes preinstalled in the NeMo Framework Container. If you want the latest commit inside the container, you can reinstall NeMo Curator using:
bash
pip uninstall nemo-curator
rm -r /opt/NeMo-Curator
git clone https://github.com/NVIDIA/NeMo-Curator.git /opt/NeMo-Curator
pip install --extra-index-url https://pypi.nvidia.com /opt/NeMo-Curator[cuda12x]
And follow the instructions for installing from source from above.
Use NeMo Curator
Python API Quick Example
The following snippet demonstrates how to create a small data curation pipeline that downloads and curates a small subset of the Common Crawl dataset.
```Python
Download your dataset
dataset = downloadcommoncrawl("/datasets/commoncrawl/", "2021-04", "2021-10", urllimit=10)
Build your pipeline
curationpipeline = Sequential([ # Fix unicode Modify(UnicodeReformatter()), # Discard short records ScoreFilter(WordCountFilter(minwords=80)), # Discard low-quality records ScoreFilter(FastTextQualityFilter(model_path="model.bin")), # Discard records from the evaluation metrics to prevent test set leakage. TaskDecontamination([Winogrande(), Squad(), TriviaQA()]) ])
Execute the pipeline on your dataset
curateddataset = curationpipeline(dataset) ```
Explore NeMo Curator Tutorials
To get started with NeMo Curator, you can follow the tutorials available here. These tutorials include:
tinystorieswhich focuses on data curation for training LLMs from scratch.peft-curationwhich focuses on data curation for LLM parameter-efficient fine-tuning (PEFT) use-cases.distributed_data_classificationwhich focuses on using the quality and domain classifiers to help with data annotation.single_node_tutorialwhich demonstrates an end-to-end data curation pipeline for curating Wikipedia data in Thai.
Access Python Modules
The NeMo Curator section of the NeMo Framework User Guide provides in-depth information about how the Python modules work. The examples directory in the GitHub repository provides scripts that showcase these modules.
Use CLI Scripts
NeMo Curator also offers CLI scripts for you to use. The scripts in nemo_curator/scripts map closely to the supplied Python modules. Refer to the NeMo Framework User Guide for more information about the Python modules and scripts.
Use NeMo Framework Launcher
As an alternative method for interfacing with NeMo Curator, you can use the NeMo Framework 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.
In addition, other methods are available to run NeMo Curator on SLURM. For example, refer to the example scripts in examples/slurm for information on how to run NeMo Curator on SLURM without the NeMo Framework Launcher.
Module Ablation and Compute Performance
The modules within NeMo Curator were primarily designed to curate high-quality documents from Common Crawl snapshots in a scalable manner. To evaluate the quality of the curated Common Crawl documents, we conducted a series of ablation experiments. In these experiments, we trained a 357M-parameter GPT-style model using datasets generated at various stages of our data curation pipeline, which was implemented in NeMo Curator.
The following figure shows that the use of different data curation modules implemented in NeMo Curator led to improved model zero-shot downstream task performance.
In terms of scalability and compute performance, using the combination of RAPIDS and Dask fuzzy deduplication enabled us to deduplicate the 1.1 Trillion token Red Pajama dataset in 1.8 hours with 64 NVIDIA A100 Tensor Core GPUs.
Additionally, using the CPU-based modules, the following table shows the time required and resulting data size reduction for each processing step Common Crawl snapshot from November/December of 2020 using 30 CPU nodes (with hardware similar to the c5.24xlarge Amazon AWS C5 instance).
| Dataset | Download and text extraction | Text cleaning | Quality filtering | |||
|---|---|---|---|---|---|---|
| Time | Output Size | Time | Output Size | Time | Output Size | |
| Common Crawl 2020-50 | 36 hrs | 2.8 TB | 1 hr | 2.8 TB | 0.2 hr | 0.52 TB |
Contribute to NeMo Curator
We welcome community contributions! Please refer to CONTRIBUTING.md for the process.
Owner
- Name: Brian Ebel
- Login: bcebel
- Kind: user
- Location: Concord, NH
- Twitter: bc3mc2
- Repositories: 3
- Profile: https://github.com/bcebel
Citation (CITATION.cff)
cff-version: 1.0.0
message: "If you use this software, please cite it as below."
title: "NeMo-Curator: a toolkit for data curation"
repository-code: https://github.com/NVIDIA/NeMo-Curator
authors:
- family-names: Jennings
given-names: Joseph
- family-names: Patwary
given-names: Mostofa
- family-names: Subramanian
given-names: Sandeep
- family-names: Prabhumoye
given-names: Shrimai
- family-names: Dattagupta
given-names: Ayush
- family-names: Jawa
given-names: Vibhu
- family-names: Liu
given-names: Jiwei
- family-names: Wolf
given-names: Ryan
- family-names: Yurick
given-names: Sarah
- family-names: Singh
given-names: Varun
GitHub Events
Total
Last Year
Dependencies
- actions/checkout v4 composite
- actions/setup-python v5 composite
- dask *
- arxiv *
- arxiv-downloader *
- cchardet *
- poppler-utils *
- unstructured ==0.14.5
- unstructured *