MCPcopy Create free account

hub / github.com/Zefan-Cai/KVCache-Factory / functions

Functions410 in github.com/Zefan-Cai/KVCache-Factory

Methodreset
(self, window_size = 64, max_capacity_prompt = 256 + 64, kernel_size = 5, pooling = 'avgpool', merge = None)
pyramidkv/pyramidkv_utils.py:340
Methodreset
(self, window_size = 64, max_capacity_prompt = 256 + 64, kernel_size = 5, pooling = 'avgpool', merge = None, r
pyramidkv/pyramidkv_utils.py:484
Methodreset
(self, max_capacity_prompt:int=256+64, layer_idx:int=0, skip_layers: List[int] = [])
pyramidkv/pyramidkv_utils.py:613
Methodreset
(self, start_budget_ratio = 0.1, window_size = 64, max_capacity_prompt = 256 + 64, kernel_size = 5, pooling =
pyramidkv/pyramidkv_utils.py:663
Methodreset
(self, window_size = 64, max_capacity_prompt = 256 + 64, kernel_size = 5, pooling = 'avgpool', merge = None)
pyramidkv/pyramidkv_utils.py:807
Methodreset
(self, window_size = 64, max_capacity_prompt = 256 + 64, kernel_size = 5, pooling = 'avgpool', merge = None)
pyramidkv/pyramidkv_utils.py:903
Methodreset
Resets the cache values while preserving the objects
pyramidkv/cache_utils_think.py:1141
Methodreset
(self)
pyramidkv/cache_utils_think.py:1262
Methodreset
(self)
pyramidkv/cache_utils_think.py:1359
Methodreset
Resets the cache values while preserving the objects
pyramidkv/cache_utils_think.py:1588
Functionretrieval_score
(prediction, ground_truth, **kwargs)
metrics.py:56
Functionretrieval_zh_score
(prediction, ground_truth, **kwargs)
metrics.py:68
Functionrouge_zh_score
(prediction, ground_truth, **kwargs)
metrics.py:112
Methodseen_tokens
(self)
pyramidkv/cache_utils_think.py:89
Functionstr2bool
(value)
pyramidkv/eval_utils.py:7
Methodtest_adakv
(self)
tests/test_adakv_headkv_kv_head.py:155
Methodtest_adakv_no_normalize
(self)
tests/test_adakv_headkv_kv_head.py:160
Methodtest_agg_max_vs_mean_selection_differs
A past token only ONE query head in a group attends to strongly must score (and select) differently under agg='max' vs agg='mean'.
tests/test_adakv_headkv_kv_head.py:254
Methodtest_allows_axis_override_for_experiments
(self)
tests/test_quantization.py:30
Methodtest_attn_score_rows_are_kv_heads
(self)
tests/test_adakv_headkv_kv_head.py:204
Methodtest_attn_score_rows_are_kv_heads
(self)
tests/test_adakv_headkv_kv_head.py:348
Methodtest_builds_gear_config_with_rank_and_outlier_ratio
(self)
tests/test_quantization.py:43
Methodtest_builds_kivi_asymmetric_config
(self)
tests/test_quantization.py:21
Methodtest_cam
(self)
tests/test_query_head_bitident.py:132
Methodtest_cam_kv_head
(self)
tests/test_gqa_kv_head.py:147
Methodtest_capacity_table_group_mean_reduction
Layer row [8,4,6,2, 12,2,4,6] over 8 query heads must reduce to per-kv-head capacities [mean(8,4,6,2), mean(12,2,4,6)] = [5, 6].
tests/test_adakv_headkv_kv_head.py:290
Methodtest_compress_metadata_and_budget
(self)
tests/test_adakv_headkv_kv_head.py:210
Methodtest_compress_restore_keeps_retained_tokens_exact
(self)
tests/test_minicache.py:32
Methodtest_deterministic
(self)
tests/test_adakv_headkv_kv_head.py:232
Methodtest_deterministic
(self)
tests/test_adakv_headkv_kv_head.py:328
Methodtest_empty_and_populated_cache_object
(self)
tests/test_generation_state.py:34
Methodtest_empty_and_populated_legacy_tuple
(self)
tests/test_generation_state.py:38
Methodtest_flatten_cache_decode_append
(self)
tests/test_adakv_headkv_kv_head.py:393
Methodtest_fresh_call_resets_stale_kv_seq_len
(self)
tests/test_generation_state.py:49
Methodtest_gear_config_rejects_bad_rank_and_outlier_ratio
(self)
tests/test_quantization.py:55
Methodtest_h2o
(self)
tests/test_query_head_bitident.py:120
Methodtest_h2o_kv_head
(self)
tests/test_gqa_kv_head.py:139
Methodtest_headkv
(self)
tests/test_adakv_headkv_kv_head.py:165
Methodtest_increments_match_rebuild
(self)
tests/test_adakv_headkv_kv_head.py:364
Methodtest_kivi_config_omits_gear_fields
(self)
tests/test_quantization.py:61
Methodtest_l2norm
(self)
tests/test_query_head_bitident.py:138
Methodtest_l2norm_kv_head
(self)
tests/test_gqa_kv_head.py:168
Methodtest_max_agg_selects_outlier_head_token
A token that one query head in the group attends to strongly must be kept under agg='max' but diluted away under agg='mean'.
tests/test_gqa_kv_head.py:213
Methodtest_mean_reduction_rounds
(self)
tests/test_adakv_headkv_kv_head.py:317
Methodtest_no_compress_passthrough
(self)
tests/test_adakv_headkv_kv_head.py:242
Methodtest_no_compress_passthrough
(self)
tests/test_adakv_headkv_kv_head.py:338
Methodtest_none_is_empty
(self)
tests/test_generation_state.py:31
Methodtest_normalize_empty_quant_method
(self)
tests/test_quantization.py:12
Methodtest_object_without_key_cache_is_not_empty
(self)
tests/test_generation_state.py:42
Methodtest_ongoing_decode_step_preserves_kv_seq_len
(self)
tests/test_generation_state.py:60
Methodtest_page_metadata_tracks_min_and_max_per_page
(self)
tests/test_quest.py:14
Methodtest_pivot_merge_preserves_shape_and_recent_tokens
(self)
tests/test_merge_kv.py:9
Methodtest_probabilistic_selection_is_unique_and_protected
(self)
tests/test_scissorhands.py:40
Methodtest_proxy_indices_suffix_and_edges_modes
(self)
tests/test_nacl.py:13
Methodtest_proxy_scores_reduce_selected_query_rows
(self)
tests/test_nacl.py:20
Methodtest_pyramidkv
(self)
tests/test_query_head_bitident.py:112
Methodtest_pyramidkv_both_modes
(self)
tests/test_gqa_model_integration.py:160
Methodtest_pyramidkv_kept_length_matches_across_modes
(self)
tests/test_gqa_model_integration.py:174
Methodtest_pyramidkv_kv_head_matches_query_head_kept_length
(self)
tests/test_gqa_kv_head.py:125
Methodtest_pyramidkv_kv_head_middle_branch
(self)
tests/test_gqa_kv_head.py:114
Methodtest_random_budget_samples_without_duplicates_or_losing_protection
(self)
tests/test_nacl.py:41
Methodtest_reduce_group_scores_exact_values
(self)
tests/test_gqa_kv_head.py:195
Methodtest_reduce_group_scores_groups_one_is_identity
(self)
tests/test_gqa_kv_head.py:205
Methodtest_reduce_group_scores_rejects_unknown_agg
(self)
tests/test_gqa_kv_head.py:209
Methodtest_reduce_scores_uses_recent_history_window
(self)
tests/test_scissorhands.py:13
Methodtest_rejects_unknown_quant_method
(self)
tests/test_quantization.py:17
Methodtest_retention_keeps_largest_angular_distance_indices
(self)
tests/test_minicache.py:25
Methodtest_scores_use_query_sign_to_choose_bounds
(self)
tests/test_quest.py:25
Methodtest_select_pages_is_query_aware
(self)
tests/test_quest.py:34
Methodtest_select_tokens_does_not_return_partial_page_sentinel
(self)
tests/test_quest.py:57
Methodtest_select_tokens_keeps_proxy_and_top_scores
(self)
tests/test_nacl.py:28
Methodtest_select_tokens_keeps_recent_window_and_exact_budget
(self)
tests/test_quest.py:47
Methodtest_select_tokens_keeps_sink_recent_and_top_importance
(self)
tests/test_scissorhands.py:28
Methodtest_selection_matches_naive_reference
(self)
tests/test_gqa_kv_head.py:182
Methodtest_short_prompt_passthrough_kv_head
(self)
tests/test_gqa_kv_head.py:243
Methodtest_slerp_preserves_unit_direction_and_magnitudes
(self)
tests/test_minicache.py:14
Methodtest_snapkv
(self)
tests/test_query_head_bitident.py:100
Methodtest_snapkv_kv_head
(self)
tests/test_gqa_model_integration.py:131
Methodtest_snapkv_kv_head
(self)
tests/test_gqa_model_integration.py:192
Methodtest_snapkv_kv_head
(self)
tests/test_gqa_kv_head.py:106
Methodtest_snapkv_kv_head_mha_config
(self)
tests/test_gqa_model_integration.py:139
Methodtest_snapkv_merge_pivot
(self)
tests/test_query_head_bitident.py:106
Methodtest_snapkv_query_head
(self)
tests/test_gqa_model_integration.py:135
Methodtest_snapkv_query_head
(self)
tests/test_gqa_model_integration.py:198
Methodtest_snapkv_query_head_mha_config
(self)
tests/test_gqa_model_integration.py:145
Methodtest_snapkv_sdpa_both_modes
(self)
tests/test_gqa_model_integration.py:154
Methodtest_snapkv_sdpa_both_modes
(self)
tests/test_gqa_model_integration.py:204
Methodtest_streamingllm
(self)
tests/test_query_head_bitident.py:126
Methodtest_streamingllm_both_modes
(self)
tests/test_gqa_model_integration.py:149
Methodtest_streamingllm_kv_head_exact_sinks_plus_recent
(self)
tests/test_gqa_kv_head.py:158
Methodtest_update_importance_applies_decay
(self)
tests/test_scissorhands.py:20
Methodtest_weighted_merge_supports_non_128_head_dim
(self)
tests/test_merge_kv.py:22
Functionthink_model_forward
( self, input_ids: torch.LongTensor = None, attention_mask: Optional[torch.Tensor] = None, pos
pyramidkv/llama_model_think.py:553
Methodto_json_file
Save this instance to a JSON file. Args: json_file_path (`str` or `os.PathLike`): Path to the JSON file
pyramidkv/cache_utils_think.py:130
Methodto_legacy_cache
Converts the `DynamicCache` instance into the its equivalent in the legacy cache format.
pyramidkv/pyramidkv_utils.py:100
Methodto_legacy_cache
Converts the `EncoderDecoderCache` instance into its equivalent in the legacy cache format.
pyramidkv/cache_utils_think.py:1325
Methodupdate
Updates attributes of this class instance with attributes from `kwargs` if they match existing attributes, returning all the unused k
pyramidkv/cache_utils_think.py:174
Methodupdate
Updates the cache with the new `key_states` and `value_states` for the layer `layer_idx`. Parameters: key_states (`torch.
pyramidkv/cache_utils_think.py:574
Methodupdate
( self, key_states: torch.Tensor, value_states: torch.Tensor, layer_idx: int,
pyramidkv/cache_utils_think.py:648
Methodupdate
Updates the cache with the new `key_states` and `value_states` for the layer `layer_idx`. Parameters: key_states (`torch
pyramidkv/cache_utils_think.py:916
← previousnext →301–400 of 410, ranked by callers