Skip to content

Keep Random-LTD sequence lengths above the configured minimum - #8529

Open
vineethsaivs wants to merge 2 commits into
deepspeedai:masterfrom
vineethsaivs:fix/random-ltd-minimum-20260915
Open

vineethsaivs wants to merge 2 commits into
deepspeedai:masterfrom
vineethsaivs:fix/random-ltd-minimum-20260915

Conversation

@vineethsaivs

@vineethsaivs vineethsaivs commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Random-LTD rounds min_value=8 down to zero with seq_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 actual RandomLayerTokenDrop wrappers 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The public configuration documentation must reflect the new rounding semantics.

Review effort: Balanced
Findings: 1 Low severity

Open (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.

Comment on lines +30 to +31
aligned_min = -(-self.state[RANDOM_LTD_MIN_VALUE] // increment) * increment
next_seq = max(next_seq, aligned_min)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@vineethsaivs
vineethsaivs force-pushed the fix/random-ltd-minimum-20260915 branch from 7faf6bd to 8aca14f Compare October 21, 2026 15:24
@auto-pr-labeler-with-jev auto-pr-labeler-with-jev Bot added the skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU. label Nov 14, 2026
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>
@vineethsaivs
vineethsaivs force-pushed the fix/random-ltd-minimum-20260915 branch from 8aca14f to 56e1062 Compare November 29, 2026 08:08
@auto-pr-labeler-with-jev auto-pr-labeler-with-jev Bot added skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU. and removed skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU. labels Nov 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants