MCPcopy Create free account

hub / github.com/JieShibo/MoLE / functions

Functions2,110 in github.com/JieShibo/MoLE

↓ 5 callersMethoddecode
(self, tokens)
pretrain/megatron/training/tokenizer/gpt2_tokenization.py:283
↓ 5 callersMethodencode
(self, text)
pretrain/megatron/training/tokenizer/gpt2_tokenization.py:280
↓ 5 callersMethodencoder
(self)
pretrain/megatron/training/tokenizer/tokenizer.py:435
↓ 5 callersMethodflops
(self)
pretrain/megatron/legacy/model/vision/esvit_swin_backbone.py:458
↓ 5 callersFunctionget_bin_path
Get the path to the data file from the prefix Args: path_prefix (str): The prefix Returns: str: The path to the data file
pretrain/megatron/core/datasets/indexed_dataset.py:710
↓ 5 callersFunctionget_gpt_layer_local_spec
( num_experts: int = None, moe_grouped_gemm: bool = False, qk_layernorm: bool = False )
pretrain/megatron/core/models/gpt/gpt_layer_specs.py:53
↓ 5 callersFunctionget_gpt_layer_with_transformer_engine_spec
( num_experts: int = None, moe_grouped_gemm: bool = False, qk_layernorm: bool = False )
pretrain/megatron/core/models/gpt/gpt_layer_specs.py:24
↓ 5 callersMethodget_index
Construct an index from an index type string. Args: index_type (str): One of 'faiss-base' (naive Faiss index wrapper) or 'faiss-p
pretrain/megatron/core/datasets/retro/index/factory.py:29
↓ 5 callersFunctionget_indexed_dataset_
(data_prefix, dataset_type)
pretrain/megatron/legacy/data/dataset_utils.py:593
↓ 5 callersFunctionget_norm
(config)
pretrain/megatron/legacy/model/utils.py:62
↓ 5 callersFunctioninitialize_distributed
Initialize torch.distributed.
pretrain/megatron/legacy/mpu/tests/commons.py:29
↓ 5 callersMethodload_state_dict
Load the state dicts of each of the models
pretrain/megatron/legacy/model/realm_model.py:105
↓ 5 callersMethodload_state_dict
Customized load.
pretrain/megatron/legacy/model/language_model.py:268
↓ 5 callersMethodnormalize
(self, start: int = 0)
pretrain/megatron/core/optimizer/distrib_optimizer.py:35
↓ 5 callersFunctionsave_checkpoint_and_time
(iteration, model, optimizer, opt_param_scheduler, num_floating_point_operations_
pretrain/megatron/training/training.py:860
↓ 5 callersMethodsharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: Optional[dict] = None )
pretrain/megatron/core/transformer/mlp.py:151
↓ 5 callersFunctionupdate_num_microbatches
(consumed_samples, consistency_check=True)
pretrain/megatron/training/global_vars.py:38
↓ 4 callersMethod__init__
( self, input_size: int, output_size: int, *, parallel_mode: str,
pretrain/megatron/core/transformer/custom_layers/transformer_engine.py:89
↓ 4 callersFunction_ensure_var_is_initialized
Make sure the input variable is not None.
pretrain/megatron/training/global_vars.py:229
↓ 4 callersFunction_gather_along_first_dim
Gather tensors and concatinate along the first dimension.
pretrain/megatron/core/tensor_parallel/mappings.py:107
↓ 4 callersMethod_get
Return a tensor with the input `shape` as a view into the 1-D data starting at `start_index`.
pretrain/megatron/core/distributed/param_and_grad_buffer.py:416
↓ 4 callersFunction_get_extra_te_kwargs
(config: TransformerConfig)
pretrain/megatron/core/transformer/custom_layers/transformer_engine.py:28
↓ 4 callersFunction_reduce_scatter_along_first_dim
Reduce-scatter the input tensor across model parallel group.
pretrain/megatron/core/tensor_parallel/mappings.py:126
↓ 4 callersFunction_transpose_first_dim
(t, num_splits, num_splits_first, model)
pretrain/megatron/training/checkpointing.py:374
↓ 4 callersFunctionapply_rotary_pos_emb
Reroute to the appropriate apply_rotary_pos_emb function depending on fused/unfused kernels, or bshd (conventional) / thd (packed seq) format
pretrain/megatron/core/models/common/embeddings/rotary_pos_embedding.py:224
↓ 4 callersFunctionbert_extended_attention_mask
(attention_mask)
pretrain/megatron/legacy/model/bert_model.py:20
↓ 4 callersFunctionbuild_dataset
(name, data_prefix, max_num_samples, max_seq_length, seed, binary_head, ma
pretrain/megatron/legacy/data/dataset_utils.py:533
↓ 4 callersFunctionbuild_pretraining_data_loader
Build dataloader given an input dataset.
pretrain/megatron/legacy/data/data_samplers.py:14
↓ 4 callersMethodconcat_and_pad_tokens
Concat with special tokens and pad sequence to self.max_seq_length
pretrain/megatron/legacy/data/ict_dataset.py:142
↓ 4 callersFunctioncondition_init_method
(config, init_method)
pretrain/megatron/core/transformer/custom_layers/transformer_engine.py:41
↓ 4 callersFunctionconvert_by_vocab
Converts a sequence of [tokens|ids] using the vocab.
pretrain/megatron/training/tokenizer/bert_tokenization.py:136
↓ 4 callersMethodembed_text_dataset
Embed a text dataset. Args: text_dataset (torch.utils.data.Dataset): Text dataset to embed. Each sample of the text dataset shoul
pretrain/megatron/core/datasets/retro/config/bert_embedders.py:21
↓ 4 callersFunctionfix_query_key_value_ordering
Fix up query/key/value matrix ordering if checkpoint version is smaller than 2.0
pretrain/megatron/training/checkpointing.py:413
↓ 4 callersMethodforward
(self, encoder_input_ids, decoder_input_ids, encoder_attn_mask, decoder_attn_mask, encoder_dec
pretrain/megatron/legacy/model/t5_model.py:107
↓ 4 callersFunctionget_added_codes_dir
Get directory of saved encodings. Args: config (RetroPreprocessingConfig): Retro preprocessing config. Returns: Path to the
pretrain/megatron/core/datasets/retro/index/utils.py:105
↓ 4 callersFunctionget_data_parallel_group
Get the data parallel group the caller rank belongs to.
pretrain/megatron/core/parallel_state.py:580
↓ 4 callersMethodget_empty_index_path
Get file path to empty index (i.e., trained, but unpopulated). Args: config (RetroPreprocessingConfig): Retro preprocessing confi
pretrain/megatron/core/datasets/retro/index/index.py:53
↓ 4 callersFunctionget_global_memory_buffer
Return the global GlobalMemoryBuffer object
pretrain/megatron/core/parallel_state.py:1018
↓ 4 callersFunctionget_index_dir
Create sub-directory for this index. Args: config (RetroPreprocessingConfig): Retro preprocessing config. Returns: Path to i
pretrain/megatron/core/datasets/retro/index/utils.py:13
↓ 4 callersFunctionget_model_type
(model)
pretrain/megatron/core/utils.py:54
↓ 4 callersFunctionget_pipeline_model_parallel_group
Get the pipeline model parallel group the caller rank belongs to.
pretrain/megatron/core/parallel_state.py:572
↓ 4 callersMethodget_rotary_seq_len
Function to get the rotary sequence length. Args: inference_params : Used during Inference time transformer (Transfor
pretrain/megatron/core/models/common/embeddings/rotary_pos_embedding.py:120
↓ 4 callersFunctionget_tensorboard_writer
Return tensorboard writer. It can be None so no need to check if it is initialized.
pretrain/megatron/training/global_vars.py:49
↓ 4 callersMethodglobal_slice
(self)
pretrain/megatron/core/dist_checkpointing/mapping.py:70
↓ 4 callersFunctioninit_method_normal
Init method based on N(0, sigma).
pretrain/megatron/legacy/model/utils.py:13
↓ 4 callersFunctionis_last_rank
()
pretrain/megatron/training/utils.py:263
↓ 4 callersMethodmake_object_verbose
Make index object verbose. Args: index (faiss.Index): Faiss object to set verbose. verbose (bool): Sets whether index
pretrain/megatron/core/datasets/retro/index/index.py:43
↓ 4 callersFunctionmake_viewless_tensor
Entry-point for creating viewless tensors. This method should be used, rather than calling 'MakeViewlessTensor' or '_kernel_make_viewles
pretrain/megatron/core/utils.py:116
↓ 4 callersFunctionrepeat_kv
(hidden_states: torch.Tensor, n_rep: int)
modeling_mole.py:195
↓ 4 callersFunctionrepeat_kv
(hidden_states: torch.Tensor, n_rep: int)
modeling_dense.py:193
↓ 4 callersFunctionrepeat_kv
(hidden_states: torch.Tensor, n_rep: int)
modeling_moe.py:195
↓ 4 callersFunctionrepeat_kv
(hidden_states: torch.Tensor, n_rep: int)
modeling_mole_rep.py:197
↓ 4 callersMethodset_states
Set the rng states. For efficiency purposes, we do not check the size of seed for compatibility.
pretrain/megatron/core/tensor_parallel/random.py:110
↓ 4 callersMethodshared_embedding_or_output_weight
Gets the emedding weight or output logit weights when share embedding and output weights set to True. Returns: Tensor: During pre
pretrain/megatron/core/models/common/language_module/language_module.py:111
↓ 4 callersMethodstate_dict_for_save_checkpoint
For easy load.
pretrain/megatron/legacy/model/language_model.py:250
↓ 4 callersMethodstep
Set lr for all parameters groups.
pretrain/megatron/training/optimizer_param_scheduler.py:130
↓ 4 callersMethodtrain
Train index on a representative set of vectors. Args: config (RetroPreprocessingConfig): Retro preprocessing config.
pretrain/megatron/core/datasets/retro/index/index.py:104
↓ 3 callersMethod__init__
(self, out_dim, ncrops, warmup_teacher_temp, teacher_temp, warmup_teacher_temp_epochs, nepoch
pretrain/megatron/legacy/model/vision/dino.py:24
↓ 3 callersFunction_bias_dropout_add_func
(x_with_bias, residual, prob, training)
pretrain/megatron/core/fusions/fused_bias_dropout.py:9
↓ 3 callersFunction_build_attention_mask_and_position_ids
Build the attention mask and postition ids for the input tokens.
pretrain/megatron/inference/text_generation/generation.py:420
↓ 3 callersMethod_dispatch_gather_model_params
All-gather updated model params. When using the distributed optimizer, the params are already laid out in a contiguous buffe
pretrain/megatron/core/optimizer/distrib_optimizer.py:1216
↓ 3 callersFunction_gather_along_first_dim_moe
Gather tensors and concatenate along the first dimension.
pretrain/megatron/core/tensor_parallel/mappings.py:147
↓ 3 callersFunction_get_iterator
Return dataset iterator.
pretrain/megatron/training/training.py:1397
↓ 3 callersMethod_get_model_param_range_map
Given a model param, get the index sub-range of the param that this data-parallel rank owns.
pretrain/megatron/core/optimizer/distrib_optimizer.py:513
↓ 3 callersFunction_is_cuda_contiguous
Check if a tensor is not none, is cuda, and is contiguous.
pretrain/megatron/inference/text_generation/communication.py:52
↓ 3 callersFunction_load_base_checkpoint
Load the base state_dict from the given directory If rank0 is true, just loads rank 0 checkpoint, ignoring arguments.
pretrain/megatron/training/checkpointing.py:444
↓ 3 callersMethod_make_attention_mask
Return a 2-D attention mask Args: source_block (numpy.ndarray): A 1-D array target_block (numpy.ndarray): A 1-D array
pretrain/megatron/core/datasets/t5_dataset.py:194
↓ 3 callersMethod_populate_vocab
(self)
pretrain/megatron/training/tokenizer/tokenizer.py:356
↓ 3 callersFunction_reduce
All-reduce the input tensor across model parallel group.
pretrain/megatron/core/tensor_parallel/mappings.py:16
↓ 3 callersFunction_reduce_scatter_along_first_dim_moe
Reduce-scatter the input tensor across model parallel group.
pretrain/megatron/core/tensor_parallel/mappings.py:164
↓ 3 callersFunction_reduce_scatter_along_last_dim
Reduce-scatter tensors on the last dimension.
pretrain/megatron/core/tensor_parallel/mappings.py:93
↓ 3 callersFunction_set_elem
(target, k, v)
pretrain/megatron/core/dist_checkpointing/dict_utils.py:28
↓ 3 callersMethod_set_mips_index
Create a Faiss Flat index with inner product as the metric to search against
pretrain/megatron/legacy/data/realm_index.py:130
↓ 3 callersFunction_split_along_first_dim
Split the tensor along its first dimension and keep the corresponding slice.
pretrain/megatron/core/tensor_parallel/mappings.py:48
↓ 3 callersFunction_split_along_last_dim
Split the tensor along its last dimension and keep the corresponding slice.
pretrain/megatron/core/tensor_parallel/mappings.py:29
↓ 3 callersMethodadd
Track the rng state.
pretrain/megatron/core/tensor_parallel/random.py:116
↓ 3 callersMethodadd_token
(self, token)
pretrain/megatron/training/tokenizer/tokenizer.py:216
↓ 3 callersFunctionapply_rotary_pos_emb
(q, k, cos, sin, position_ids=None, unsqueeze_dim=1)
modeling_mole.py:157
↓ 3 callersFunctionapply_rotary_pos_emb
(q, k, cos, sin, position_ids=None, unsqueeze_dim=1)
modeling_dense.py:157
↓ 3 callersFunctionapply_rotary_pos_emb
(q, k, cos, sin, position_ids=None, unsqueeze_dim=1)
modeling_moe.py:157
↓ 3 callersFunctionapply_rotary_pos_emb
(q, k, cos, sin, position_ids=None, unsqueeze_dim=1)
modeling_mole_rep.py:159
↓ 3 callersFunctionbackward_step_helper
Helper method to run backward step with model split into chunks (run set_virtual_pipeline_model_parallel_rank() before calling backwar
pretrain/megatron/core/pipeline_parallel/schedules.py:621
↓ 3 callersFunctionbroadcast_tensor
Given size and type of a tensor on all ranks and the tensor value only on a specific rank, broadcast from that rank to all other ranks.
pretrain/megatron/inference/text_generation/communication.py:144
↓ 3 callersMethodbuild_generic_dataset
Build the DistributedDataset Return None if and only if the underlying dataset class is not built on the current rank and torch.distr
pretrain/megatron/core/datasets/blended_megatron_dataset_builder.py:256
↓ 3 callersFunctionbuild_split_dataset
(index, name)
pretrain/megatron/legacy/data/dataset_utils.py:500
↓ 3 callersMethodcompute_language_model_loss
Computes the language model loss (Cross entropy across vocabulary) Args: labels (Tensor): The labels of dimension [batch size, se
pretrain/megatron/core/models/common/language_module/language_module.py:24
↓ 3 callersFunctionconvert_to_unicode
Converts `text` to Unicode (if it's not already), assuming utf-8 input.
pretrain/megatron/training/tokenizer/bert_tokenization.py:78
↓ 3 callersMethodconvert_tokens_to_ids
Converts a sequence of tokens into ids using the vocab.
pretrain/megatron/training/tokenizer/gpt2_tokenization.py:247
↓ 3 callersMethoddecoder
(self)
pretrain/megatron/training/tokenizer/tokenizer.py:431
↓ 3 callersFunctiondetach
(tensor)
pretrain/megatron/legacy/data/realm_index.py:13
↓ 3 callersFunctiondisable_grad_sync
Disable asynchronous grad reductions
pretrain/megatron/core/pipeline_parallel/schedules.py:451
↓ 3 callersMethodelapsed
Calculates the elapsed time and restarts timer. Args: reset (bool, optional): Resets timer before restarting. Defaults to True.
pretrain/megatron/core/timers.py:119
↓ 3 callersMethodembed_text
Embed a batch of tokens using the model
pretrain/megatron/legacy/model/biencoder_model.py:135
↓ 3 callersMethodencode
Encode text dataset, to be later added to index. Args: config (RetroPreprocessingConfig): Retro preprocessing config.
pretrain/megatron/core/datasets/retro/index/indexes/faiss_par_add.py:84
↓ 3 callersFunctionensure_directory_exists
Build filename's path if it does not already exists.
pretrain/megatron/training/checkpointing.py:75
↓ 3 callersFunctionevaluate_and_print_results
Helper function to evaluate and dump results on screen.
pretrain/megatron/training/training.py:1237
↓ 3 callersMethodflops
(self)
pretrain/megatron/legacy/model/vision/swin_backbone.py:414
↓ 3 callersMethodforward
(self, x)
modeling_mole.py:175
↓ 3 callersMethodforward
(self, x)
modeling_dense.py:175
↓ 3 callersMethodforward
(self, x)
modeling_moe.py:175
← previousnext →101–200 of 2,110, ranked by callers