perf: reuse rollout behavior logprobs - #48
Merged
ViperEkura merged 1 commit intoSep 2, 2026
Conversation
Feed sampler-aligned behavior log-probabilities directly into online GRPO instead of allocating, synchronizing, and forwarding a duplicate old-policy model. Keep the old-model path as an offline compatibility fallback and validate supplied rollout tensors before loss computation.
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.
Summary
logprobs_oldfrom rollout results directly into online GRPOold_modelfallback for offline GRPO batchesL20 benchmark
Exact PR commit
2b3a5f0, NVIDIA L20 (SM89), BF16, PyTorch 2.11.0+cu128, CUDA 12.8. The checkpoint is the real AstrAI 1.2B configuration (24 layers, hidden 1536, FFN 6912, vocabulary 100k). The microbenchmark uses four 128-token sequences with 64 response tokens; model timings use 3 warmups and 10 synchronized samples, while the reuse path uses 20 warmups and 100 samples.logprobs_oldreuse, including shape/finite validationFor this batch, reuse removes one 2.246 GiB model replica and makes the behavior-logprob part of the training step about 222x faster. This is intentionally scoped to online GRPO: offline batches without captured rollout logprobs still use the old-policy model compatibility path.
Validation
PYTHONPATH=$PWD CUDA_VISIBLE_DEVICES=5 bash scripts/pre_commit.sh --skip-depsThe full GPU suite used the existing compiled CUDA extension modules from the L20 checkout, linked into the isolated test worktree.