Replies: 3 comments 1 reply
|
Tianlei Wu (@tianleiwu).. Can you please help answer the above question from ZackyLake. |
|
You can use shape info to assist compiling model (like static shape for shared buffer). In most cases in ort-genai, shared buffer is used for past and present kv, and we can also add a runtime check to validate tensor sharing (points to same address) for security. For the case that there is no room to append new kv. The operator shall fail (ORT_THROW). |
|
Tianlei Wu (@tianleiwu) latest gqa spec has changes for SWA, so there's 2 questions: The spec says "The op then keeps only the min(total_sequence_length, cache_capacity) most recent tokens, contiguously". For EP enabling, can we choose to do "conditional and greedy eviction", which means "everytime when putting new tokens causing overflow, evict at many token as possible only keep latest W"?
So does If it's actually |
Uh oh!
There was an error while loading. Please reload this page.
It's about com.microsoft.GroupQueryAttention
The document says:
But when compile the model, there's no information about what tensors being bound to past/present kv.
Does it mean we can use the shape to infer runtime tensor binding? Eg, when past_kv and present_kv is of same shape, app must bind the same tensor?
Also, consider an edge case, that past_kv and present_kv are all max_seq_len == past_seq_len, what should happen when there's no room to append new kv?
We are working on EP development, so would like to know the exact behavior of GQA.
We want to avoid copy if needed, and better to know during model compilation.
All reactions