MCPcopy Create free account

hub / github.com/ZinYY/TreeLoRA / functions

Functions425 in github.com/ZinYY/TreeLoRA

↓ 61 callersMethodeval
(self)
utils/module/lora.py:53
↓ 55 callersFunctionprint_rank_0
(msg, rank=0)
utils/utils.py:15
↓ 27 callersMethodupdate
(self, adapter_name)
utils/my_peft/utils/other.py:103
↓ 25 callersMethodfrom_pretrained
r""" Instantiate a [`LoraModel`] from a pretrained Lora configuration and weights. Args: model ([`~transformers.PreTraine
utils/my_peft/peft_model.py:145
↓ 21 callersMethodupdate
(self, num)
utils/utils.py:37
↓ 19 callersMethodsave_pretrained
r""" This function saves the adapter model and the adapter configuration files to a directory, so that it can be reloaded using the [`
utils/my_peft/peft_model.py:106
↓ 16 callersMethodstep
(self)
utils/kd_lora_tree.py:169
↓ 15 callersMethodbackward
(ctx, do)
utils/flash_attention/triton_flash_att.py:818
↓ 15 callersFunctionto_device
(batch, device)
utils/utils.py:20
↓ 15 callersFunctiontranspose
(weight, fan_in_fan_out)
utils/my_peft/utils/other.py:180
↓ 14 callersMethodtrain
(self, mode=True)
utils/module/lora.py:58
↓ 12 callersFunctioncaculate_accuracy
(results, data)
metrics.py:76
↓ 12 callersMethodtik
(self)
utils/model/model_utils.py:29
↓ 12 callersMethodtok
(self, text)
utils/model/model_utils.py:32
↓ 11 callersMethodget_prompt
Returns the virtual prompts to use for Peft. Only applicable when `peft_config.peft_type != PeftType.LORA`.
utils/my_peft/peft_model.py:230
↓ 10 callersMethodgenerate
(self, **kwargs)
utils/my_peft/peft_model.py:726
↓ 9 callersFunctionget_peft_model
Returns a Peft model object from a model and a config. Args: model ([`transformers.PreTrainedModel`]): Model to be wrapped.
utils/my_peft/mapping.py:104
↓ 7 callersFunction_get_submodules
(model, key)
utils/my_peft/utils/other.py:112
↓ 7 callersFunctioncreate_prompt_dataset
Creates the prompt dataset
utils/data/data_utils.py:282
↓ 6 callersFunctioncaculate_bleu
(results, data, gram)
metrics.py:36
↓ 6 callersFunctionis_bnb_available
()
utils/my_peft/tuners/adalora.py:27
↓ 6 callersFunctionload_hf_tokenizer
(model_name_or_path, fast_tokenizer=True)
utils/utils.py:45
↓ 6 callersMethodprint_time
(self, rank=0)
utils/model/model_utils.py:43
↓ 5 callersMethod__init__
( self, adapter_name: str, in_features: int, out_features: int, r: int
utils/my_peft/tuners/lora.py:535
↓ 5 callersFunctioncreate_hf_model
(model_class, model_name_or_path, tokenizer, ds_co
utils/model/model_utils.py:59
↓ 5 callersFunctioneval
(predicted_sequences, ground_truths)
evaluations/eval_QQP.py:4
↓ 5 callersFunctionget_output_dir
(args, step_num)
train.py:116
↓ 5 callersFunctionset_random_seed
(seed)
utils/utils.py:87
↓ 4 callersMethod__init__
(self, model, peft_config: PeftConfig, adapter_name="default")
utils/my_peft/peft_model.py:88
↓ 4 callersMethod__init__
( self, adapter_name: str, in_features: int, out_features: int, r: int
utils/my_peft/tuners/adalora.py:367
↓ 4 callersFunction_freeze_adapter
(model, adapter_name)
utils/my_peft/utils/other.py:119
↓ 4 callersMethod_remove_adapted_attentions
Remove AdaptedAttention modules from the model and store them in the cache.
utils/my_peft/tuners/adaption_prompt.py:246
↓ 4 callersMethodforward
(self, x: torch.Tensor)
utils/my_peft/tuners/lora.py:594
↓ 4 callersMethodfprompt
Prompting function that combines hidden states with prompts
model/Dynamic_network/DualPrompt.py:65
↓ 4 callersMethodreset_parameters
(self)
utils/module/lora.py:62
↓ 4 callersMethodupdate_layer
(self, adapter_name, r, lora_alpha, lora_dropout, init_lora_weights)
utils/my_peft/tuners/adalora.py:331
↓ 3 callersMethod_element_score
(self, n)
utils/my_peft/tuners/adalora.py:592
↓ 3 callersFunction_flash_attn_backward
(do, q, k, v, o, lse, dq, dk, dv, bias=None, causal=False, softmax_scale=None)
utils/flash_attention/triton_flash_att.py:644
↓ 3 callersFunction_flash_attn_forward
(q, k, v, bias=None, causal=False, softmax_scale=None)
utils/flash_attention/triton_flash_att.py:584
↓ 3 callersMethod_replace_module
(self, parent_module, child_name, new_module, old_module)
utils/my_peft/tuners/lora.py:276
↓ 3 callersFunction_set_trainable
(model, adapter_name)
utils/my_peft/utils/other.py:125
↓ 3 callersFunctioncaculate_rouge
(results, data)
metrics.py:60
↓ 3 callersFunctionget_model_size
(args, step_num)
train.py:106
↓ 3 callersFunctionget_prompt_dataset
(current_dataset, raw_dataset, add_sys_prefix=False, sample_ratio=None)
utils/data/data_utils.py:241
↓ 3 callersFunctionget_zero_stage
(args, step_num)
train.py:112
↓ 3 callersFunctionmark_only_lora_as_trainable
(model: nn.Module, bias: str = "none")
utils/my_peft/tuners/lora.py:422
↓ 3 callersFunctionprediction
(model, infer_dataloader, task)
inference/ICL.py:255
↓ 3 callersFunctionreplace_bloom_attn_with_flash_attn
()
utils/flash_attention/bloom_flash_att.py:98
↓ 3 callersFunctionreplace_llama_attn_with_flash_attn
()
utils/flash_attention/llama_flash_att.py:115
↓ 3 callersMethodsample
(self, sample_size)
model/Replay/MbPAplusplus.py:98
↓ 3 callersMethodto_dict
(self)
utils/my_peft/utils/config.py:60
↓ 3 callersMethodtokenize
(self, sentence, cutoff_len, add_bos_token=True, add_eos_token=True)
utils/data/data_collator.py:31
↓ 3 callersMethodunmerge
(self)
utils/my_peft/tuners/lora.py:578
↓ 3 callersMethodupdate_layer
(self, adapter_name, r, lora_alpha, lora_dropout, init_lora_weights, r_sum)
utils/my_peft/tuners/lora.py:465
↓ 2 callersMethod__init__
(self, output_path, seed, local_rank, dataset_name)
utils/data/raw_datasets.py:15
↓ 2 callersFunction_bwd_kernel_one_col_block
( start_n, Q, K, V, Bias, DO, DQ, DK, DV, LSE, D, softmax_scale, stride_qm, stride_kn,
utils/flash_attention/triton_flash_att.py:282
↓ 2 callersFunction_bwd_store_dk_dv
( dk_ptrs, dv_ptrs, dk, dv, offs_n, offs_d, seqlen_k, headdim, EVEN_M: tl.constexpr, EVEN_N: tl.conste
utils/flash_attention/triton_flash_att.py:259
↓ 2 callersMethod_find_and_replace
(self, adapter_name)
utils/my_peft/tuners/lora.py:172
↓ 2 callersMethod_set_adapted_attentions
Replace LlamaAttention modules with cached AdaptedAttention modules.
utils/my_peft/tuners/adaption_prompt.py:238
↓ 2 callersMethod_set_adapter_layers
(self, enabled=True)
utils/my_peft/tuners/lora.py:308
↓ 2 callersFunction_z3_params_to_fetch
(param_list)
utils/utils.py:148
↓ 2 callersMethodadd_adapter
(self, adapter_name, peft_config)
utils/my_peft/peft_model.py:322
↓ 2 callersFunctionconvert_DualPrompt_model
(model, args)
model/Dynamic_network/DualPrompt.py:22
↓ 2 callersMethodforward
(self, x: torch.Tensor)
utils/my_peft/tuners/adalora.py:427
↓ 2 callersFunctionget_all_reduce_mean
(tensor)
utils/utils.py:96
↓ 2 callersMethodget_base_model
Returns the base model.
utils/my_peft/peft_model.py:316
↓ 2 callersFunctionget_dataset
(dataset)
training/replay.py:252
↓ 2 callersFunctionget_optimizer_grouped_parameters
( model, weight_decay, lora_lr=5e-4, no_decay_name_list=["bias", "LayerNorm.weight"], lora
utils/utils.py:102
↓ 2 callersFunctionget_script
(args, step_num)
train.py:124
↓ 2 callersFunctionget_threshold
Calculate the threshold for parameter importance based on the target percentage. Args: importance_scores: List of importance scores
utils/TaSL/consolidation.py:10
↓ 2 callersFunctionget_train_ds_config
(offload, stage=2, enable_hybrid_engine=False,
utils/ds_utils.py:9
↓ 2 callersFunctioninit_new_prompt
(prompt_len, embedding_dim)
model/Dynamic_network/DualPrompt.py:23
↓ 2 callersMethodmerge
(self)
utils/my_peft/tuners/lora.py:562
↓ 2 callersFunctionpostprocess
(code)
evaluations/eval_Py150.py:6
↓ 2 callersFunctionread_importance_scores
Read importance scores from a CSV file Args: score_file: Path to the CSV file with importance scores Returns: importanc
utils/TaSL/consolidation.py:24
↓ 2 callersMethodreset_ipt
(self)
utils/my_peft/tuners/adalora.py:540
↓ 2 callersMethodreset_lora_parameters
(self, adapter_name)
utils/my_peft/tuners/lora.py:509
↓ 2 callersFunctionresolve
(dataset: list)
evaluations/eval_PapyrusF.py:6
↓ 2 callersFunctionresolve
(dataset: list)
evaluations/eval_ScienceQA.py:6
↓ 2 callersFunctionsave_hf_format
(model, tokenizer, args, sub_folder="")
utils/utils.py:70
↓ 2 callersFunctionsave_inference_results
(evaluation_result: dict, sources_sequences: list, predicted_sequences: list,
inference/infer_single.py:192
↓ 2 callersFunctionsave_json
(data, file_path)
assist_scripts/extract_down_sample_datasets.py:66
↓ 2 callersMethodsave_model
(self, i_task)
model/Regular/OGD.py:181
↓ 2 callersFunctionsave_zero_three_model
(model_ema, global_rank, save_dir, zero_stage=0, sub_folder="")
utils/utils.py:171
↓ 2 callersMethodset_additional_trainable_modules
(self, peft_config, adapter_name)
utils/my_peft/peft_model.py:336
↓ 2 callersFunctiontokenize
(text)
metrics.py:14
↓ 2 callersMethodtrain_step
(self, batch)
model/Regular/LwF.py:17
↓ 2 callersFunctionverify_model
(args, step_num)
train.py:140
↓ 1 callersMethodKD_loss
(self, new_logits, prev_logits, T)
model/Regular/LwF.py:25
↓ 1 callersMethod__init__
Initialize object. Args: model_type: The transformer model type. This is used to retrieve the right method to
utils/my_peft/tuners/adaption_prompt.py:275
↓ 1 callersMethod__init__
(self, buffer=None)
model/Replay/MbPAplusplus.py:31
↓ 1 callersMethod_combine_ipt
(self, ipt_E, ipt_AB)
utils/my_peft/tuners/adalora.py:595
↓ 1 callersMethod_create_adapted_attentions
Wrap LlamaAttention modules with newly created AdaptedAttention modules.
utils/my_peft/tuners/adaption_prompt.py:228
↓ 1 callersMethod_find_and_replace
(self, adapter_name)
utils/my_peft/tuners/adalora.py:128
↓ 1 callersMethod_mark_only_adaption_prompts_as_trainable
Freeze all parameters of the model except the adaption prompts.
utils/my_peft/tuners/adaption_prompt.py:256
↓ 1 callersMethod_prefix_tuning_forward
( self, input_ids=None, attention_mask=None, inputs_embeds=None, label
utils/my_peft/peft_model.py:552
↓ 1 callersMethod_prefix_tuning_forward
( self, input_ids=None, attention_mask=None, inputs_embeds=None, label
utils/my_peft/peft_model.py:1125
↓ 1 callersMethod_prepare_adalora_config
(peft_config, model_config)
utils/my_peft/tuners/adalora.py:307
↓ 1 callersMethod_prepare_batch
Parameter: sample -> list of tuple of experiences -> i.e, [(content_1,attn_mask_1,label_1),.....,(content_k,attn_mask_
model/Replay/MbPAplusplus.py:54
↓ 1 callersMethod_prepare_lora_config
(peft_config, model_config)
utils/my_peft/tuners/lora.py:338
next →1–100 of 425, ranked by callers