Skip to content

Add dataset type olmo_grain for AI2 OLMo numpy pretrain mixes#3749

Open
gagika wants to merge 1 commit intomainfrom
gagik-olmo-data
Open

Add dataset type olmo_grain for AI2 OLMo numpy pretrain mixes#3749
gagika wants to merge 1 commit intomainfrom
gagik-olmo-data

Conversation

@gagika
Copy link
Copy Markdown
Collaborator

@gagika gagika commented Apr 26, 2026

Description

  • Adds dataset_type=olmo_grain, a Grain-based input pipeline for AI2's
    pre-tokenized OLMo numpy mixes (e.g. OLMo-mix-0925-official.txt).
    Reads headerless .npy token streams from a gcsfuse mount, applies
    OLMo-core's repeated-n-gram filter, and yields the shapes the MaxText
    pretrain trainer expects.
  • Stateless sampler: record at step k is a pure function of
    (seed, shard, k). Resume reads the latest step from
    config.checkpoint_dir and shifts the sampler — no Grain iterator
    state in the checkpoint.
  • Ships two data tools (download_olmo_data_to_gcs.py with HTTP-Range
    resume; build_olmo_npy_index.py for header-scan indexing) and two
    launchers (run_olmo3_7b_grain_smoke.sh,
    run_olmo3_7b_grain_resume_test.sh).

Tests

  • Unit tests pass (tests/unit/input_pipeline/olmo_*)
  • Smoke train: 50 steps, loss 11.99 → 8.93 on v4-8 (4-layer bf16)
  • Resume test: Run B picks up at step 50 with loss continuity 8.931 → 8.930

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

authored-by: @aireenmei

@github-actions
Copy link
Copy Markdown

🤖 Hi @gagika, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@github-actions
Copy link
Copy Markdown

🤖 I'm sorry @gagika, but I was unable to process your request. Please see the logs for more details.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 26, 2026

Comment thread tests/unit/input_pipeline/olmo_data_grain_test.py Outdated
Comment thread src/maxtext/input_pipeline/olmo_data_grain.py Outdated
Comment thread src/maxtext/input_pipeline/olmo_data_grain.py Outdated
Comment thread src/maxtext/input_pipeline/olmo_data_grain.py
@gagika gagika force-pushed the gagik-olmo-data branch from 2c8507c to 9de5321 Compare May 2, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants