MCPcopy Create free account

hub / github.com/Zefan-Cai/KVCache-Factory / types & classes

Types & classes47 in github.com/Zefan-Cai/KVCache-Factory

↓ 6 callersClassSnapKVCluster
pyramidkv/pyramidkv_utils.py:472
↓ 5 callersClassDynamicCache
A cache that grows dynamically as more tokens are generated. This is the default for generative models. It stores the Key and Value states a
pyramidkv/cache_utils_think.py:296
↓ 5 callersClassPyramidKVCluster
pyramidkv/pyramidkv_utils.py:323
↓ 3 callersClassCAMKVCluster
pyramidkv/pyramidkv_utils.py:652
↓ 3 callersClassH2OKVCluster
pyramidkv/pyramidkv_utils.py:797
↓ 3 callersClassL2NormCluster
pyramidkv/pyramidkv_utils.py:606
↓ 3 callersClassStreamingLLMKVCluster
pyramidkv/pyramidkv_utils.py:893
↓ 3 callersClass_FakeCache
Minimal stand-in for a transformers Cache exposing ``key_cache``.
tests/test_generation_state.py:6
↓ 2 callersClass_FakeLayer
tests/test_generation_state.py:13
↓ 1 callersClassAdaKVCluster
adapt from https://github.com/FFY0/AdaKV.
pyramidkv/pyramidkv_utils.py:945
↓ 1 callersClassEncoderDecoderCache
Base, abstract class for all encoder-decoder caches. Can be used to hold combinations of self-attention and cross-attention caches. Exam
pyramidkv/cache_utils_think.py:1269
↓ 1 callersClassHeadKVCluster
adapt from https://github.com/FFY0/AdaKV.
pyramidkv/pyramidkv_utils.py:1094
↓ 1 callersClassLLMNeedleHaystackTester
This class is used to test the LLM Needle Haystack.
run_needle_in_haystack.py:33
ClassAdaKVKvHeadInvariantsTest
kv_head mode: unrepeated K/V at KV_HEADS, query at Q_HEADS.
tests/test_adakv_headkv_kv_head.py:174
ClassBitIdentityTest
tests/test_query_head_bitident.py:76
ClassBitIdentityTest
Old-vs-new torch.equal on outputs AND metadata in the legacy shapes.
tests/test_adakv_headkv_kv_head.py:128
ClassCache
Base, abstract class for all caches. The actual data structure is specific to each subclass.
pyramidkv/cache_utils_think.py:26
ClassCacheConfig
Base class for cache configs
pyramidkv/cache_utils_think.py:101
ClassDecodeMetadataSimulationTest
Pure-torch simulation of the per-step decode metadata mutation done by the model forwards (klen_sum += num_cached_heads, max_seqlen_k += 1, cu
tests/test_adakv_headkv_kv_head.py:356
ClassDynamicCacheSplitHeadFlatten
adapt from https://github.com/FFY0/AdaKV.
pyramidkv/pyramidkv_utils.py:41
ClassGpuOnlySurfacesTest
tests/test_adakv_headkv_kv_head.py:392
ClassHQQQuantizedCache
Quantized Cache class that uses `HQQ` as a backend to perform quantization. Current implementation supports `int2`, `int4`, `int8` dtypes. P
pyramidkv/cache_utils_think.py:766
ClassHeadKVKvHeadInvariantsTest
tests/test_adakv_headkv_kv_head.py:289
ClassHybridCache
Hybrid Cache class to be used with `torch.compile` for Gemma2 models that alternate between a local sliding window attention and global atten
pyramidkv/cache_utils_think.py:1437
ClassIsEmptyPastKeyValuesTest
tests/test_generation_state.py:30
ClassKVHeadModeShapeTest
kv_head mode invariants for every in-scope cluster on unrepeated GQA inputs.
tests/test_gqa_kv_head.py:76
ClassKVQuantizedCache
pyramidkv/quantcache.py:12
ClassKvSeqLenResetTest
tests/test_generation_state.py:48
ClassLlamaGQAIntegrationTest
tests/test_gqa_model_integration.py:111
ClassMambaCache
Cache for mamba model which does not have attention mechanism and key value states. Arguments: config (`PretrainedConfig):
pyramidkv/cache_utils_think.py:1596
ClassMergeKVTest
tests/test_merge_kv.py:8
ClassMiniCacheTest
tests/test_minicache.py:13
ClassMistralGQAIntegrationTest
tests/test_gqa_model_integration.py:183
ClassNACLSelectionTest
tests/test_nacl.py:12
ClassNoCompressionBelowCapacityTest
tests/test_gqa_kv_head.py:242
ClassOffloadedCache
A drop-in replacement for DynamicCache that conserves GPU memory at the expense of more CPU memory. Useful for generating from models with ve
pyramidkv/cache_utils_think.py:507
ClassQuantizationConfigTest
tests/test_quantization.py:11
ClassQuantizedCache
A quantizer cache similar to what is described in the [KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cache paper](https://arxiv.org/abs
pyramidkv/cache_utils_think.py:619
ClassQuantizedCacheConfig
Configuration class for quantized cache settings. Attributes: backend (`str`, *optional*, defaults to `"quanto"`): Backe
pyramidkv/cache_utils_think.py:198
ClassQuantoQuantizedCache
Quantized Cache class that uses `quanto` as a backend to perform quantization. Current implementation supports `int2` and `int4` dtypes only.
pyramidkv/cache_utils_think.py:707
ClassQuestSelectionTest
tests/test_quest.py:13
ClassScissorhandsSelectionTest
tests/test_scissorhands.py:12
ClassScoreAggregationTest
tests/test_gqa_kv_head.py:194
ClassSinkCache
A cache that as described in the [Attention Sinks paper](https://arxiv.org/abs/2309.17453). It allows the model to generate beyond the length
pyramidkv/cache_utils_think.py:827
ClassSlidingWindowCache
Sliding Window Cache class to be used with `torch.compile` for models like Mistral that support sliding window attention. Every time when we
pyramidkv/cache_utils_think.py:1149
ClassSnapKVNaiveReferenceTest
tests/test_gqa_kv_head.py:181
ClassStaticCache
Static Cache class to be used with `torch.compile(model)` and `torch.export()`. Parameters: config (`PretrainedConfig`):
pyramidkv/cache_utils_think.py:1011