Repository navigation
feat(client): keep compact sampler-draw rows with their repeats - #202
Draft
faresobeid wants to merge 1 commit into
Draft
faresobeid wants to merge 1 commit into
faresobeid wants to merge 1 commit into
Conversation
faresobeid
added a commit
to PrimeIntellect-ai/prime-rl
that referenced
this pull request
Oct 25, 2026
… the GPU Untruncated score-centered requests no longer use vLLM's logprob return. The patched sampler writes the sampled token plus the top ids (vLLM's logprob layout) or K i.i.d. draws from the processed distribution (extra_args.prl_sampler_draws) into the packed sampling-mask transport. The server returns them as compact logprobs. Removes compact_logprobs.py and the logprobs_mode/max_logprobs setup; score centering enables enable_return_sampling_mask instead. Bumps renderers for sampler-draw rows (PrimeIntellect-ai/renderers#202).
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.
_parse_compact_logprobsgets a second row mode. With"samples": truein the compact payload, each row is the sampled token followed by K i.i.d. draws from the sampler distribution q. The client returns the draws ascompletion_top_ids/completion_top_logprobsin draw order, repeats kept. Without the flag, parsing is unchanged: the head is ranked, deduplicated and tie-trimmed.prime-rl uses these rows for Monte Carlo score centering without sampling replay:
E_q[w s] ≈ mean_k w(v_k) s(v_k). Each draw has weight 1/K, so repeats must survive parsing.Row checks: the first entry must be the sampled token, and there must be at least one draw. The existing value and offset validation still applies. Sampling-mask parsing is skipped for these rows (they carry no replay support).
Validation
uv run pytest tests/test_client.py(105 passed, 6 skipped),ruff check,ruff format --check; CI green (incl. Ty).Dependencies
PrimeIntellect-ai/prime-rl#4232 emits these rows and pins
deps/renderersto this branch (a727c5e). Re-pin to the merged commit when this lands.Note
Support sampler-draw repeats in compact logprob parsing in
client.pysamplesflag to_parse_compact_logprobsin renderers/client.py. When true, the parser skips sampling-mask parsing and keeps every packed draw after the sampled-token entry, including duplicate token IDs, in original order.samplesis false or absent.Macroscope summarized a727c5e.