MCPcopy Create free account

hub / github.com/Cornell-RelaxML/qtip / functions

Functions265 in github.com/Cornell-RelaxML/qtip

↓ 12 callersMethod__init__
(self, config, layer_idx)
model/llama.py:300
↓ 12 callersMethod__init__
(self)
model/cache_utils.py:33
↓ 9 callersMethodupdate
Updates the cache with the new `key_states` and `value_states` for the layer `layer_idx`. Parameters: key_states (`torch
model/cache_utils.py:36
↓ 7 callersFunctionmodel_from_hf_path
(path, max_mem_ratio=0.7, device_map=None)
lib/utils/unsafe_import.py:13
↓ 4 callersMethod_quantize
Quantizes a key/value using a defined quantization method.
model/cache_utils.py:732
↓ 4 callersMethodcheck_dynamic_cache
(self, method: str)
model/cache_utils.py:1471
↓ 4 callersFunctionclean
()
lib/utils/misc.py:10
↓ 4 callersMethodrecons_lut
(self)
lib/codebook/bitshift.py:189
↓ 4 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
model/llama.py:405
↓ 4 callersFunctionsym_to_flat
(A)
lib/utils/data_utils.py:22
↓ 4 callersMethodto_legacy_cache
Converts the `DynamicCache` instance into the its equivalent in the legacy cache format. Used for backward compatibility.
model/cache_utils.py:456
↓ 3 callersFunctionapply_rotary_pos_emb
Applies Rotary Position Embedding to the query and key tensors. Args: q (`torch.Tensor`): The query tensor. k (`torch.Tensor`): T
model/llama.py:271
↓ 3 callersFunctiondecode_compressed
(L, S, R, V, m, k, compressed, expanded_lut)
lib/utils/kernel_decompress.py:5
↓ 3 callersFunctiongenerate
(model, tokenizer, text, max_new_tokens, top_k, callback, past_kv)
eval/interactive_gen.py:52
↓ 3 callersMethodget_max_length
Returns the maximum sequence length of the cached states, if there is any.
model/cache_utils.py:67
↓ 3 callersMethodget_seq_length
Returns the sequence length of the cached states. A layer index can be optionally passed.
model/cache_utils.py:62
↓ 3 callersMethodget_seq_length
Returns the sequence length of the cached states. A layer index can be optionally passed.
model/cache_utils.py:441
↓ 3 callersMethodquantize
(self, X, **kwargs)
lib/codebook/bitshift.py:283
↓ 3 callersMethodrecons
(self, encoded, **kwargs)
lib/codebook/bitshift.py:199
↓ 3 callersMethodunpack_trellis
(self, packed, T)
lib/codebook/bitshift.py:329
↓ 3 callersMethodupdate
(self, cost, thing)
lib/codebook/bitshift.py:204
↓ 2 callersMethod_create_key_value_cache_tensors
Creates K/V cache tensors on a device. Pins memory for CPU tensors. Marks them as static addresses for non-CPU tensors. Args:
model/cache_utils.py:2051
↓ 2 callersMethod_dequantize
Dequantizes back the tensor that was quantized by `self._quantize()`
model/cache_utils.py:736
↓ 2 callersMethod_prefetch_layer_in_context
Performs the actual copy of the layer to device cache.
model/cache_utils.py:2091
↓ 2 callersFunction_prepare_4d_causal_attention_mask_with_cache_position
Creates a causal 4D mask of shape `(batch_size, 1, query_length, key_value_length)` from a 2D mask of shape `(batch_size, key_value_length)`,
model/llama.py:56
↓ 2 callersMethodbackward
(ctx, grad_output)
lib/codebook/bitshift.py:492
↓ 2 callersMethodbatch_repeat_interleave
Repeat the cache `repeats` times in the batch dimension. Used in contrastive search.
model/cache_utils.py:524
↓ 2 callersMethodbatch_select_indices
Only keep the `indices` in the batch dimension of the cache. Used in contrastive search.
model/cache_utils.py:530
↓ 2 callersMethodbatch_split
Split the current instance into a list of `DynamicCache` by the batch size. This will be used by `_split_model_inputs()` in `generation.utils`
model/cache_utils.py:495
↓ 2 callersFunctionbfe16_to_fp16
(x)
lib/codebook/bitshift.py:45
↓ 2 callersMethodcache_hatW
(self, packed_trellis, had_left, had_right, K_left, K_right, m, n, rcp, tp_rank)
lib/codebook/bitshift.py:389
↓ 2 callersFunctioncallback
(x)
eval/interactive_gen.py:177
↓ 2 callersFunctionconvert_tensor
(tensor)
lib/utils/shard_model.py:12
↓ 2 callersFunctiondecompress_matvec
(R, out, compressed, x, codebook)
qtip-kernels/test_decompress_matvec.py:137
↓ 2 callersMethodevict_previous_layer
Moves the previous layer cache to the CPU
model/cache_utils.py:567
↓ 2 callersFunctionflat_to_sym
(V, N)
lib/utils/data_utils.py:14
↓ 2 callersFunctionget_c4
(nsamples, seed, seqlen, model)
lib/utils/gptq_data_utils.py:63
↓ 2 callersFunctionget_c4_new
(nsamples, seed, seqlen, model)
lib/utils/gptq_data_utils.py:139
↓ 2 callersMethodget_hatW
(self, unpacked_trellis, m, n)
lib/codebook/bitshift.py:378
↓ 2 callersFunctionget_wikitext2
(nsamples, seed, seqlen, model)
lib/utils/gptq_data_utils.py:14
↓ 2 callersFunctionprepare_arguments
(L, S, R, V, m, n, k)
qtip-kernels/test_decompress_matvec.py:251
↓ 2 callersMethodquantize_seq
(self, X, overlap=None, **kwargs)
lib/codebook/bitshift.py:261
↓ 2 callersFunctionquantlut
(tlut, L, nbits)
lib/codebook/bitshift.py:63
↓ 2 callersFunctionquantlut_sym
(tlut, L, nbits)
lib/codebook/bitshift.py:72
↓ 2 callersMethodreorder_cache
Reorders the cache for beam search, given the selected beam indices.
model/cache_utils.py:82
↓ 2 callersMethodreset
(self)
model/cache_utils.py:1821
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
model/llama.py:264
↓ 2 callersFunctionsample
(logits, temperature: float = 1.0, top_k: Optional[int] = None)
eval/interactive_gen.py:36
↓ 2 callersFunctiontime_kernel_dual
(kernel1, kernel2)
qtip-kernels/test_decompress_matvec.py:69
↓ 2 callersMethodupdate
Updates the cache with the new `key_states` and `value_states` for the layer `layer_idx`. Parameters: key_states (`torch
model/cache_utils.py:397
↓ 1 callersMethod__init__
(self, layers, arg_fn)
lib/utils/shard_model.py:32
↓ 1 callersMethod__init__
(self, td_x, td_y, L, K,
lib/codebook/bitshift.py:358
↓ 1 callersMethod_apply_key_rotary_pos_emb
( self, key_states: torch.Tensor, cos: torch.Tensor, sin: torch.Tensor )
model/cache_utils.py:913
↓ 1 callersMethod_dynamic_frequency_update
dynamic RoPE layers should recompute `inv_freq` in the following situations: 1 - growing beyond the cached sequence length (allow sca
model/llama.py:192
↓ 1 callersMethod_get_rerotation_cos_sin
( self, key_states: torch.Tensor, cos: torch.Tensor, sin: torch.Tensor )
model/cache_utils.py:919
↓ 1 callersMethod_prefetch_layer
Prefetch a layer to the device. Needs to be called in order of layer indices.
model/cache_utils.py:2077
↓ 1 callersMethod_rotate_half
(x)
model/cache_utils.py:908
↓ 1 callersMethod_update_causal_mask
( self, attention_mask: torch.Tensor, input_tensor: torch.Tensor, cache_positi
model/llama.py:1284
↓ 1 callersFunctionbenchmark
()
qtip-kernels/src/baseline.py:4
↓ 1 callersFunctioncheck_exist
(idx, args)
quantize_llama/quantize_finetune_llama.py:58
↓ 1 callersMethodckpt_forward
(self, input)
lib/linear/quantized_linear.py:88
↓ 1 callersFunctionconvert_args
(args, kwargs, device, dtype)
lib/utils/shard_model.py:10
↓ 1 callersMethodcrop
Crop the past key values up to a new `max_length` in terms of tokens. `max_length` can also be negative to remove `max_length` tokens. This is
model/cache_utils.py:478
↓ 1 callersFunctiondecode_1mad
(x)
lib/codebook/bitshift.py:17
↓ 1 callersFunctiondecode_2mad
(x)
lib/codebook/bitshift.py:29
↓ 1 callersFunctiondecode_3inst
(x)
lib/codebook/bitshift.py:43
↓ 1 callersFunctiondecode_compressed
(L, S, R, V, m, k, compressed, codebook)
qtip-kernels/test_decompress_matvec.py:192
↓ 1 callersFunctiondecode_one_tokens
(model, cur_token, past_kv, cache_position)
eval/interactive_gen.py:43
↓ 1 callersFunctiondecompress_matvec_time
(R, args1, args2)
qtip-kernels/test_decompress_matvec.py:123
↓ 1 callersFunctionfinetune_decoder_layer
(layer, name, device, train_dl, valid_dl, orig_dtype, args)
lib/algo/finetune.py:29
↓ 1 callersMethodforward
(self, x)
model/llama.py:373
↓ 1 callersMethodfrom_legacy_cache
Converts a cache in the legacy cache format into an equivalent `DynamicCache`. Used for backward compatibility.
model/cache_utils.py:466
↓ 1 callersMethodget_hatW_kernel
(self, trellis, m, n)
lib/codebook/bitshift.py:383
↓ 1 callersFunctionget_ptb
(nsamples, seed, seqlen, model)
lib/utils/gptq_data_utils.py:37
↓ 1 callersFunctionget_ptb_new
(nsamples, seed, seqlen, model)
lib/utils/gptq_data_utils.py:116
↓ 1 callersMethodget_seq_length
Returns the sequence length of the cached states. A layer index can be optionally passed.
model/cache_utils.py:941
↓ 1 callersFunctionhas_kernel
(decode_mode, L, K, V, tlut_bits, td_x, td_y)
lib/utils/kernel_check.py:1
↓ 1 callersFunctionlogits_to_probs
(logits, temperature: float = 1.0, top_k: Optional[int] = None)
eval/interactive_gen.py:23
↓ 1 callersFunctionmain
(args)
quantize_llama/input_hessian_llama.py:34
↓ 1 callersFunctionmain
(args)
quantize_llama/quantize_finetune_llama.py:99
↓ 1 callersFunctionmain
(args)
quantize_llama/finetune_e2e_llama.py:58
↓ 1 callersFunctionmain
(args)
quantize_llama/manifest_model.py:24
↓ 1 callersFunctionmain
(args)
quantize_llama/hfize_llama.py:22
↓ 1 callersFunctionmain
(hf_path, compile, interactive, max_tokens, top_k)
eval/interactive_gen.py:97
↓ 1 callersFunctionmain
(args)
eval/eval_ppl.py:26
↓ 1 callersFunctionmain
(args)
eval/eval_zeroshot.py:32
↓ 1 callersFunctionmultinomial_sample_one_no_sync
( probs_sort )
eval/interactive_gen.py:15
↓ 1 callersMethodno_ckpt_forward
(self, input)
lib/linear/quantized_linear.py:93
↓ 1 callersMethodpack_trellis
(self, trellis)
lib/codebook/bitshift.py:294
↓ 1 callersMethodprefetch_layer
Starts prefetching the next layer cache
model/cache_utils.py:558
↓ 1 callersFunctionprepare_arguments_sanity
(L, S, R, V, m, n, k)
qtip-kernels/test_decompress_matvec.py:144
↓ 1 callersFunctionquantlut_sym
(tlut, L, nbits)
qtip-kernels/test_decompress_matvec.py:181
↓ 1 callersFunctionquipsharp_time
(M, N, K)
qtip-kernels/test_decompress_matvec.py:94
↓ 1 callersFunctiontest_kernels
(L, S, R, V)
qtip-kernels/test_decompress_matvec.py:275
↓ 1 callersFunctiontime_qs_kernels
()
qtip-kernels/test_decompress_matvec.py:118
↓ 1 callersMethodto_dict
Serializes this instance to a Python dictionary. Returns: `Dict[str, Any]`: Dictionary of all the attributes that make up this co
model/cache_utils.py:152
↓ 1 callersMethodto_json_string
Serializes this instance to a JSON formatted string. Returns: str: JSON formatted string representing the configuration i
model/cache_utils.py:169
↓ 1 callersFunctionuse_tf32
()
lib/algo/finetune.py:22
↓ 1 callersMethodviterbi
(self, X, overlap=None)
lib/codebook/bitshift.py:218
FunctionH_hook
(module, x)
lib/utils/data_utils.py:33
next →1–100 of 265, ranked by callers