Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
efc50cc
WIP: Plan, inventory, materilize
undfined Aug 4, 2026
64578b7
Better plan visual
undfined Aug 4, 2026
bfa2f36
more cleanup and merge stages
undfined Aug 4, 2026
ca8a536
More visual cleanup
undfined Aug 4, 2026
db5d784
pmr stuff
undfined Aug 4, 2026
9613647
Better sampling procedure
undfined Aug 5, 2026
797d4ba
Add document selector module
undfined Aug 5, 2026
1b0e721
Fix error with globs
undfined Aug 5, 2026
71aec49
Refactor ergonomics a bit
undfined Aug 5, 2026
22f53fa
Simplify reports and drop rep cap
undfined Aug 5, 2026
d3ff698
Drop some pointless stats and fix preflight checks
undfined Aug 5, 2026
55bd697
Add materialize script
undfined Aug 5, 2026
308b8e2
Prefix handling and exec unit planner fixes
undfined Aug 5, 2026
11e5919
more cleanup and exit on completion
undfined Aug 5, 2026
df9bc94
Refactor layout
undfined Aug 5, 2026
7d4bf06
Use isolated uv run
undfined Aug 5, 2026
92fffab
Handle full instance lifecycle
undfined Aug 5, 2026
88da739
Dolma fix
undfined Aug 5, 2026
47acfc6
Log and project fixes
undfined Aug 5, 2026
5829615
Better logging and tags
undfined Aug 5, 2026
ebffcc4
Observability and disrtibution tweaks
undfined Aug 5, 2026
1d0e309
Better transfer logs and default s5cmd config
undfined Aug 5, 2026
c31c276
More log cleanup
undfined Aug 5, 2026
0d3b4c8
Better shard allocation and sizing
undfined Aug 5, 2026
cba5f75
Allow running preflight as part of execution launch
undfined Aug 5, 2026
8fa677b
Log cleanup
undfined Aug 5, 2026
46bd134
Report and scheduling concurrency
undfined Aug 5, 2026
f8d5928
Batch launching controls and defaults
undfined Aug 5, 2026
76c43ce
Handle resumption as well
undfined Aug 5, 2026
43913a2
More machine boostrapping tweaks
undfined Aug 5, 2026
28faa16
Add exclusion arg
undfined Aug 5, 2026
32ff676
Log size streaming
undfined Aug 5, 2026
87d2792
pmr bug for more than 100 instances
undfined Aug 5, 2026
a7fc122
more boostrap fixes
undfined Aug 5, 2026
4e0b97b
Handle rehydrating pool
undfined Aug 5, 2026
26e7775
Cleanup
undfined Aug 6, 2026
09f302d
Move report builder
undfined Aug 6, 2026
6169c5f
V2 version fo the dolma3p5 mix with decon+html
undfined Aug 10, 2026
9dde655
Fix dispatch assignment for map
undfined Aug 10, 2026
b816f87
Refactor a bit and cleanup documentation
undfined Aug 24, 2026
328ae2a
More docs
undfined Aug 24, 2026
38e4225
CI tweaks
undfined Aug 24, 2026
8d17c86
CI issues, again
undfined Aug 24, 2026
2857e10
More tweaks
undfined Aug 24, 2026
9ad0d4c
Cleanup d3p5 readme
undfined Aug 24, 2026
d53f103
Another pass on docs
undfined Aug 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,16 @@ jobs:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
manylinux: manylinux_2_28
container: "ghcr.io/rust-cross/manylinux_2_28-cross:${{ matrix.target }}"
before-script-linux: |
sudo apt-get update
sudo apt-get install --yes --upgrade build-essential cmake protobuf-compiler libssl-dev glibc-source musl-tools
# Build images differ per target. The RPM-based image already has the
# toolchain and cmake, but its perl lacks the modules openssl-sys needs
# to configure a vendored build.
if command -v apt-get > /dev/null; then
sudo apt-get update
sudo apt-get install --yes --upgrade build-essential cmake protobuf-compiler libssl-dev glibc-source musl-tools
else
yum install -y perl-IPC-Cmd perl-Pod-Html
fi
- name: Upload wheels
uses: actions/upload-artifact@v4.4.1
with:
Expand Down
26 changes: 20 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

125 changes: 125 additions & 0 deletions configs/dolma3p5-resharding/14t/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Dolma 3.5 14T materialization

Run from the repository root. Artifacts go to `runs/dolma3p5-resharding/14t/`,
which is gitignored.

`plan.py` defaults to `inputs/mix-v2.yaml`. The token target is
`target_uint32_values` in `settings.yaml`. `inputs/README.md` describes the input
files.

## Requirements

- Python 3.10–3.12
- `s5cmd` on `PATH`
- `uv`, to run `materialize.py`
- `pip install -e .`, for the boto3 and PyYAML imports in `plan.py`,
`validate.py`, and `verify.py`
- AWS credentials: read on the source and destination buckets for plan, preflight,
and verify; EC2 create, tag, resume, and pause for `materialize.py --execute`

`materialize.py` runs under `uv` because it needs `poormanray` for the `pmr`
binary, which is not a repo dependency. The other scripts run under `python`.

All scripts share one build directory. Keep `plan.py --output` and `--build` on
the others consistent, or leave both at the default.

