Skip to content

fix(scheduler): preserve shared sampling parameters when clipping - #788

Open
wenlive wants to merge 1 commit into
FlashML-org:mainfrom
wenlive:fix/shared-sampling-budget
Open

wenlive wants to merge 1 commit into
FlashML-org:mainfrom
wenlive:fix/shared-sampling-budget

Conversation

@wenlive

@wenlive wenlive commented Oct 22, 2026

Copy link
Copy Markdown

Fixes #787.

Offline prompts can share one SamplingParams. With a 64-token context and prompt lengths 56/48/8, clipping the first request changes all three 32-token budgets to 8, including the caller's object.

Copy the current message and its sampling parameters when clipping. Budgets remain 8/16/32; the regression covers both admission orders using the real scheduler and prefill queue.

Tested on Windows 11, Ryzen 7 9700X, RTX 5070 Ti (driver 616.56), Python 3.12.10 and Torch 2.14.1+cu130. All 16 tests in this file pass; the two new regressions fail on main 546c5fe. No checkpoint is needed for this admission-only test.

$env:PYTHONPATH = "$PWD/python"
python -m pytest tests/scheduler/test_cost_accounting_core.py -q

AI-assisted; validation was executed through development tooling.

KarrAcaRn pushed a commit to KarrAcaRn/FreeToken-ByAI that referenced this pull request Oct 23, 2026
…mpling parameters when clipping

next clips in _admit_user_msg (kv ladder split), so the copy-on-clip moved there.

Assisted-by: Claude Opus 5.5
KarrAcaRn pushed a commit to KarrAcaRn/FreeToken-ByAI that referenced this pull request Oct 23, 2026
FlashML-org#790 FlashML-org#788 adopted, FlashML-org#802 superseded by FlashML-org#804, FlashML-org#809 FlashML-org#792 drafts deferred; the 11 rebased
drafts stay deferred at their new heads.

Assisted-by: Claude Opus 5.5

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Context clipping mutates sampling parameters shared by offline requests

1 participant