Repository navigation
Keep Random-LTD sequence lengths above the configured minimum - #8529
vineethsaivs wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac0bde6cb0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
056d449 to
f92d52f
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The public configuration documentation must reflect the new rounding semantics.
Review effort: Balanced
Findings: 1
What changed in this PR
Fixes Random-LTD sequence alignment so retained lengths never fall below the configured minimum.
Changes:
- Rounds minimum sequence lengths upward to the next valid increment.
- Adds scheduler and training-loop regression tests.
| File | Description |
|---|---|
deepspeed/runtime/data_pipeline/data_routing/scheduler.py |
Clamps aligned lengths to the minimum. |
tests/unit/runtime/test_data_efficiency.py |
Tests scheduling and engine integration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| aligned_min = -(-self.state[RANDOM_LTD_MIN_VALUE] // increment) * increment | ||
| next_seq = max(next_seq, aligned_min) |
There was a problem hiding this comment.
Aligned values are unchanged. An unaligned min_value was already rounded before this PR, just down (8 with seq_per_step 16 gave 0). Added the rounding note to config-json.md in 7faf6bd.
7faf6bd to
8aca14f
Compare
Align the minimum up to a multiple of the increment and floor the schedule at it, so rounding down to the increment cannot drop below min_value. Signed-off-by: Vineeth Sai <vineethsai4444@gmail.com>
An unaligned min_value is rounded up to the next seq_per_step multiple. Signed-off-by: Vineeth Sai <vineethsai4444@gmail.com>
8aca14f to
56e1062
Compare

Random-LTD rounds
min_value=8down to zero withseq_per_step=16, dropping every token from selected layers. Clamp to the first aligned length at or above the minimum.Test:
DS_ACCELERATOR=cpu PYTHONPATH=. python -m pytest tests/unit/runtime/test_data_efficiency.py -k random_ltd -q. Four CPU tests pass, including three DeepSpeedEngine SGD steps with actualRandomLayerTokenDropwrappers and assertions on both selected layers' input lengths.Apple M2 Pro CPU with one-rank Gloo exercises the 16-token retention boundary. The same test uses longer inputs on CUDA to exercise gather/scatter; that path was not run locally. Changed-file pre-commit passes.