Repository navigation
fix: reject unsupported Unsloth RL gradient accumulation - #1137
Open
monsterlag wants to merge 1 commit into
Open
monsterlag wants to merge 1 commit into
monsterlag wants to merge 1 commit into
Conversation
Fail fast instead of deadlocking the one-input/one-result producer when gradient_accumulation_steps exceeds one. Validate both service resolution and the public runtime entry point before optimizer state changes. Closes OpenPipe#1121
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
AI-generated, not reviewed by a human. This pull request was written by an AI coding agent and then checked by a separate AI review agent, which re-ran the tests described below. No human has reviewed the code. It is submitted by @monsterlag, who runs these agents. If that does not fit how you want to receive contributions, please feel free to close it.
Summary
Closes #1121.
Unsloth's RL producer waits for an optimizer-step result after each input. With
gradient_accumulation_steps > 1, the trainer needs another input before producing that result, so both sides wait indefinitely. Reject this unsupported configuration with an actionable error instead of hanging.Changes
Test plan
uv run ty check src tests/unit/test_unsloth_gradient_accumulation.py: passed.uv run prek run --all-files: Ruff, formatting, and lockfile checks passed; repository-wide ty reports 18 diagnostics, identical to the untouched baseline in the same environment.uv run pytest --nbval --current-env --tb=short tests/unit: blocked by 15 collection errors from missing optional Tinker/Megatron/Triton dependencies; the untouched baseline has the same collection errors.