feat(grpo): zero-copy SHM transport and high-throughput trajectory reassembly logic#70
Open
RUFFY-369 wants to merge 7 commits intoNousResearch:dev-updated-againfrom
Open
Conversation
…reassembly - Added POSIX Shared Memory consumer for high-throughput reasoning ingestion. - Implemented 'Grouped Stash Logic' to reassemble interleaved trajectories by instance_id. - Synchronized repository with PyTorch 2.6.0 Stable using version shims for nightly features. - Added SDPA fallback for varlen attention to maintain cluster stability.
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.
Context:
Current REST-based IPC between the reasoning hub and trainer is too high-latency for the 2,048+ token reasoning traces required by recent models. This PR implements a POSIX Shared Memory (SHM) transport layer (interfacing with Atropos PR #440) to achieve zero-copy data ingestion.
Grouped Stash Mechanism Async rollouts often arrive interleaved at the trainer. To avoid bias in GRPO advantage calculations, I've added a stash mechanism in OnlineDataHandler. It buffers trajectories by instance_id and only yields batches once a complete group (8-16 completions per prompt) is reassembled. This ensures prompt-aligned batches remain mathematically sound for the loss function.
Compatibility & Stability:
Verification (2x 3090 Cluster):