MCPcopy Create free account

hub / github.com/Vahe1994/AQLM / functions

Functions225 in github.com/Vahe1994/AQLM

↓ 1 callersFunctionget_c4_new
(nsamples, seqlen, tokenizer, eval_mode=False)
src/datautils.py:143
↓ 1 callersFunctionget_converted_state_dict
(config, nbits: int, in_path: os.PathLike)
convert_to_hf.py:50
↓ 1 callersFunctionget_int_dtype
(nbits: int)
convert_to_hf.py:16
↓ 1 callersFunctionget_layers_prefix
(config)
convert_to_hf.py:42
↓ 1 callersFunctionget_lm_logits
(inps_, model)
src/modelutils.py:117
↓ 1 callersFunctionget_metadata
(in_path: os.PathLike)
convert_to_hf.py:80
↓ 1 callersFunctionget_num_layers
(config)
convert_to_hf.py:34
↓ 1 callersFunctionget_original_named_parameters_from_fsdp_module
(dequantized_model)
src/pv_utils.py:116
↓ 1 callersFunctionget_ptb
(nsamples, seqlen, tokenizer, eval_mode=False)
src/datautils.py:60
↓ 1 callersFunctionget_ptb_new
(nsamples, seqlen, tokenizer, eval_mode=False)
src/datautils.py:126
↓ 1 callersFunctionget_red_pajama
(nsamples, seqlen, tokenizer, eval_mode=False)
src/datautils.py:22
↓ 1 callersFunctionget_sequential_groups
(model)
src/modelutils.py:159
↓ 1 callersFunctionget_wikitext2
(nsamples, seqlen, tokenizer, eval_mode=False)
src/datautils.py:43
↓ 1 callersFunctioninit_aq_engines
Create a dictionary of AQUtil instances for each quantized layer; Run forward pass on each sample in inps_tensor; write output activations to
main.py:428
↓ 1 callersFunctioninit_aq_engines_parallel
Parallel version of init_aq_engines; works on lists of input/output tensors
main.py:487
↓ 1 callersFunctioninit_aq_kmeans
Create initial codes and codebooks using residual K-means clustering of weights :params reference_weight, num_codebooks, out_group_size, in_g
src/aq.py:288
↓ 1 callersFunctionis_model_for_causal_lm
(model: nn.Module)
src/modelutils.py:89
↓ 1 callersMethoditerate_groups_with_prefetch
Iterate parameters and optimizer states; skip parameters that do not require grad
src/configurable_adam.py:164
↓ 1 callersFunctionload_dequantized_model
Load quantized model by dequantizing it
src/modelutils.py:235
↓ 1 callersFunctionload_linear_layers
(layer, quant_layer, model)
src/modelutils.py:194
↓ 1 callersFunctionload_model
(model_name, device="cuda")
benchmark/generate_benchmark.py:59
↓ 1 callersFunctionload_quantized_model
Load quantized model
src/modelutils.py:251
↓ 1 callersFunctionload_quantized_model_from_fdsp_checkpoint
(base_model_name: str, fsdp_checkpoint_path: str, **kwargs)
convert_legacy_model_format.py:70
↓ 1 callersFunctionload_shared_model
(model_name, device="cuda")
benchmark/generate_benchmark.py:67
↓ 1 callersFunctionload_student_model
load student model for fine-tuning. If dequantize is set, dequantize all quantized weights to accumulate full grads
finetune.py:553
↓ 1 callersFunctionload_teacher_model
Load unquantized model with frozen parameters
finetune.py:527
↓ 1 callersFunctionload_training_state
Load model, optimizer state dict and metadata saved via save_training_state; update parameters in-place
finetune.py:836
↓ 1 callersFunctionmain
()
finetune.py:991
↓ 1 callersFunctionmain
()
main.py:583
↓ 1 callersFunctionmain
()
convert_legacy_model_format.py:102
↓ 1 callersFunctionmaster_rank_first
(local: bool, master_rank: int = 0)
src/utils.py:203
↓ 1 callersFunctionmaybe_checkpoint
Execute function normally or with checkpointing, depending on checkpoint_enabled. Forward **checkpoint_kwargs
src/memory_efficient_loss.py:72
↓ 1 callersFunctionmaybe_get_0th_element
Return first element if input is Sequence, otherwise return input
src/utils.py:141
↓ 1 callersFunctionnext_power_of_2
(x)
inference_lib/src/aqlm/inference_kernels/triton_kernel.py:128
↓ 1 callersFunctionone_rank_at_a_time
In distributed setting, let only group_size processes enter at a time :param local: if True, the limit is enforced within each host, i.e. dis
src/utils.py:184
↓ 1 callersFunctionpack_int_data
(data: torch.IntTensor, nbits: int)
convert_to_hf.py:29
↓ 1 callersFunctionparse_eval_args
()
lmeval.py:31
↓ 1 callersFunctionperplexity_eval
(model: PreTrainedModel, testenc: torch.LongTensor, args: Namespace)
main.py:373
↓ 1 callersMethodprepare_matmul_op
(self, input: torch.Tensor)
inference_lib/src/aqlm/inference.py:77
↓ 1 callersFunctionprepare_training_dataset
(args: argparse.Namespace, tokenizer: transformers.PreTrainedTokenizer)
finetune.py:469
↓ 1 callersMethodquantize
create a QuantizedLinear with specified args based on the collected hessian (XTX) data
aq_engine.py:45
↓ 1 callersFunctionquantize_aq
(model: PreTrainedModel, data: Sequence, val_data: Optional[Sequence], args: Namespace)
main.py:165
↓ 1 callersFunctionquantize_model
main entry point to functions for model quantization
main.py:37
↓ 1 callersFunctionrgetattr
(obj, attr, *args)
convert_legacy_model_format.py:63
↓ 1 callersFunctionrsetattr
(obj, attr, val)
convert_legacy_model_format.py:58
↓ 1 callersFunctionsave_model
Save model for either P- or PV-Tuning using the appropriate saver
finetune.py:870
↓ 1 callersFunctionsave_p_model
Save consolidated model state dict from P-only tuning, can be exported via convert_legacy_model_format.py
finetune.py:920
↓ 1 callersFunctionsave_pv_model
Save consolidated model from PV tuning, can be exported later via convert_legacy_model_format.py
finetune.py:879
↓ 1 callersFunctionsave_quantized_model
Save dequantized model state in the same format as returned by AQLM calibration (main.py)
src/modelutils.py:279
↓ 1 callersFunctionset_seed
(seed: Optional[int])
src/datautils.py:16
↓ 1 callersFunctionsplit_long_texts
Split examples that exceed split_max_length into multiple sub-examples
src/datautils.py:255
↓ 1 callersFunctionsplit_quantized_weights_between_ranks
Split all quantized weights between ranks in a distributed setup; uses greedy knapsack heuristic. Note that unlike FSDP, this heuristic will
src/pv_utils.py:139
↓ 1 callersFunctionsuspend_nn_inits
()
src/modelutils.py:21
↓ 1 callersFunctiontrigger_fsdp_lazy_init_
Trigger FullyShardedDataParallel lazy init in the correct order to allow both training and eval
finetune.py:684
↓ 1 callersMethodunwrap_codes_
Undo the effect of wrap_codes_for_fsdp_; modifies state dict in-place
src/aq.py:137
↓ 1 callersFunctionupdate_config
(config_dict: dict, aqlm_metadata: dict[str, int], linear_weights_not_to_quantize: list[str])
convert_to_hf.py:90
↓ 1 callersFunctionusing_tf32
(enabled: bool)
src/utils.py:95
↓ 1 callersFunctionverify_dequantized_model
Test that the dequantized model parameters still match the dequantized_to_master dictionary
src/pv_utils.py:104
↓ 1 callersMethodwrap_codes_for_fsdp_
Make this module compatible with FullyShardedDataParallel; modifies state dict in-place
src/aq.py:132
FunctionPYBIND11_MODULE
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:686
Method__init__
(self, layer: nn.Linear, accumulator_dtype: torch.dtype = torch.float64)
aq_engine.py:19
Method__init__
(self, layer: nn.Module, aq_handler: AQEngine)
main.py:477
Method__init__
( self, in_features: int, out_features: int, in_group_size: int, out_g
inference_lib/src/aqlm/inference.py:12
Method__init__
(self, codes: torch.tensor, storage_dtype: torch.dtype = torch.float64)
src/utils.py:161
Method__init__
( self, params: Iterable[Union[torch.Tensor, dict]], lr: float = 1e-3, betas:
src/configurable_adam.py:28
Method__init__
( self, *, reference_weight: torch.Tensor, in_group_size: int, out_gro
src/aq.py:40
Method__init__
( self, named_dequantized_params: Dict[str, nn.Parameter], named_quantized_params: Dic
src/pv_optimizer.py:66
Function_aqlm_gemv_simple
( input_vec_ptr, output_vec_ptr, codes_ptr, codebooks_ptr, scales_ptr, bias_ptr, i
inference_lib/src/aqlm/inference_kernels/triton_kernel.py:31
Function_backward_pass_kernel
( grad_output: torch.Tensor, # [..., in_features] codes: torch.IntTensor, # [num_o
inference_lib/src/aqlm/inference_kernels/kernel_selector.py:148
Function_compute_kl_div_from_flat_hidden_states
( flat_student_hidden_states: torch.Tensor, student_lm_head: nn.Module, flat_teacher_hidden_states
src/memory_efficient_loss.py:61
Function_extract_into_tensor
(tensor_list: List[torch.Tensor], indices: Iterable[int], device=None, dtype=None)
src/utils.py:150
Function_find_optimal_codebooks
( reference: torch.Tensor, codebooks: torch.Tensor, codes: torch.Tensor, )
src/beam_search_l2.py:294
Function_getattr
(obj, attr)
convert_legacy_model_format.py:64
Function_handle_non_serializable
(o)
lmeval.py:22
Function_modified_auto_wrap_policy
(module, recurse, **kwargs)
finetune.py:673
Method_replace_and_beam_search
Utility for parallelism: replace the specified parameters of self.quantized_weight, then run beam search
aq_engine.py:156
Method_replace_and_compute_mse
Utility for parallelism: replace the specified parameters of self.quantized_weight, then compute MSE
aq_engine.py:133
Functionaccumulate_sizes
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:229
Functionadd_inference_code
(model_type: str, save_path: os.PathLike)
convert_to_hf.py:103
Functionbeam_search_optimal_codes
Update codes using beam search to minimize L2 error in code values (regardless of activations) :param reference_weight: a target for L2 error
src/beam_search_l2.py:14
Functionbeam_search_optimal_codes
:param XTX: pairwise products of input features matmul(X.transpose(), X), shape: [in_features, in_features] :note: if XTX is divided by datas
src/beam_search_xtx.py:13
Functioncode1x16_dequant
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:184
Functioncode1x16_matmat
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:148
Functioncode1x16_matmat_dequant
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:249
Functioncode1x16_matmat_dequant_meta
(input, codes, codebooks, scales, bias)
inference_lib/src/aqlm/inference_kernels/cuda_kernel.py:34
Functioncode1x16_matmat_dequant_transposed
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:303
Functioncode1x16_matmat_dequant_transposed_meta
(input, codes, codebooks, scales, bias)
inference_lib/src/aqlm/inference_kernels/cuda_kernel.py:49
Functioncode1x16_matmat_meta
(input, codes, codebooks, scales, bias)
inference_lib/src/aqlm/inference_kernels/cuda_kernel.py:21
Functioncode1x8_dequant
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:588
Functioncode1x8_matmat
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:552
Functioncode1x8_matmat_dequant
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:615
Functioncode1x8_matmat_dequant_meta
(input, codes, codebooks, scales, bias)
inference_lib/src/aqlm/inference_kernels/cuda_kernel.py:116
Functioncode1x8_matmat_dequant_transposed
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:651
Functioncode1x8_matmat_dequant_transposed_meta
(input, codes, codebooks, scales, bias)
inference_lib/src/aqlm/inference_kernels/cuda_kernel.py:129
Functioncode1x8_matmat_meta
(input, codes, codebooks, scales, bias)
inference_lib/src/aqlm/inference_kernels/cuda_kernel.py:103
Functioncode2x8_dequant
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:423
Functioncode2x8_matmat
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:387
Functioncode2x8_matmat_dequant
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:450
Functioncode2x8_matmat_dequant_meta
(input, codes, codebooks, scales, bias)
inference_lib/src/aqlm/inference_kernels/cuda_kernel.py:76
Functioncode2x8_matmat_dequant_transposed
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:486
← previousnext →101–200 of 225, ranked by callers