## 1. Plan

```bash
python scripts/dolma3p5_resharding/plan.py \
--mix configs/dolma3p5-resharding/14t/inputs/mix-v2.yaml \
--profile YOUR_READ_ONLY_PROFILE \
--destination-root s3://ai2-llm/preprocessed/dolma3p5-14t/materialized \
--local-temp-root /mnt/dolma/dolma3p5-resharding \
--max-unit-working-bytes 1500000000000

python scripts/dolma3p5_resharding/validate.py
open runs/dolma3p5-resharding/14t/01-plan/report.html
```

`--local-temp-root` is worker-local scratch and must be on NVMe.
`--max-unit-working-bytes` caps the estimated local working set of one execution
unit; the planner splits units that would exceed it.

Check before continuing:

- source volume, target volume, and sampling rates at every level
- execution unit working sets fit their instance types
- destination paths, output shard counts, worker counts
- `01-plan/execution/validation-summary.json` reports `passed: true`
- resolution and execution failure CSVs are empty

## 2. Smoke test one category

```bash
uv run scripts/dolma3p5_resharding/materialize.py --list-categories finemath

uv run scripts/dolma3p5_resharding/materialize.py \
--category 'dolma3_finemath_v3:finemath::default' --parallelism 2 --dry-run

uv run scripts/dolma3p5_resharding/materialize.py \
--category 'dolma3_finemath_v3:finemath::default' --parallelism 2 \
--preflight --execute --verbose
```

Preflight must pass, every planned unit must dispatch, workers must stop on
completion, and final verification must pass. Stop if an input drifted or a
destination is occupied.

## 3. Materialize the rest

Exclude what step 2 materialized. Selectors match by exact string, and an unknown
selector is an error. `MIX_NAME` excludes every category of that mix;
`MIX_NAME::CATEGORY_NAME` excludes one. `dolma3_finemath_v3:finemath` has a single
category, so the mix name covers step 2 exactly.

```bash
uv run scripts/dolma3p5_resharding/materialize.py \
--all --exclude-category 'dolma3_finemath_v3:finemath' \
--parallelism 128 --dry-run
```

Compare the dry run unit count against the plan, then:

```bash
uv run scripts/dolma3p5_resharding/materialize.py \
--all --exclude-category 'dolma3_finemath_v3:finemath' \
--parallelism 128 --preflight --execute --verbose
```

`--parallelism` caps active workers. VM creation runs in batches of 5 with a 3
second delay; worker setup runs 32 at a time. Each worker takes another compatible
unit as it finishes one, and stops when its queue is empty. Defaults are cluster
`dolma3p5-14t`, project `oe-other`, region `us-east-1`. `PMR_REGION` overrides the
region. Use `--ssh-key-path` if the cluster key is not poormanray's default.

## 4. Verify

```bash
python scripts/dolma3p5_resharding/verify.py \
--category 'dolma3_finemath_v3:finemath::default'

python scripts/dolma3p5_resharding/verify.py --all
open runs/dolma3p5-resharding/14t/03-output-validation/report.html
```

Accept only when `output-summary.json` reports `passed: true`, destinations and
shard counts match the plan, the aggregate residual is within bounds, and the
problem and error CSVs are empty.

## Validation gates

- `validate.py`: plan consistency, before any worker launches
- `--preflight`: source drift and destination occupancy for the selected units,
immediately before provisioning; a failure blocks the launch and is recorded in
`02-preflight/`
- `materialize.py`: output shard counts, NPY sizes, metadata partners, and
residuals, after workers stop
- `verify.py`: repeats the output checks and writes `03-output-validation/`

## Safety

Plan, preflight, and verification artifacts are disposable. Source objects and
materialized destinations are not. Materialization refuses occupied destinations
and never overwrites token or metadata files. Investigate a partially written
destination rather than retrying into it.
33 changes: 33 additions & 0 deletions configs/dolma3p5-resharding/14t/inputs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Dolma 3.5 14T plan inputs

A build's id is a hash of the mix and the catalog. Editing either file changes the
id, invalidates plans already built from it, and changes every destination path
derived from it. Record notes here rather than in the YAML.

## `mix-v2.yaml`

`plan.py`'s default. 210 top-level mixes, weights summing to 1.0.

Differences from v1:

- `dolma3_finemath_v3:finemath` and `rpj-proofpile-arxiv:proofpile` read
decontaminated, ngram-filtered, minhash-deduplicated `dolma2-tokenizer`
sources. v1 points both at `dolma3-tokenizer` fallbacks; see its "Missing from
our copy" comments.
- Adds `the-stack-v2:HTML`, weight 0.0137159618, five quality categories.
- 49 top-level weights differ.

## `dolma3p5-14t-optimal-mix.yaml`

Superseded by v2, retained for provenance. 209 top-level mixes. Materialized once
on 2026-08-05 to ~14T tokens; output validation failed on 10 of 681 destinations.

## `dolma3p5-reference-all-npy-s3-paths.csv`

Superset of source NPY paths. Planning resolves mix path patterns against this
catalog instead of listing the bucket, so the catalog is part of the build id.

## Token target

`target_uint32_values` in `../settings.yaml`, 14,000,000,000,000. The mix files
carry relative weights only.
Loading
Loading