(1/3) refactor(session): move sample assembly into the session package#1758
Open
guapisolo wants to merge 1 commit into
Open
(1/3) refactor(session): move sample assembly into the session package#1758guapisolo wants to merge 1 commit into
guapisolo wants to merge 1 commit into
Conversation
guapisolo
requested review from
Shi-Dong,
fzyzcjy,
jybsuper,
maocheng23 and
yueming-yuan
as code owners
July 21, 2026 23:09
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
This was referenced Jul 21, 2026
compute_samples_from_openai_records, its per-record helper, and truncate_samples_by_total_tokens move from the client-side generate_utils module to miles/rollout/session/samples/merge.py, unchanged: the follow-up commit makes the session server assemble samples where the records live, and server-owned logic must not live in a driver-named module (core.py importing generate_utils.sample_utils.merge_samples set the dependency-direction precedent). Their tests move alongside to tests/fast/rollout/session/test_samples.py. Also deletes tests/e2e/sglang/utils/logprob_verify_generate.py: already unreferenced, and built on the records-collection path the follow-up commit retires. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
guapisolo
force-pushed
the
refactor/session-samples-move
branch
from
July 23, 2026 19:40
0d64438 to
8c55e0e
Compare
Shi-Dong
approved these changes
Jul 23, 2026
Shi-Dong
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Please fix the doc path before merging.
| forwards raw `messages` to SGLang, which tokenizes the prompt and returns the | ||
| response. `_compute_sample_from_openai_record` in | ||
| [`openai_endpoint_utils.py`](https://github.com/radixark/miles/blob/main/miles/rollout/generate_utils/openai_endpoint_utils.py) | ||
| [`samples.py`](https://github.com/radixark/miles/blob/main/miles/rollout/session/samples.py) |
Contributor
There was a problem hiding this comment.
This path doesn't seem to exist?
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
Move sample assembly from the client-side generate_utils module into the session package.
Motivation
The follow-up PR makes the session server assemble samples where the records live; server-owned logic must not live in a driver-named module (
core.pyimportinggenerate_utils.sample_utils.merge_samplesset the dependency-direction precedent). Public API and observable behavior stay unchanged.Before / After
compute_samples_from_openai_records, its per-record helper, plustruncate_samples_by_total_tokensmove unchanged frommiles/rollout/generate_utils/openai_endpoint_utils.pytomiles/rollout/session/samples/merge.py.tests/fast/rollout/session/test_samples.py; review the move with--find-copies.tests/e2e/sglang/utils/logprob_verify_generate.py: already unreferenced; built on the records-collection path the follow-up PR retires.Behavior Preservation
Verification
tests/fast/rollout/session/test_samples.pyplustests/fast/rollout/generate_utils/test_openai_endpoint_utils.py— 24 passed at this tip.Review Focus
--find-copies: pure moves plus import-path updates, nothing else.