-
Notifications
You must be signed in to change notification settings - Fork 105
test: add precise_prefix_cache_test #505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
🚨 Unsigned commits detected! Please sign your commits. For instructions on how to set up GPG/SSH signing and verify your commits, |
8fd3821 to
c666f2e
Compare
|
notes:
|
6ff41cd to
39b2a03
Compare
|
this is now working e2e for Completions. It still hangs for ChatCompletions, I will investigate later. This is still open for comments. again, hangs are 90% due to errors not bubbling up from the tasks queues of the tokenizer; the response queue should receive errors as well as completed tasks. I'll follow up with an issue and/or PR there once this is done. |
The |
|
added ChatCompletion example |
9dbab1a to
97da662
Compare
|
|
||
| // KVBlockIndex returns the underlying kvblock.Index for testing purposes. | ||
| func (s *PrecisePrefixCacheScorer) KVBlockIndex() kvblock.Index { | ||
| return s.kvCacheIndexer.KVBlockIndex() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: this is only necessary because the test follows the pattern package score_test. If the test were under package score then we could just access s.kvCacheIndexer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think going for package score and adding a nolint directive wherever necessary is cleaner. @elevran what do you think?
In general this scorer is not expected to understand the internals of the kvcache library, it is only concerned with the API exposed by the indexer.
Signed-off-by: Edoardo Vacchi <[email protected]>
97da662 to
0efed84
Compare
Signed-off-by: Edoardo Vacchi <[email protected]>
Fixes #218. Partially based on initial work in #311 and @vMaroon's advice at #311 (review) (if I have understood it correctly).
Opening as draft to see if I am on the right track, early feedback is welcome.At this time, this is successfully testing a couple of edge cases (nil request, empty request body), just to make sure that the test case run correctly; then there is one proper test case ("test normalized scores with different kv-block hits"), failing at this timeThe reason the test fails is all scores are zero, indicating there might be still some issues initializing the tokenizer. I have to investigate.Notes:
if testing.Short() { t.Skip() }) in the same fashion of other tokenization tests in the cache manager.kvcache.Indexerinto an interface, and that would probably simplify this; e.g. by allowing us to inject a mock tokenizer