Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Vahe1994/AQLM
/ functions
Functions
225 in github.com/Vahe1994/AQLM
⨍
Functions
225
◇
Types & classes
13
↳
Endpoints
1
↓ 1 callers
Function
get_c4_new
(nsamples, seqlen, tokenizer, eval_mode=False)
src/datautils.py:143
↓ 1 callers
Function
get_converted_state_dict
(config, nbits: int, in_path: os.PathLike)
convert_to_hf.py:50
↓ 1 callers
Function
get_int_dtype
(nbits: int)
convert_to_hf.py:16
↓ 1 callers
Function
get_layers_prefix
(config)
convert_to_hf.py:42
↓ 1 callers
Function
get_lm_logits
(inps_, model)
src/modelutils.py:117
↓ 1 callers
Function
get_metadata
(in_path: os.PathLike)
convert_to_hf.py:80
↓ 1 callers
Function
get_num_layers
(config)
convert_to_hf.py:34
↓ 1 callers
Function
get_original_named_parameters_from_fsdp_module
(dequantized_model)
src/pv_utils.py:116
↓ 1 callers
Function
get_ptb
(nsamples, seqlen, tokenizer, eval_mode=False)
src/datautils.py:60
↓ 1 callers
Function
get_ptb_new
(nsamples, seqlen, tokenizer, eval_mode=False)
src/datautils.py:126
↓ 1 callers
Function
get_red_pajama
(nsamples, seqlen, tokenizer, eval_mode=False)
src/datautils.py:22
↓ 1 callers
Function
get_sequential_groups
(model)
src/modelutils.py:159
↓ 1 callers
Function
get_wikitext2
(nsamples, seqlen, tokenizer, eval_mode=False)
src/datautils.py:43
↓ 1 callers
Function
init_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 callers
Function
init_aq_engines_parallel
Parallel version of init_aq_engines; works on lists of input/output tensors
main.py:487
↓ 1 callers
Function
init_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 callers
Function
is_model_for_causal_lm
(model: nn.Module)
src/modelutils.py:89
↓ 1 callers
Method
iterate_groups_with_prefetch
Iterate parameters and optimizer states; skip parameters that do not require grad
src/configurable_adam.py:164
↓ 1 callers
Function
load_dequantized_model
Load quantized model by dequantizing it
src/modelutils.py:235
↓ 1 callers
Function
load_linear_layers
(layer, quant_layer, model)
src/modelutils.py:194
↓ 1 callers
Function
load_model
(model_name, device="cuda")
benchmark/generate_benchmark.py:59
↓ 1 callers
Function
load_quantized_model
Load quantized model
src/modelutils.py:251
↓ 1 callers
Function
load_quantized_model_from_fdsp_checkpoint
(base_model_name: str, fsdp_checkpoint_path: str, **kwargs)
convert_legacy_model_format.py:70
↓ 1 callers
Function
load_shared_model
(model_name, device="cuda")
benchmark/generate_benchmark.py:67
↓ 1 callers
Function
load_student_model
load student model for fine-tuning. If dequantize is set, dequantize all quantized weights to accumulate full grads
finetune.py:553
↓ 1 callers
Function
load_teacher_model
Load unquantized model with frozen parameters
finetune.py:527
↓ 1 callers
Function
load_training_state
Load model, optimizer state dict and metadata saved via save_training_state; update parameters in-place
finetune.py:836
↓ 1 callers
Function
main
()
finetune.py:991
↓ 1 callers
Function
main
()
main.py:583
↓ 1 callers
Function
main
()
convert_legacy_model_format.py:102
↓ 1 callers
Function
master_rank_first
(local: bool, master_rank: int = 0)
src/utils.py:203
↓ 1 callers
Function
maybe_checkpoint
Execute function normally or with checkpointing, depending on checkpoint_enabled. Forward **checkpoint_kwargs
src/memory_efficient_loss.py:72
↓ 1 callers
Function
maybe_get_0th_element
Return first element if input is Sequence, otherwise return input
src/utils.py:141
↓ 1 callers
Function
next_power_of_2
(x)
inference_lib/src/aqlm/inference_kernels/triton_kernel.py:128
↓ 1 callers
Function
one_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 callers
Function
pack_int_data
(data: torch.IntTensor, nbits: int)
convert_to_hf.py:29
↓ 1 callers
Function
parse_eval_args
()
lmeval.py:31
↓ 1 callers
Function
perplexity_eval
(model: PreTrainedModel, testenc: torch.LongTensor, args: Namespace)
main.py:373
↓ 1 callers
Method
prepare_matmul_op
(self, input: torch.Tensor)
inference_lib/src/aqlm/inference.py:77
↓ 1 callers
Function
prepare_training_dataset
(args: argparse.Namespace, tokenizer: transformers.PreTrainedTokenizer)
finetune.py:469
↓ 1 callers
Method
quantize
create a QuantizedLinear with specified args based on the collected hessian (XTX) data
aq_engine.py:45
↓ 1 callers
Function
quantize_aq
(model: PreTrainedModel, data: Sequence, val_data: Optional[Sequence], args: Namespace)
main.py:165
↓ 1 callers
Function
quantize_model
main entry point to functions for model quantization
main.py:37
↓ 1 callers
Function
rgetattr
(obj, attr, *args)
convert_legacy_model_format.py:63
↓ 1 callers
Function
rsetattr
(obj, attr, val)
convert_legacy_model_format.py:58
↓ 1 callers
Function
save_model
Save model for either P- or PV-Tuning using the appropriate saver
finetune.py:870
↓ 1 callers
Function
save_p_model
Save consolidated model state dict from P-only tuning, can be exported via convert_legacy_model_format.py
finetune.py:920
↓ 1 callers
Function
save_pv_model
Save consolidated model from PV tuning, can be exported later via convert_legacy_model_format.py
finetune.py:879
↓ 1 callers
Function
save_quantized_model
Save dequantized model state in the same format as returned by AQLM calibration (main.py)
src/modelutils.py:279
↓ 1 callers
Function
set_seed
(seed: Optional[int])
src/datautils.py:16
↓ 1 callers
Function
split_long_texts
Split examples that exceed split_max_length into multiple sub-examples
src/datautils.py:255
↓ 1 callers
Function
split_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 callers
Function
suspend_nn_inits
()
src/modelutils.py:21
↓ 1 callers
Function
trigger_fsdp_lazy_init_
Trigger FullyShardedDataParallel lazy init in the correct order to allow both training and eval
finetune.py:684
↓ 1 callers
Method
unwrap_codes_
Undo the effect of wrap_codes_for_fsdp_; modifies state dict in-place
src/aq.py:137
↓ 1 callers
Function
update_config
(config_dict: dict, aqlm_metadata: dict[str, int], linear_weights_not_to_quantize: list[str])
convert_to_hf.py:90
↓ 1 callers
Function
using_tf32
(enabled: bool)
src/utils.py:95
↓ 1 callers
Function
verify_dequantized_model
Test that the dequantized model parameters still match the dequantized_to_master dictionary
src/pv_utils.py:104
↓ 1 callers
Method
wrap_codes_for_fsdp_
Make this module compatible with FullyShardedDataParallel; modifies state dict in-place
src/aq.py:132
Function
PYBIND11_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
Function
accumulate_sizes
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:229
Function
add_inference_code
(model_type: str, save_path: os.PathLike)
convert_to_hf.py:103
Function
beam_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
Function
beam_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
Function
code1x16_dequant
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:184
Function
code1x16_matmat
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:148
Function
code1x16_matmat_dequant
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:249
Function
code1x16_matmat_dequant_meta
(input, codes, codebooks, scales, bias)
inference_lib/src/aqlm/inference_kernels/cuda_kernel.py:34
Function
code1x16_matmat_dequant_transposed
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:303
Function
code1x16_matmat_dequant_transposed_meta
(input, codes, codebooks, scales, bias)
inference_lib/src/aqlm/inference_kernels/cuda_kernel.py:49
Function
code1x16_matmat_meta
(input, codes, codebooks, scales, bias)
inference_lib/src/aqlm/inference_kernels/cuda_kernel.py:21
Function
code1x8_dequant
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:588
Function
code1x8_matmat
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:552
Function
code1x8_matmat_dequant
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:615
Function
code1x8_matmat_dequant_meta
(input, codes, codebooks, scales, bias)
inference_lib/src/aqlm/inference_kernels/cuda_kernel.py:116
Function
code1x8_matmat_dequant_transposed
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:651
Function
code1x8_matmat_dequant_transposed_meta
(input, codes, codebooks, scales, bias)
inference_lib/src/aqlm/inference_kernels/cuda_kernel.py:129
Function
code1x8_matmat_meta
(input, codes, codebooks, scales, bias)
inference_lib/src/aqlm/inference_kernels/cuda_kernel.py:103
Function
code2x8_dequant
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:423
Function
code2x8_matmat
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:387
Function
code2x8_matmat_dequant
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:450
Function
code2x8_matmat_dequant_meta
(input, codes, codebooks, scales, bias)
inference_lib/src/aqlm/inference_kernels/cuda_kernel.py:76
Function
code2x8_matmat_dequant_transposed
inference_lib/src/aqlm/inference_kernels/cuda_kernel.cpp:486
← previous
next →
101–200 of 225, ranked by callers