SYMBOL INDEX (263 symbols across 39 files) FILE: eval/generation_html.py function read_data (line 7) | def read_data(path): FILE: models/decrypt.py function xor_bytes (line 8) | def xor_bytes(data, key): function xor_worker (line 11) | def xor_worker(task_queue, result_queue): function write_result_chunk (line 17) | def write_result_chunk(fp, w_chunk_idx, pending, hasher): function main (line 29) | def main(input_file, key_file, output_dir): FILE: models/gptq/bloom.py function get_bloom (line 11) | def get_bloom(model): function bloom_sequential (line 24) | def bloom_sequential(model, dataloader, dev): function bloom_eval (line 118) | def bloom_eval(model, testenc, dev): function bloom_pack (line 214) | def bloom_pack(model, quantizers, wbits, groupsize): function load_quant (line 228) | def load_quant(model, checkpoint, wbits, groupsize): function benchmark (line 260) | def benchmark(model, input_ids, check=False): FILE: models/gptq/bloom_inference.py function get_bloom (line 14) | def get_bloom(model): function load_quant (line 26) | def load_quant(model, checkpoint, wbits, groupsize): FILE: models/gptq/datautils.py function set_seed (line 5) | def set_seed(seed): function get_wikitext2 (line 10) | def get_wikitext2(nsamples, seed, seqlen, model): function get_ptb (line 32) | def get_ptb(nsamples, seed, seqlen, model): function get_c4 (line 54) | def get_c4(nsamples, seed, seqlen, model): function get_loaders (line 103) | def get_loaders( FILE: models/gptq/gptq.py class GPTQ (line 17) | class GPTQ: method __init__ (line 18) | def __init__(self, layer): method add_batch (line 31) | def add_batch(self, inp, out): method fasterquant (line 59) | def fasterquant( method free (line 156) | def free(self): FILE: models/gptq/llama.py function get_llama (line 11) | def get_llama(model): function llama_sequential (line 24) | def llama_sequential(model, dataloader, dev): function llama_eval (line 126) | def llama_eval(model, testenc, dev): function llama_pack (line 219) | def llama_pack(model, quantizers, wbits, groupsize): function load_quant (line 233) | def load_quant(model, checkpoint, wbits, groupsize=-1,faster_kernel=False): function llama_multigpu (line 267) | def llama_multigpu(model, gpus): function benchmark (line 298) | def benchmark(model, input_ids, check=False): FILE: models/gptq/llama_inference.py function get_llama (line 14) | def get_llama(model): function load_quant (line 26) | def load_quant(model, checkpoint, wbits, groupsize): FILE: models/gptq/llama_inference_offload.py class Offload_LlamaModel (line 19) | class Offload_LlamaModel(LlamaModel): method __init__ (line 20) | def __init__(self, config: LlamaConfig): method forward (line 23) | def forward( function load_quant (line 184) | def load_quant(model, checkpoint, wbits, groupsize, pre_layer): FILE: models/gptq/modelutils.py function find_layers (line 8) | def find_layers(module, layers=[nn.Conv2d, nn.Linear], name=''): FILE: models/gptq/quant.py function quantize (line 6) | def quantize(x, scale, zero, maxq): class Quantizer (line 10) | class Quantizer(nn.Module): method __init__ (line 12) | def __init__(self, shape=1): method configure (line 18) | def configure( method find_params (line 31) | def find_params(self, x, weight=False): method quantize (line 110) | def quantize(self, x): method enabled (line 115) | def enabled(self): method ready (line 118) | def ready(self): class QuantLinear (line 128) | class QuantLinear(nn.Module): method __init__ (line 129) | def __init__(self, bits, groupsize, infeatures, outfeatures): method pack (line 148) | def pack(self, linear, scales, zeros): method forward (line 235) | def forward(self, x): function make_quant (line 269) | def make_quant(module, names, bits, groupsize, name=''): FILE: models/gptq/quant_cuda.cpp function vecquant2matmul (line 11) | void vecquant2matmul( function vecquant3matmul (line 26) | void vecquant3matmul( function vecquant4matmul (line 41) | void vecquant4matmul( function vecquant8matmul (line 56) | void vecquant8matmul( function PYBIND11_MODULE (line 65) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: train/dschat_train_v1/main.py function parse_args (line 40) | def parse_args(): function main (line 188) | def main(): FILE: train/dschat_train_v1/prompt_eval.py function read_data (line 31) | def read_data(filename): function write_data (line 43) | def write_data(filename, examples): function get_input_text (line 50) | def get_input_text(input_item): function _addrole_masklabel_tokenize (line 61) | def _addrole_masklabel_tokenize(source): FILE: train/dschat_train_v1/training_scripts/convert_llama_weights_to_hf.py function compute_intermediate_size (line 61) | def compute_intermediate_size(n): function read_json (line 65) | def read_json(path): function write_json (line 70) | def write_json(text, path): function write_model (line 75) | def write_model(model_path, input_base_path, model_size): function write_tokenizer (line 234) | def write_tokenizer(tokenizer_path, input_tokenizer_path): function main (line 251) | def main(): FILE: train/dschat_train_v1/training_scripts/convert_to_conv_data.py function main (line 17) | def main(): FILE: train/dschat_train_v1/utils/ds_utils.py function get_train_ds_config (line 9) | def get_train_ds_config(offload, function get_eval_ds_config (line 53) | def get_eval_ds_config(offload, stage=0): FILE: train/dschat_train_v1/utils/model/model_utils.py function create_hf_model (line 18) | def create_hf_model(model_class, FILE: train/dschat_train_v1/utils/module/lora.py class LinearLayer_LoRA (line 13) | class LinearLayer_LoRA(nn.Module): method __init__ (line 16) | def __init__(self, method eval (line 53) | def eval(self): method train (line 58) | def train(self, mode=True): method reset_parameters (line 62) | def reset_parameters(self): method fuse_lora_weight (line 66) | def fuse_lora_weight(self): method unfuse_lora_weight (line 72) | def unfuse_lora_weight(self): method forward (line 78) | def forward(self, input): function convert_linear_layer_to_lora (line 106) | def convert_linear_layer_to_lora(model, function _z3_params_to_fetch (line 133) | def _z3_params_to_fetch(param_list): function convert_lora_to_linear_layer (line 142) | def convert_lora_to_linear_layer(model): function only_optimize_lora_parameters (line 160) | def only_optimize_lora_parameters(model): FILE: train/dschat_train_v1/utils/utils.py function print_rank_0 (line 14) | def print_rank_0(msg, rank=0): function to_device (line 19) | def to_device(batch, device): class MovingAverage (line 29) | class MovingAverage: method __init__ (line 31) | def __init__(self): method update (line 36) | def update(self, num): function save_hf_format (line 44) | def save_hf_format(model, tokenizer, args, sub_folder=""): function set_random_seed (line 63) | def set_random_seed(seed): function get_all_reduce_mean (line 72) | def get_all_reduce_mean(tensor): function get_optimizer_grouped_parameters (line 78) | def get_optimizer_grouped_parameters(model, function _z3_params_to_fetch (line 106) | def _z3_params_to_fetch(param_list): function moving_average (line 113) | def moving_average(model, model_ema, beta=0.992, device=None, zero_stage... function save_zero_three_model (line 130) | def save_zero_three_model(model_ema, global_rank, save_dir, zero_stage=0): FILE: train/scripts/convert_llama_weights_to_hf.py function compute_intermediate_size (line 61) | def compute_intermediate_size(n): function read_json (line 65) | def read_json(path): function write_json (line 70) | def write_json(text, path): function write_model (line 75) | def write_model(model_path, input_base_path, model_size): function write_tokenizer (line 234) | def write_tokenizer(tokenizer_path, input_tokenizer_path): function main (line 251) | def main(): FILE: train/scripts/convert_to_conv_data.py function main (line 15) | def main(): FILE: train/scripts/run_multi_backend.py class Arguments (line 19) | class Arguments: function set_non_blocking (line 43) | def set_non_blocking(file): function terminate_processes_and_exit (line 48) | def terminate_processes_and_exit(exit_code=0): function handle_termination (line 66) | def handle_termination(signal, frame): FILE: train/src/dpo_trainer.py class CustomDPOTrainer (line 12) | class CustomDPOTrainer(DPOTrainer): method get_batch_metrics (line 13) | def get_batch_metrics( method prediction_step (line 75) | def prediction_step( FILE: train/src/entry_point/dpo_train.py function ignore_warnings (line 24) | def ignore_warnings(): class ScriptArguments (line 31) | class ScriptArguments: function print_rank_0 (line 199) | def print_rank_0(msg, rank=0): function compute_metrics (line 204) | def compute_metrics(eval_preds): function main (line 217) | def main(): FILE: train/src/entry_point/interface.py function generate_prompt (line 25) | def generate_prompt(input_text): function evaluate (line 32) | def evaluate( FILE: train/src/entry_point/ppo_train.py function print_rank_0 (line 39) | def print_rank_0(msg, log_file): class ScriptArguments (line 47) | class ScriptArguments: function build_dataset (line 134) | def build_dataset(tokenizer, dataset_name, input_length, cache_dir="hf_c... class DataCollatorWithPadding (line 180) | class DataCollatorWithPadding: method __call__ (line 187) | def __call__(self, features: List[Dict[str, Any]]) -> Dict[str, Any]: function main (line 201) | def main(): FILE: train/src/entry_point/pt_train.py class ModelArguments (line 40) | class ModelArguments: class DataArguments (line 73) | class DataArguments: class TrainingArguments (line 91) | class TrainingArguments(TrainingArguments): function print_rank_0 (line 146) | def print_rank_0(msg, log_file, rank=0): function main (line 153) | def main(): FILE: train/src/entry_point/rm_train.py function print_rank_0 (line 39) | def print_rank_0(msg, log_file): class ScriptArguments (line 47) | class ScriptArguments: function preprocess_function (line 158) | def preprocess_function(tokenizer: PreTrainedTokenizerBase, examples: Di... function main (line 178) | def main(): FILE: train/src/entry_point/sft_train.py class ModelArguments (line 42) | class ModelArguments: class DataArguments (line 78) | class DataArguments: class TrainingArguments (line 96) | class TrainingArguments(TrainingArguments): function print_rank_0 (line 151) | def print_rank_0(msg, log_file, rank=0): function main (line 158) | def main(): FILE: train/src/entry_point/zero_inference.py class ModelArguments (line 44) | class ModelArguments: class DataArguments (line 76) | class DataArguments: class GenerationConfig (line 90) | class GenerationConfig: class TrainingArguments (line 139) | class TrainingArguments(TrainingArguments): function print_rank_0 (line 165) | def print_rank_0(msg, log_file, rank=0): function main (line 172) | def main(): FILE: train/src/entry_point/zero_inference_backend_without_trainer.py class Arguments (line 30) | class Arguments: function generate_prompt (line 53) | def generate_prompt(input_text): function evaluate (line 57) | def evaluate( function main (line 121) | def main(): FILE: train/src/merge_llama_with_lora.py function apply_lora (line 9) | def apply_lora(model_name_or_path, output_path, lora_path): FILE: train/src/models/generation_utils.py class GenerationMode (line 102) | class GenerationMode(ExplicitEnum): class GenerationMixin (line 119) | class GenerationMixin: method prepare_inputs_for_generation (line 143) | def prepare_inputs_for_generation(self, *args, **kwargs): method _prepare_model_inputs (line 148) | def _prepare_model_inputs( method _maybe_initialize_input_ids_for_generation (line 212) | def _maybe_initialize_input_ids_for_generation( method _prepare_attention_mask_for_generation (line 240) | def _prepare_attention_mask_for_generation( method _prepare_encoder_decoder_kwargs_for_generation (line 258) | def _prepare_encoder_decoder_kwargs_for_generation( method _prepare_decoder_input_ids_for_generation (line 290) | def _prepare_decoder_input_ids_for_generation( method _get_decoder_start_token_id (line 335) | def _get_decoder_start_token_id(self, decoder_start_token_id: int = No... method _expand_inputs_for_generation (line 352) | def _expand_inputs_for_generation( method _extract_past_from_model_output (line 378) | def _extract_past_from_model_output(self, outputs: ModelOutput, standa... method _update_model_kwargs_for_generation (line 393) | def _update_model_kwargs_for_generation( method _reorder_cache (line 430) | def _reorder_cache(self, past_key_values, beam_idx): method _get_logits_warper (line 436) | def _get_logits_warper( method _get_generation_mode (line 474) | def _get_generation_mode( method _get_logits_processor (line 514) | def _get_logits_processor( method _get_stopping_criteria (line 645) | def _get_stopping_criteria( method _merge_criteria_processor_list (line 662) | def _merge_criteria_processor_list( method compute_transition_scores (line 683) | def compute_transition_scores( method _validate_model_class (line 804) | def _validate_model_class(self): method _validate_model_kwargs (line 830) | def _validate_model_kwargs(self, model_kwargs: Dict[str, Any]): method _validate_generated_length (line 879) | def _validate_generated_length(self, generation_config, input_ids_leng... method generate (line 926) | def generate( method contrastive_search (line 1468) | def contrastive_search( method greedy_search (line 1915) | def greedy_search( method sample (line 2191) | def sample( method beam_search (line 2481) | def beam_search( method beam_sample (line 2803) | def beam_sample( method group_beam_search (line 3134) | def group_beam_search( method constrained_beam_search (line 3514) | def constrained_beam_search( method assisted_decoding (line 3848) | def assisted_decoding( function _crop_past_key_values (line 4285) | def _crop_past_key_values(model, past_key_values, maximum_length): function _split_model_outputs (line 4333) | def _split_model_outputs(outputs, new_outputs, cur_len, added_len, is_de... function top_k_top_p_filtering (line 4359) | def top_k_top_p_filtering( function _ranking_fast (line 4394) | def _ranking_fast( FILE: train/src/models/llama/modeling_llama.py function _make_causal_mask (line 60) | def _make_causal_mask( function _expand_mask (line 78) | def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Option... class LlamaRMSNorm (line 92) | class LlamaRMSNorm(nn.Module): method __init__ (line 93) | def __init__(self, hidden_size, eps=1e-6): method forward (line 101) | def forward(self, hidden_states): class LlamaRotaryEmbedding (line 109) | class LlamaRotaryEmbedding(torch.nn.Module): method __init__ (line 110) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method _set_cos_sin_cache (line 124) | def _set_cos_sin_cache(self, seq_len, device, dtype): method forward (line 134) | def forward(self, x, seq_len=None): class LlamaLinearScalingRotaryEmbedding (line 145) | class LlamaLinearScalingRotaryEmbedding(LlamaRotaryEmbedding): method __init__ (line 148) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method _set_cos_sin_cache (line 152) | def _set_cos_sin_cache(self, seq_len, device, dtype): class LlamaDynamicNTKScalingRotaryEmbedding (line 164) | class LlamaDynamicNTKScalingRotaryEmbedding(LlamaRotaryEmbedding): method __init__ (line 167) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method _set_cos_sin_cache (line 171) | def _set_cos_sin_cache(self, seq_len, device, dtype): function rotate_half (line 190) | def rotate_half(x): function apply_rotary_pos_emb (line 197) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids): class LlamaMLP (line 208) | class LlamaMLP(nn.Module): method __init__ (line 209) | def __init__(self, config): method forward (line 219) | def forward(self, x): function repeat_kv (line 242) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class FlashSelfAttention (line 253) | class FlashSelfAttention(torch.nn.Module): method __init__ (line 254) | def __init__( method forward (line 271) | def forward(self, q, k, v): class LlamaAttention (line 316) | class LlamaAttention(nn.Module): method __init__ (line 322) | def __init__(self, config: LlamaConfig): method _init_rope (line 346) | def _init_rope(self): method _shape (line 363) | def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int): method forward (line 366) | def forward( class LlamaDecoderLayer (line 475) | class LlamaDecoderLayer(nn.Module): method __init__ (line 476) | def __init__(self, config: LlamaConfig): method forward (line 484) | def forward( class LlamaPreTrainedModel (line 560) | class LlamaPreTrainedModel(PreTrainedModel): method _init_weights (line 567) | def _init_weights(self, module): method _set_gradient_checkpointing (line 578) | def _set_gradient_checkpointing(self, module, value=False): class LlamaModel (line 651) | class LlamaModel(LlamaPreTrainedModel): method __init__ (line 659) | def __init__(self, config: LlamaConfig): method get_input_embeddings (line 672) | def get_input_embeddings(self): method set_input_embeddings (line 675) | def set_input_embeddings(self, value): method _prepare_decoder_attention_mask (line 679) | def _prepare_decoder_attention_mask(self, attention_mask, input_shape,... method forward (line 703) | def forward( class LlamaForCausalLM (line 830) | class LlamaForCausalLM(LlamaPreTrainedModel): method __init__ (line 833) | def __init__(self, config): method get_input_embeddings (line 842) | def get_input_embeddings(self): method set_input_embeddings (line 845) | def set_input_embeddings(self, value): method get_output_embeddings (line 848) | def get_output_embeddings(self): method set_output_embeddings (line 851) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 854) | def set_decoder(self, decoder): method get_decoder (line 857) | def get_decoder(self): method forward (line 862) | def forward( method prepare_inputs_for_generation (line 954) | def prepare_inputs_for_generation( method _reorder_cache (line 985) | def _reorder_cache(past_key_values, beam_idx): class LlamaForSequenceClassification (line 1009) | class LlamaForSequenceClassification(LlamaPreTrainedModel): method __init__ (line 1010) | def __init__(self, config): method get_input_embeddings (line 1019) | def get_input_embeddings(self): method set_input_embeddings (line 1022) | def set_input_embeddings(self, value): method forward (line 1026) | def forward( FILE: train/src/ppo_trainer.py class PPOTrainerForZero3 (line 21) | class PPOTrainerForZero3(PPOTrainer): method _generate_batched (line 22) | def _generate_batched( method step (line 106) | def step( method save_pretrained (line 412) | def save_pretrained( method is_deepspeed_zero3_enabled (line 448) | def is_deepspeed_zero3_enabled(self): FILE: train/src/sample_generator.py function sft_sample_to_ids (line 10) | def sft_sample_to_ids(conversations: Dict[str, Any], tokenizer: PreTrain... function generate_and_tokenize_prompt (line 38) | def generate_and_tokenize_prompt( function batch_grouped_sft_generate (line 87) | def batch_grouped_sft_generate( function batch_grouped_pretrain_generate (line 116) | def batch_grouped_pretrain_generate( function exam_generate (line 138) | def exam_generate(model_max_length: int, tokenizer: PreTrainedTokenizer,... function inference_generate (line 166) | def inference_generate( FILE: train/src/trainer.py class MyTrainer (line 9) | class MyTrainer(Trainer): method save_model (line 10) | def save_model(self, output_dir: Optional[str] = None, _internal_call:... method _load_from_checkpoint (line 68) | def _load_from_checkpoint(self, resume_from_checkpoint, model=None): class MySeq2SeqTrainer (line 151) | class MySeq2SeqTrainer(Seq2SeqTrainer): method prediction_step (line 152) | def prediction_step( FILE: train/src/utils.py function get_ds_state_dict (line 15) | def get_ds_state_dict(ds_engine: DeepSpeedEngine): function get_model_param_count (line 27) | def get_model_param_count( function bind_methods_from_class_to_instance (line 48) | def bind_methods_from_class_to_instance( function prepare_deepspeed (line 56) | def prepare_deepspeed(accelerator: Accelerator, model: PreTrainedModel): function zero_infer (line 94) | def zero_infer( class MultiClient (line 136) | class MultiClient(object): method __init__ (line 137) | def __init__(self, worker_addrs, synced_worker=False) -> None: method predict (line 141) | def predict(self, tasks: List[List], max_retries: int = 3) -> List[Any]: