Fix LingBot KV metadata handling and unify KV config construction#3
Open
forLG wants to merge 2 commits into
Open
Fix LingBot KV metadata handling and unify KV config construction#3forLG wants to merge 2 commits into
forLG wants to merge 2 commits into
Conversation
- TeleFuser provides `global_end`/`local_end_index` as `int` metadata rather than array-like values. Now LingBot KV binding read and write them as scalars, See `cacheseek/reuse/exact_prefix/telefuser_lingbot.py`. - default Lingbot checkpoint needs full KV, but `examples/exact_prefix_reuse/e2e_telefuser_lingbot.py` initalize a rolling window config. Now when `local_attn_size=-1`, the config constructor will transfer from `make_rolling_config()` to `make_full_kv_config()`. See `examples/exact_prefix_reuse/e2e_telefuser_lingbot.py`. Further improvement: use a unified config constructor in `telefuser_lingbot.py`.
see `cacheseek/reuse/exact_reuse/telefuser_lingbot.py`, remove `make_rolling_config` and `make_full_kv_config`, add `make_world_kv_config` to unify them.
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
This PR fixes TeleFuser LingBot exact-prefix reuse against the current KV runtime metadata layout and simplifies KV config construction.
Changes:
global_end_indexandlocal_end_indexas scalar metadata instead of array-like values intelefuser_lingbot.py.local_attn_size == -1, which is required by the default LingBot checkpoint.make_full_kv_config()andmake_rolling_config()helpers with a unifiedmake_world_kv_config()helper.tests/test_world_kv_telefuser_binding.pyto cover the unifiedmake_world_kv_config()path instead of the removed rolling-config helper.Motivation
TeleFuser provides LingBot KV metadata such as
global_end_indexandlocal_end_indexas integers. The previous binding indexed them as array-like values, which breaks compatibility with the current runtime.The example also initialized a rolling-window KV config even when the runtime uses full KV. This could make cache materialization inconsistent with the pipeline configuration.
Testing
Run
pytest -m smokeand get all passed.Run
examples/exact_prefix_reuse/e2e_telefuser_lingbot.py:The result is following, all checks passed: