| 54 | } |
| 55 | |
| 56 | CpuPrefixCache::CpuPrefixCache(const PrefixCacheOptions& options) : PrefixCache(options) { |
| 57 | if (options.hybrid_sliding_window_cache.value_or(false)) { |
| 58 | _initSlidingWindowAttention(); |
| 59 | } else { |
| 60 | _initFullAttention(); |
| 61 | } |
| 62 | prefix_cache::RadixTreeOptions radix_tree_options = {.enable_lru_eviction = false, // Not support yet |
| 63 | .eviction_threshold = 0.9f, // Not support yet |
| 64 | .enable_path_compression = false, // Not support yet |
| 65 | .min_compression_length = 2, // Not support yet |
| 66 | .transformer_blocks_num = options_.total_layers}; |
| 67 | tree_ = std::make_shared<prefix_cache::RadixTree>(radix_tree_options); |
| 68 | } |
| 69 | |
| 70 | prefix_cache::vp_addr_t CpuPrefixCache::allocKey(int layer_idx) { return caches_[layer_idx].first->alloc(); } |
| 71 |
nothing calls this directly
no outgoing calls
no test coverage detected