MCPcopy Create free account

hub / github.com/VITA-Group/WeLore / functions

Functions139 in github.com/VITA-Group/WeLore

↓ 7 callersMethod__init__
( self, hidden_size: int, intermediate_size: int, hidden_act: str, )
peft_pretraining/modeling_llama.py:145
↓ 7 callersMethodget_orthogonal_matrix
(self, weights, rank, type)
galore_torch/galore_projector.py:75
↓ 6 callersFunctionfind_layers
Recursively find the layers of a certain type in a module. Args: module (nn.Module): PyTorch module. layers (list): List of
lib/rank_utils.py:17
↓ 5 callersFunctioneval_ppl
(model, tokenizer, device=torch.device("cuda:0"), dataset="wikitext2")
lib/eval.py:19
↓ 4 callersMethodproject
(self, full_rank_grad, iter)
galore_torch/galore_projector.py:17
↓ 4 callersMethodproject_back
(self, low_rank_grad)
galore_torch/galore_projector.py:51
↓ 3 callersFunctionadaptive_rank_pruning
(args, rank_thresold, layers_singular_value, logger)
utils.py:121
↓ 3 callersFunctiondo_rank_reduction
(args, model, tokenizer, rank_pruning, min_ratio, logger = None, load_only = False)
lib/rank_reduction.py:37
↓ 3 callersFunctionget_c4
(nsamples, seed, seqlen, tokenizer)
lib/data_utils.py:18
↓ 3 callersFunctionget_wikitext2
(nsamples, seed, seqlen, tokenizer)
lib/data_utils.py:46
↓ 2 callersMethod_format_batch
(self, batch)
peft_pretraining/dataloader.py:44
↓ 2 callersMethod_rms
(tensor)
galore_torch/adafactor.py:149
↓ 2 callersFunctiondataset_generater
(args, eval=False)
lib/downstream_utils.py:282
↓ 2 callersFunctiondo_low_rank
(weight, desired_rank, debug=False)
lib/rank_reduction.py:90
↓ 2 callersFunctiondo_low_rank
(weight, desired_rank, debug=False)
lib/rank_utils.py:132
↓ 2 callersFunctionformat_example
(df, idx, include_answer=True)
utils.py:42
↓ 2 callersFunctiongen_prompt
(train_df, subject, k=-1)
utils.py:53
↓ 2 callersMethodget_input_embeddings
(self)
peft_pretraining/modeling_llama.py:444
↓ 2 callersFunctionmatch_response
(args, pred, correct)
lib/downstream_utils.py:410
↓ 2 callersFunctionrank_analysis_weight
(args, model, tokenizer, device)
lib/rank_utils.py:80
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
peft_pretraining/modeling_llama.py:126
↓ 2 callersMethodstep
Performs a single optimization step. Arguments: closure (`Callable`, *optional*): A closure that reevaluates the model a
galore_torch/adamw.py:67
↓ 1 callersMethod__init__
(self, desired_rank, weight, require_grad=True)
lib/LowRankLayer.py:6
↓ 1 callersMethod_approx_sq_grad
(exp_avg_sq_row, exp_avg_sq_col)
galore_torch/adafactor.py:153
↓ 1 callersFunction_expand_mask
Expands attention_mask from `[bsz, seq_len]` to `[bsz, 1, tgt_seq_len, src_seq_len]`.
peft_pretraining/modeling_llama.py:60
↓ 1 callersMethod_get_lr
(param_group, param_state)
galore_torch/adafactor.py:132
↓ 1 callersMethod_get_options
(param_group, param_shape)
galore_torch/adafactor.py:143
↓ 1 callersFunction_make_causal_mask
Make causal mask used for bi-directional self-attention.
peft_pretraining/modeling_llama.py:42
↓ 1 callersMethod_prepare_decoder_attention_mask
(self, attention_mask, input_shape, inputs_embeds, past_key_values_length)
peft_pretraining/modeling_llama.py:451
↓ 1 callersFunctionapply_rotary_pos_emb
(q, k, cos, sin, position_ids)
peft_pretraining/modeling_llama.py:133
↓ 1 callersFunctionaugument_args
(args)
lib/downstream_utils.py:79
↓ 1 callersFunctioncollate_fn
(batch_list)
peft_pretraining/training_utils.py:194
↓ 1 callersFunctiondata_reader
(args, eval=False)
lib/downstream_utils.py:89
↓ 1 callersFunctioneval_ppl_dataset
(model, testenc, bs=1, device=None)
lib/eval.py:40
↓ 1 callersFunctionfix_seed
(seed)
lib/data_utils.py:70
↓ 1 callersFunctionformat_subject
(subject)
utils.py:13
↓ 1 callersFunctionget_cosine_schedule_with_multiple_warmups
( optimizer, *, num_training_steps, first_warmup_steps, restart_warmup_steps, restart_
peft_pretraining/training_utils.py:74
↓ 1 callersFunctionget_cyclical_cosine_schedule_with_min_lr
(optimizer, num_warmup_steps, num_training_steps, cycle_length, min_lr_ratio=0.1, last_epoch=-1)
peft_pretraining/training_utils.py:56
↓ 1 callersFunctionget_llm
(model_name, cache_dir="llm_weights")
welore_rank_reduction.py:25
↓ 1 callersFunctionget_loaders
(name, nsamples=128, seed=0, seqlen=2048, tokenizer=None)
lib/eval.py:11
↓ 1 callersFunctionload_model
(args, rank_k, load_tuned = True)
welore_downstream_finetune.py:84
↓ 1 callersFunctionmain
()
welore_rank_reduction.py:57
↓ 1 callersFunctionmain
(args)
welore_continual_finetune.py:155
↓ 1 callersFunctionmain
(args)
welore_downstream_finetune.py:128
↓ 1 callersFunctionparse_args
(args)
welore_continual_finetune.py:56
↓ 1 callersFunctionparse_args
(args)
lib/downstream_arguments.py:3
↓ 1 callersFunctionparse_predicted
(args, prompt, outputs)
lib/downstream_utils.py:391
↓ 1 callersFunctionpreprocess_dataset
Format & tokenize it so it is ready for training :param tokenizer (AutoTokenizer): Model Tokenizer :param max_length (int): Maximum number of
lib/downstream_utils.py:364
↓ 1 callersFunctionpseudo_quantize_tensor
(w, n_bit=8, zero_point=True, q_group_size=-1, inplace=False, get_scale_zp=False)
galore_torch/q_galore_adamw8bit.py:9
↓ 1 callersFunctionset_dataset_path
(args)
lib/downstream_utils.py:30
↓ 1 callersFunctionsetup_data_loader
(args, eval = False)
lib/downstream_utils.py:251
↓ 1 callersFunctionshuffleDict
(d)
lib/data_utils.py:59
↓ 1 callersMethodstop
(self)
welore_downstream_finetune.py:61
Method__getitem__
(self, index)
lib/downstream_utils.py:24
Method__init__
(self, delay)
welore_downstream_finetune.py:50
Method__init__
(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=1e-2, amsgrad=False, optim_bits=32,args=Non
galore_torch/q_galore_adamw8bit.py:54
Method__init__
( self, params: Iterable[nn.parameter.Parameter], lr: float = 1e-3, betas: Tup
galore_torch/adamw.py:37
Method__init__
( self, params, lr=None, eps=(1e-30, 1e-3), clip_threshold=1.0,
galore_torch/adafactor.py:99
Method__init__
(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=1e-2, amsgrad=False, optim_bits=32,args=Non
galore_torch/adamw8bit.py:9
Method__init__
(self, rank, verbose=False, update_proj_gap=200, scale=1.0, proj_type='std')
galore_torch/galore_projector.py:8
Method__init__
(self, input_ids)
lib/data_utils.py:15
Method__init__
(self, module)
lib/rank_utils.py:56
Method__init__
(self, args, eval=False)
lib/downstream_utils.py:15
Method__init__
(self, desired_rank, weight, require_grad=True)
lib/LowRankLayer.py:36
Method__init__
(self, data, tokenizer, batch_size, max_length)
peft_pretraining/dataloader.py:8
Method__init__
LlamaRMSNorm is equivalent to T5LayerNorm
peft_pretraining/modeling_llama.py:75
Method__init__
(self, dim, max_position_embeddings=2048, base=10000, device=None)
peft_pretraining/modeling_llama.py:95
Method__init__
(self, config: LlamaConfig)
peft_pretraining/modeling_llama.py:164
Method__init__
(self, config: LlamaConfig)
peft_pretraining/modeling_llama.py:244
Method__init__
(self, config: LlamaConfig)
peft_pretraining/modeling_llama.py:431
Method__init__
(self, config)
peft_pretraining/modeling_llama.py:604
Method__init__
(self, config)
peft_pretraining/modeling_llama.py:778
Method__iter__
(self)
peft_pretraining/dataloader.py:15
Method__len__
(self)
lib/downstream_utils.py:21
Function_get_cosine_schedule_with_multiple_warmups_lambda
Args: adjust_step: useful when continuing training from a warmed up checkpoint, it allows to sync the resets by reducing the
peft_pretraining/training_utils.py:146
Function_get_cyclical_cosine_schedule_with_min_lr_lambda
(current_step, *, num_warmup_steps, cycle_length, min_lr_ratio)
peft_pretraining/training_utils.py:128
Method_init_weights
(self, module)
peft_pretraining/modeling_llama.py:339
Method_reorder_cache
(past_key_values, beam_idx)
peft_pretraining/modeling_llama.py:753
Method_set_gradient_checkpointing
(self, module, value=False)
peft_pretraining/modeling_llama.py:350
Method_shape
(self, tensor: torch.Tensor, seq_len: int, bsz: int)
peft_pretraining/modeling_llama.py:183
Functionbatch_fn
(dataset, batch_size)
peft_pretraining/training_utils.py:202
Functioncheck_args_torchrun_main
(args)
peft_pretraining/args_utils.py:7
Methodcreate_custom_forward
(module)
peft_pretraining/modeling_llama.py:554
Functioncreate_prompt_formats
Format various fields of the sample ('instruction', 'context', 'response') Then concatenate them using two newline characters :param sam
lib/downstream_utils.py:306
Functioncreate_prompt_formats_eval
Format various fields of the sample ('instruction', 'context', 'response') Then concatenate them using two newline characters :param sam
lib/downstream_utils.py:331
Methodcustom_forward
(*inputs)
peft_pretraining/modeling_llama.py:555
Functiondo_rank_reduction_merge
(args, model, tokenizer, rank_pruning, min_ratio, logger = None)
lib/rank_reduction.py:100
Functioneval
(args, subject, model, tokenizer, dev_df, test_df, f)
utils.py:65
Functionevaluate_model
(model, preprocess_batched, pad_idx, global_rank, world_size, device, batch_size)
welore_continual_finetune.py:114
Functionfind_layers
Recursively find the layers of a certain type in a module. Args: module (nn.Module): PyTorch module. layers (list): List of
lib/rank_reduction.py:16
Functionfix_seed
(seed)
utils.py:31
Methodforward
(self, inp, **kwargs)
lib/rank_utils.py:59
Methodforward
(self, x)
lib/LowRankLayer.py:29
Methodforward
(self, x)
lib/LowRankLayer.py:51
Methodforward
(self, hidden_states)
peft_pretraining/modeling_llama.py:83
Methodforward
(self, x, seq_len=None)
peft_pretraining/modeling_llama.py:109
Methodforward
(self, x)
peft_pretraining/modeling_llama.py:157
Methodforward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
peft_pretraining/modeling_llama.py:186
Methodforward
Args: hidden_states (`torch.FloatTensor`): input to the layer of shape `(batch, seq_len, embed_dim)` attention_mask (
peft_pretraining/modeling_llama.py:256
Methodforward
( self, input_ids: torch.LongTensor = None, attention_mask: Optional[torch.Tensor] = N
peft_pretraining/modeling_llama.py:475
next →1–100 of 139, ranked by callers