Skip to content

Add Jobs guide: Process Large Datasets#2522

Merged
davanstrien merged 10 commits into
mainfrom
jobs-large-datasets-doc
Jul 20, 2026
Merged

Add Jobs guide: Process Large Datasets#2522
davanstrien merged 10 commits into
mainfrom
jobs-large-datasets-doc

Conversation

@davanstrien

@davanstrien davanstrien commented Jun 2, 2026

Copy link
Copy Markdown
Member

What

Adds a new Jobs documentation page — Process Large Datasets (docs/hub/jobs-large-datasets.md) — under the Jobs section of the nav, plus an inbound pointer from jobs-configuration's Volumes section.

It's a task-oriented guide for working with datasets larger than a Job's ephemeral disk, opening with a short decision rule and then covering each approach:

  • Stream with datasets (streaming=True) — links the Stream guide and the 100× more efficient blog
  • Read & filter over hf:// directly with Polars/DuckDB/pandas (native readers, no mount)
  • Mount a dataset/model/bucket for tools that expect local file paths
  • Save results to a Storage Bucket (DuckDB COPY straight from hf:// to the mount) or push_to_hub
  • A Common Crawl worked example: stream a WET shard straight from hf:// → DuckDB, no download

It links the canonical reference pages (jobs-pricing, jobs-configuration#volumes, storage-buckets-access, datasets/stream, per-library dataset pages) rather than restating them.

Verification

Every snippet was run against live Jobs. Timings that shaped the page (same aggregate query, same ~28 GB / 14-file Parquet glob):

Read path Time
Polars native hf:// scan ~4 min (in the doc)
DuckDB native hf:// ~18 min
DuckDB via register_filesystem(HfFileSystem()) did not finish (killed at 30-min default timeout)
Polars over a -v repo mount ~6 min per file (~85 min extrapolated)

Hence the page's structure: hf:// native readers for scans, mounts for whole-file/local-path access, explicit --timeout guidance for network-bound scans. The Common Crawl example runs verbatim in ~1 min on the default CPU flavor with no token; its printed output is included on the page.

Notes


Note

Low Risk
Documentation-only changes with no runtime or API impact.

Overview
Adds a new Jobs doc page Process Large Datasets and registers it in the Hub nav (after Examples & Tutorials).

The guide explains how to work with data bigger than a Job’s ephemeral disk: a short “which approach?” decision tree, then sections on streaming (datasets + Spark), native hf:// scans (Polars/DuckDB/pandas) with --timeout and parallel-job guidance, volume mounts for path-based tools, persisting output to Storage Buckets or push_to_hub, and a Common Crawl WET end-to-end example. It points to existing pricing, configuration, bucket, and per-library docs instead of duplicating them.

Configuration gains a Volumes tip that lazy mounts enable oversized datasets and links to this page.

Reviewed by Cursor Bugbot for commit 7cd203e. Bugbot is set up for automated code reviews on this repo. Configure here.

davanstrien and others added 2 commits June 2, 2026 15:39
New docs/hub/jobs-large-datasets.md: how to read, filter, and process datasets larger than a Job's ephemeral disk — streaming, mounting + lazy reads, reading/filtering over hf:// with Polars/DuckDB, saving results to a bucket, and a Common Crawl worked example. Links canonical pages rather than restating them; adds an inbound pointer from jobs-configuration#volumes.
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

davanstrien and others added 4 commits June 12, 2026 12:00
…sults

Every example was run against real Jobs. Key changes from what testing showed:

- hf:// section: native Polars scan (verified ~4 min for the 28 GB sample
  aggregate on the default CPU flavor) replaces the
  register_filesystem(HfFileSystem()) DuckDB example, which could not
  finish the same scan within the 30-minute default timeout. Native hf://
  stays for datasets; HfFileSystem noted for buckets.
- Mount section: reframed for whole-file/local-path access; large Parquet
  scans pointed at hf:// instead (measured several times slower through
  the mount). Added the missing PEP 723 header to the script example.
- Save results: hosts the DuckDB COPY-to-bucket pattern (out-of-core
  write), scaled from 100BT to 10BT, with --timeout shown and a note that
  it transfers the full text column.
- Added --timeout guidance (long scans are network-bound), real output
  for the Common Crawl example (verified verbatim, ~1 min, no token
  needed), hf jobs hardware mention, and Title Case/heading consistency.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
commoncrawl/commoncrawl is a Storage Bucket, not a dataset — the
datasets/ URL returns 401. Matches the buckets/ path already used in
the worked example just below.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Editorial polish after review: rewrite the intro (cut repetition, name the
read paths), tighten the Save-results paragraph (drop a caveat already made
in the Read/filter section), and truncate the Common Crawl output table to
the top languages. Every code example re-verified against live Jobs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sibling Jobs pages use ## headings, not bold pseudo-headings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@davanstrien
davanstrien marked this pull request as ready for review July 7, 2026 11:30
@davanstrien
davanstrien requested a review from lhoestq July 7, 2026 11:31
@davanstrien

Copy link
Copy Markdown
Member Author

IMO, we can keep iterating on this as libraries mature, but nice to document some patterns already.

@lhoestq lhoestq left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm ! I added some minor suggestions

Comment thread docs/hub/jobs-large-datasets.md Outdated
Comment thread docs/hub/jobs-large-datasets.md Outdated
Comment thread docs/hub/jobs-large-datasets.md
Comment thread docs/hub/jobs-large-datasets.md Outdated
Comment thread docs/hub/jobs-large-datasets.md Outdated
davanstrien and others added 4 commits July 9, 2026 10:01
Co-authored-by: Quentin Lhoest <42851186+lhoestq@users.noreply.github.com>
Co-authored-by: Quentin Lhoest <42851186+lhoestq@users.noreply.github.com>
Co-authored-by: Quentin Lhoest <42851186+lhoestq@users.noreply.github.com>
… version floor

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@davanstrien
davanstrien merged commit b45fb36 into main Jul 20, 2026
3 checks passed
@davanstrien
davanstrien deleted the jobs-large-datasets-doc branch July 20, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants