[None][chore] Remove unused token_range and is_last_slice parameters from _create_kv_slice - #16083
Conversation
|
/bot run --disable-fail-fast |
📝 WalkthroughWalkthroughThe ChangesToken Range Simplification
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/bot run --disable-fail-fast |
|
PR_Github #58081 [ run ] triggered by Bot. Commit: |
|
PR_Github #58082 [ run ] triggered by Bot. Commit: |
|
PR_Github #58081 [ run ] completed with state |
390cb3c to
eafac5e
Compare
|
PR_Github #58082 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
eafac5e to
9607bfa
Compare
|
PR_Github #58260 [ run ] triggered by Bot. Commit: |
|
PR_Github #58260 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
9607bfa to
6230e6e
Compare
|
PR_Github #58489 [ run ] triggered by Bot. Commit: |
|
PR_Github #58489 [ run ] completed with state
|
The token_range parameter of KvCacheTransceiverV2._create_kv_slice is never passed by any caller; every call site relies on the default computed range TokenRange(0, prompt_len + num_extra_kv_tokens). Drop the parameter and the test case that existed only to exercise the explicit-range passthrough. The KVSlice.token_range field and its default computation are unchanged. Signed-off-by: Iman Tabrizian <10105175+tabrizian@users.noreply.github.com>
…lice Like token_range, the is_last_slice parameter is never passed by any caller; every call site relies on the True default. Hardcode is_last_slice=True in the constructed KVSlice. The KVSlice.is_last_slice field and the native transfer protocol are unchanged. Signed-off-by: Iman Tabrizian <10105175+tabrizian@users.noreply.github.com>
6230e6e to
ce9b56b
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #58712 [ run ] triggered by Bot. Commit: |
|
PR_Github #58712 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #58798 [ run ] triggered by Bot. Commit: |
|
PR_Github #58798 [ run ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #58801 [ run ] triggered by Bot. Commit: |
|
PR_Github #58801 [ run ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #58819 [ run ] triggered by Bot. Commit: |
|
PR_Github #58819 [ run ] completed with state
|
|
/bot skip --comment "Unrelated CI failure" |
|
PR_Github #58873 [ skip ] triggered by Bot. Commit: |
|
PR_Github #58873 [ skip ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #58886 [ run ] triggered by Bot. Commit: |
|
/bot kill |
|
PR_Github #58893 [ kill ] triggered by Bot. Commit: |
|
PR_Github/16083-ce9b56b #58886 was force-killed by a newer pipeline run. |
|
PR_Github #58893 [ kill ] completed with state |
|
/bot skip --comment "CI has passed" |
|
PR_Github #59015 [ skip ] triggered by Bot. Commit: |
|
PR_Github #59015 [ skip ] completed with state |
@coderabbitai summary
Description
Part of the Python CacheTransceiver refactoring/cleanup.
The
token_rangeandis_last_sliceparameters ofKvCacheTransceiverV2._create_kv_sliceare dead code: no caller ever passes them — all call sites invoke_create_kv_slice(req)and rely on the defaults (computed rangeTokenRange(0, prompt_len + num_extra_kv_tokens)andis_last_slice=True). This PR removes both parameters, inlines the default range computation, and hardcodesis_last_slice=Truein the constructedKVSlice.Notes:
KVSlice.token_rangeandKVSlice.is_last_slicefields are unchanged; only the never-used function parameters are removed. Downstream consumers (e.g. the native transfer protocol innative/transfer.py) are unaffected.KVSliceobjects directly via the dataclass constructor.test_respects_explicit_token_range, which existed solely to exercise the removed passthrough, is deleted. The tests covering the default range computation are kept.Test Coverage
tests/unittest/disaggregated/test_cache_reuse_adapter.py::TestCreateKvSliceTokenRange(default-range tests retained)tests/unittest/disaggregated/test_cache_transceiver_single_process.pyPR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.