Recent findings suggest that the Hugging Face platform has many datasets and pre-trained models that make using and training state-of-the-art machine learning models increasingly accessible. However, it can be hard to scale AI tasks because AI datasets are often large (100s GBs to TBs) and using Hugging Face transformers for model inference can sometimes be computationally expensive.

Industry observers note that dask, a Python library for distributed computing, can handle out-of-core computing (processing data that doesn’t fit in memory) by breaking datasets into manageable chunks. This makes it easy to do things like:. (Related: Industry News: ‘Minecraft Mommy’ goes viral on TikTok f...)

In this post we show an example of data processing from the FineWeb dataset, using the FineWeb-Edu classifier to identify web pages with high educational value. We’ll show:.

The FineWeb dataset consists of 15 trillion tokens of English web data from Common Crawl, a non-profit that hosts a public web crawl dataset updated monthly. This dataset is often used for a variety of tasks such as large language model training, classification, content filtering, and information retrieval across a variety of sectors.

It can take > 1 minute to download and read in a single file with pandas on a laptop.

Industry observers note that next, we’ll use the HF FineWeb-Edu classifier to judge the educational value of the web pages in our dataset. Web pages are ranked on a scale from 0 to 5, with 0 being not educational and 5 being highly educational. We can use pandas to do this on a smaller, 100-row subset of the data, which takes ~10 seconds on a M1 Mac with a GPU. (Related: Industry News: Twitch streamer’s PS5 catches fire after...)

It has been revealed that note that we also added a step to check the available hardware inside the compute_scores function, because it will be distributed when we scale with Dask in the next step. This makes it easy to go from testing locally on a single machine (either on a CPU or maybe you have a MacBook with an Apple silicon GPU) to distributing across multiple machines (like NVIDIA GPUs).

Industry observers note that the entire 2024 February/March crawl is 432 GB on disk, or ~715 GB in memory, split up across 250 Parquet files. Even on a machine with enough memory for the whole dataset, this would be prohibitively slow to do serially.

Recent findings suggest that to scale up, we can use Dask DataFrame, which helps you process large tabular data by parallelizing pandas. It closely resembles the pandas API, making it easy to go from testing on a single dataset to scaling out to the full dataset. Dask works well with Parquet, the default format on Hugging Face datasets, to enable rich data types, efficient columnar filtering, and compression.

We’ll apply the compute_scores function for text classification in parallel on our Dask DataFrame using map_partitions, which applies our function in parallel on each pandas DataFrame in the larger Dask DataFrame. The meta argument is specific to Dask, and indicates the data structure (column names and data types) of the output.

Note that we’ve picked a batch_size that works well for this example, but you’ll likely want to customize this depending on the hardware, data, and model you’re using in your own workflows (see the HF docs on pipeline batching).

It has been revealed that now that we’ve identified the rows of the dataset we’re interested in, we can save the result for other downstream analyses. Dask DataFrame automatically supports distributed writing to Parquet. Hugging Face uses commits to track dataset changes and allows writing a Dask DataFrame in parallel.

Since this creates one commit per file, it is recommended to squash the history after the upload:.

Alternatively you can use this custom function which uploads multiple files per commit.

There are a number of ways to deploy Dask on a variety of hardware. Here, we’ll use Coiled to deploy Dask on the cloud so we can spin up VMs as needed, and then clean them up when we’re done.

The workflow took ~5 hours to complete and we had good GPU hardware utilization.

Putting it all together, here is the complete workflow:.

Sources indicate that hugging Face + Dask is a powerful combination. In this example, we scaled up our classification task from 100 rows to 211 million rows by using Dask + Coiled to run the workflow in parallel across multiple GPUs on the cloud.

This same type of workflow can be used for other use cases like:.

According to recent reports, reliability is everything, especially when you spend real time and money on gaming. I’ve been impressed by how consistent this venue is: https://btvs1.com/ For anyone who wants a stable, well-organized gaming environment across the territory of India, it delivers exactly what most players expect and more, without unnecessary complications.

I recently registered on 888starz login login and I’m thrilled! The platform offers a wide range of sports, cybersports, and casino games, along with regular bonuses for newly introduced and loyal users. I especially love the mobile app — it’s convenient to place bets and play favorite games from anywhere. Support is available 24/7, and withdrawals are always fast and secure. 888starz ensures fairness and privacy, making it my number one choice for online entertainment in Bangladesh!

Interesante explicación sobre cómo Dask permite escalar cargas de trabajo sin complicar demasiado la infraestructura. Para quienes también analizan datos en plataformas digitales, https://starzbetmex.com/ es un ejemplo de servicio cuya experiencia depende de sistemas rápidos y estables.

→ Read original article