Skip to content

TASTI Engine ‐ Design Document

ttt-77 edited this page Oct 13, 2023 · 1 revision

Requirements:

  • TASTI engine execute inference only on cluster representative blobs and return the proxy score for all blobs by propagating score.

Steps:

  1. User needs to provide a blob mapping table to map blob keys to blob id, this blob id corresponds to vector id stored in vector database.

  2. Based on FPF algorithm, we select nbucket cluster representative blobs. Then we compute the distance to topk cluster representative blobs for each blob by using vector database.

  3. We create two tables to store the result from TASTI index, rep_table stores cluster representative blob ids and blob keys. Topk_table stores the distance information for each blob. So we can directly read these information from normal DB unless the vector database change.

  4. Each query requires a list of bound service, we filter cluster representative blobs based on query filtering predicates. Only satisfied cluster representative blob will be inferred by bound service.

  5. After inference on cluster representatives, we need to compute proxy score for each blob. We compute score for two types of filtering condition.

One is WHERE expression, like color = ‘blue’, frame > 1000. This can use 0/1 label. We need to change query to format: select IFF(color = ‘blue’, 1, 0) AS score1, IFF(frame>1000, 1, 0) AS score2. The reason we separate the WHERE condition into several scores rather than as a whole score is that we can get more decentralized distribution of proxy score. To combine these scores, currently, if condition1 AND condition2, the combined score is Min(score1, score2), if condition1 OR condition2, the combined score is Max(score1, score2).

(This is not supported yet) Another is aggregation type, such as Having Sum(car=’red’) > 3. It's more suitable to SELECT Sum(car=’red’) AS score3 rather than SELECT IFF(Sum(car=’red’), 1, 0) AS score3. We need to design a better algorithm to combine these scores.

  1. We can construct LIMIT engine based on TASTI engine. Specifically, we rank the blob id based on proxy score from high to low. And then, we do inference one by one until we meet LIMIT cardinality.