Skip to content

Broadcast documents_seen as the model version in weights_ready#561

Merged
jlamypoirier merged 4 commits into
mainfrom
jlp_weights_ready_version
Jul 10, 2026
Merged

Broadcast documents_seen as the model version in weights_ready#561
jlamypoirier merged 4 commits into
mainfrom
jlp_weights_ready_version

Conversation

@jlamypoirier

@jlamypoirier jlamypoirier commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Claude Opus 4.8, on behalf of @jlamypoirier.

Summary

Extracted from #553. Split from the reward / per-token-model_version piece (briefly combined in
#557, now closed) since the two have no code dependency — this is purely the producer-side
broadcast; the other PR is a data-pipeline consumer of a different field.

  • The weights_ready event now carries documents_seen (the cumulative document count, which
    doubles as the model version) alongside the existing step (= completed step). A consumer can
    stamp documents_seen onto rollouts so staleness is measured in documents, aligning with the
    document clock; step remains available for logging. Keeping step makes this
    backward-compatible.
  • Threads documents_seen through the TrainerCallback.run_begin / step_end hooks.

The counter itself (Trainer._documents_seen) landed in #559 and is now on main; this branch is
merged up to current main (which also carries the weight-sync-time metric from #560, with which
step_end integrates cleanly). The paired PipelineRL change (reading documents_seen as the model
version) is a separate PR against PipelineRL's fast-llm branch.

Tests

  • tests/data/test_streaming.py: passes (CPU).
  • tests/models/test_streaming.py (GPU end-to-end) now asserts each weights_ready message carries
    a non-decreasing documents_seen; not run here (no GPU) — worth running in CI before merge.

jlamypoirier and others added 2 commits July 9, 2026 16:44
The `weights_ready` event now carries `document_count` (= documents_seen)
alongside the existing `step` (= completed step). Consumers stamp
`document_count` onto rollouts so staleness is measured in documents,
aligning with DeepSpeed's document clock, while `step` remains available
for logging. Keeping `step` makes the change backward-compatible.

Threads `documents_seen` through the `TrainerCallback.run_begin` /
`step_end` hooks (a training-progress counter alongside `step`).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…it in test

- Rename the wire field document_count -> documents_seen for consistency with
  the internal counter and the rest of the codebase (no shipped consumer yet).
- Reword the broadcast comment to describe the fields locally, without naming
  downstream consumers.
- Assert the new documents_seen field is present and non-negative in the
  streaming consumer test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jlamypoirier jlamypoirier force-pushed the jlp_weights_ready_version branch from d0d04aa to bb91627 Compare July 9, 2026 20:45
jlamypoirier and others added 2 commits July 10, 2026 07:38
…sion

# Conflicts:
#	fast_llm/engine/training/config.py
#	fast_llm/engine/training/streaming.py
#	fast_llm/engine/training/trainer.py
… restating comment

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jlamypoirier jlamypoirier merged commit 2b2c47b into main Jul 10, 2026
2 of 3 checks passed
@jlamypoirier jlamypoirier deleted the jlp_weights_ready_version branch July 10, 2026 11:55
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.

1 participant