MCPcopy Create free account

hub / github.com/JieShibo/MoLE / functions

Functions2,110 in github.com/JieShibo/MoLE

↓ 2 callersFunctionbias_geglu_impl
(input, bias)
pretrain/megatron/core/fusions/fused_bias_geglu.py:76
↓ 2 callersFunctionbias_gelu
(bias, y)
pretrain/megatron/legacy/model/fused_bias_gelu.py:16
↓ 2 callersFunctionbias_swiglu_impl
(input, bias)
pretrain/megatron/core/fusions/fused_bias_swiglu.py:68
↓ 2 callersFunctionbroadcast_float_list
Broadcast a list of float values.
pretrain/megatron/inference/text_generation/communication.py:181
↓ 2 callersFunctionbroadcast_list
Broadcast a list of values with a given type.
pretrain/megatron/inference/text_generation/communication.py:162
↓ 2 callersMethodbuild
(self)
pretrain/megatron/core/dist_checkpointing/mapping.py:288
↓ 2 callersFunctionbuild_train_valid_test_data_iterators
Build pretraining data iterators.
pretrain/megatron/training/training.py:1382
↓ 2 callersFunctioncheck
(group, world_size, rank)
pretrain/megatron/legacy/mpu/tests/test_initialize.py:23
↓ 2 callersFunctioncheckpoint_exists
(checkpoints_path)
pretrain/megatron/training/checkpointing.py:186
↓ 2 callersMethodclear
Clear the embedding data structures to save memory. The metadata ends up getting used, and is also much smaller in dimensiona
pretrain/megatron/legacy/data/realm_index.py:42
↓ 2 callersMethodclip_grad_norm
Compute grad norm.
pretrain/megatron/core/optimizer/optimizer.py:124
↓ 2 callersFunctionconversion_helper
Apply conversion to val. Recursively apply conversion if `val` #is a nested tuple/list structure.
pretrain/megatron/legacy/model/module.py:128
↓ 2 callersFunctionconversion_helper
(val, conversion)
pretrain/megatron/core/transformer/module.py:99
↓ 2 callersMethodconvert_ids_to_tokens
Converts a sequence of ids in BPE tokens using the vocab.
pretrain/megatron/training/tokenizer/gpt2_tokenization.py:269
↓ 2 callersFunctionconvert_split_vector_to_split_matrix
Build the split matrix from one or optionally two contributing split vectors. Ex. a standard conversion: [0.99, 0.01, 0.0] -> [(0, 0.99), (0
pretrain/megatron/core/datasets/blended_megatron_dataset_config.py:103
↓ 2 callersFunctioncopy_from_last_to_first_pipeline_stage
Copy tensor values from last stage into the first stage. Note that the input tensor is updated in place.
pretrain/megatron/inference/text_generation/communication.py:111
↓ 2 callersFunctioncore_transformer_config_from_args
(args, config_class=None)
pretrain/megatron/training/arguments.py:538
↓ 2 callersMethodcount_zeros
Count number of zeros in model's gradients.
pretrain/megatron/core/optimizer/optimizer.py:132
↓ 2 callersMethodcreate_local_plan
(self)
pretrain/megatron/core/dist_checkpointing/strategies/torch.py:323
↓ 2 callersMethoddecode
(self, ids)
pretrain/megatron/training/tokenizer/tokenizer.py:244
↓ 2 callersFunctiondetokenize_generations
Detokenize the generated tokens.
pretrain/megatron/inference/text_generation/tokenization.py:13
↓ 2 callersMethoddisable_pre_hook
(self)
pretrain/megatron/core/optimizer/optimizer.py:756
↓ 2 callersMethoddtype_from_code
Get the dtype from the code Args: value (int): The code Returns: Type[numpy.number]: The dtype
pretrain/megatron/core/datasets/indexed_dataset.py:55
↓ 2 callersMethodembed_text_dataset_block
Embed a range of a text dataset. Args: embedder (Embedder): Embedder used for embedding a text dataset. text_dataset
pretrain/megatron/core/datasets/retro/index/index.py:120
↓ 2 callersMethodencode_block
Encode sub-dataset block, to be later added to index. Encode the data subset, generally in blocks of 1M vectors each. For each block,
pretrain/megatron/core/datasets/retro/index/indexes/faiss_par_add.py:41
↓ 2 callersFunctionextract_nonpersistent
( sharded_state_dict: ShardedStateDict, )
pretrain/megatron/core/dist_checkpointing/utils.py:79
↓ 2 callersFunctionextract_sharded_base
( sharded_state_dict: ShardedStateDict, )
pretrain/megatron/core/dist_checkpointing/utils.py:73
↓ 2 callersMethodfinish_grad_sync
Finishes grad sync (all-reduce or reduce-scatter) communication operation for this bucket. When overlap_grad_reduce is set t
pretrain/megatron/core/distributed/param_and_grad_buffer.py:145
↓ 2 callersFunctionflatten_range
(sharded_tensor, x)
pretrain/megatron/core/dist_checkpointing/strategies/zarr.py:232
↓ 2 callersMethodforward
Run a forward pass for each of the models and return the respective embeddings.
pretrain/megatron/legacy/model/realm_model.py:66
↓ 2 callersMethodforward
(ctx, inputs, scale)
pretrain/megatron/legacy/model/fused_softmax.py:79
↓ 2 callersMethodforward
(ctx, inputs, scale)
pretrain/megatron/core/fusions/fused_softmax.py:78
↓ 2 callersMethodforward_with_attention
(self, x)
pretrain/megatron/legacy/model/vision/esvit_swin_backbone.py:445
↓ 2 callersFunctiongather_from_sequence_parallel_region
(input_, tensor_parallel_output_grad=True)
pretrain/megatron/core/tensor_parallel/mappings.py:451
↓ 2 callersFunctiongeglu
(y)
pretrain/megatron/core/fusions/fused_bias_geglu.py:17
↓ 2 callersFunctiongeglu_back
(g, y)
pretrain/megatron/core/fusions/fused_bias_geglu.py:32
↓ 2 callersFunctiongenerate_state_dict
(args, model, optimizer, opt_param_scheduler, rng_state, use_dist_ckpt=False, iteratio
pretrain/megatron/training/checkpointing.py:338
↓ 2 callersFunctionget_adlr_autoresume
ADLR autoresume object. It can be None so no need to check if it is initialized.
pretrain/megatron/training/global_vars.py:66
↓ 2 callersFunctionget_bias_dropout_add
(training, fused)
pretrain/megatron/core/fusions/fused_bias_dropout.py:62
↓ 2 callersFunctionget_data_parallel_rng_tracker_name
()
pretrain/megatron/core/tensor_parallel/random.py:70
↓ 2 callersFunctionget_distributed_optimizer_checkpoint_name
(model_checkpoint_name)
pretrain/megatron/training/checkpointing.py:123
↓ 2 callersMethodget_document_indices
Get the document indices This method is slated for deprecation. Returns: numpy.ndarray: The document indices
pretrain/megatron/core/datasets/indexed_dataset.py:562
↓ 2 callersFunctionget_empty_index_path
Path of empty index. Args: config (RetroPreprocessingConfig): Retro preprocessing config. Returns: Path to the empty (tr
pretrain/megatron/core/datasets/retro/index/build.py:39
↓ 2 callersFunctionget_forward_backward_func
Retrieves the appropriate forward_backward function given the configuration of parallel_state. Returns a function that will perform all of th
pretrain/megatron/core/pipeline_parallel/schedules.py:19
↓ 2 callersFunctionget_gpt_data_dir
Get project-relative directory of GPT bin/idx datasets.
pretrain/megatron/core/models/retro/utils.py:13
↓ 2 callersFunctionget_individual_db_dir
Individual DB's directory. Args: project_dir (str): Path to Retro project dir. prefix (str): Unique relative path to dataset with
pretrain/megatron/core/datasets/retro/db/utils.py:142
↓ 2 callersMethodget_loss_scale
FP32 optimizer does not do any scaling.
pretrain/megatron/core/optimizer/optimizer.py:630
↓ 2 callersFunctionget_merged_db_path_map
Paths to merged datasets. Args: project_dir (str): Path to Retro project dir. Returns: A dict of chunk databases, one for ea
pretrain/megatron/core/datasets/retro/db/utils.py:225
↓ 2 callersFunctionget_model
Build the model.
pretrain/megatron/training/training.py:332
↓ 2 callersFunctionget_num_chunks_per_sample
Compute seq_length // chunk_length. Args: sample_length (int): Alias of `sequence_length`. chunk_length (int): Retro chunk length
pretrain/megatron/core/datasets/retro/utils.py:61
↓ 2 callersFunctionget_num_layers_to_build
(config: TransformerConfig)
pretrain/megatron/core/transformer/transformer_block.py:29
↓ 2 callersFunctionget_pairs
Return set of symbol pairs in a word. Word is represented as tuple of symbols (symbols being variable-length strings).
pretrain/megatron/training/tokenizer/gpt2_tokenization.py:79
↓ 2 callersFunctionget_query_dir
Get root directory of all saved query data. Args: project_dir (str): Retro project dir. Returns: Path to query sub-directory
pretrain/megatron/core/datasets/retro/query/utils.py:10
↓ 2 callersFunctionget_rng_state
collect rng state across data parallel ranks
pretrain/megatron/training/checkpointing.py:234
↓ 2 callersMethodget_start_end_idx
(self)
pretrain/megatron/legacy/data/data_samplers.py:82
↓ 2 callersFunctionget_swin
(is_teacher=False)
pretrain/megatron/legacy/model/vision/esvit_swin_backbone.py:810
↓ 2 callersFunctionget_target_sample_len
pretrain/megatron/core/datasets/helpers.cpp:169
↓ 2 callersFunctionget_tensor_model_parallel_src_rank
Calculate the global rank corresponding to the first local rank in the tensor model parallel group.
pretrain/megatron/core/parallel_state.py:876
↓ 2 callersFunctionget_tensor_shapes
( *, rank: int, model_type: ModelType, seq_length: int, micro_batch_size: int, decoder
pretrain/megatron/core/pipeline_parallel/schedules.py:981
↓ 2 callersFunctionget_text_dataset_for_adding
Convert GPT token chunk dataset to a text dataset for passing to the embedder. Args: config (RetroPreprocessingConfig): Retro preproc
pretrain/megatron/core/datasets/retro/index/build.py:232
↓ 2 callersFunctionget_text_dataset_for_training
Convert GPT token chunk dataset to a text dataset for passing to the embedder. Args: config (RetroPreprocessingConfig): Retro preproc
pretrain/megatron/core/datasets/retro/index/build.py:115
↓ 2 callersFunctionget_virtual_pipeline_model_parallel_world_size
Return the virtual pipeline-parallel world size.
pretrain/megatron/core/parallel_state.py:870
↓ 2 callersFunctionget_world_max
Get max value across ranks. Args: n (int): Value on this rank. Returns: Max value across all ranks.
pretrain/megatron/core/datasets/retro/utils.py:231
↓ 2 callersFunctiongrouped_gemm_is_available
()
pretrain/megatron/core/transformer/moe/grouped_gemm_util.py:9
↓ 2 callersFunctionhas_file_allowed_extension
Checks if a file is an allowed extension. Args: filename (string): path to a file extensions (tuple of strings): extensions to con
pretrain/megatron/legacy/data/image_folder.py:43
↓ 2 callersMethodinitialize
Initialize the dataset This method is called by IndexedDataset.__init__ during object creation and by IndexedDataset.__setstate__ dur
pretrain/megatron/core/datasets/indexed_dataset.py:353
↓ 2 callersFunctionis_first_microbatch_for_model_chunk
Check if an iteration is the first for a model chunk.
pretrain/megatron/core/pipeline_parallel/schedules.py:546
↓ 2 callersFunctionis_last_microbatch_for_model_chunk
Check if an iteration is the last for a model chunk.
pretrain/megatron/core/pipeline_parallel/schedules.py:557
↓ 2 callersFunctionis_start_piece
Check if the current word piece is the starting piece (BERT).
pretrain/megatron/legacy/data/dataset_utils.py:166
↓ 2 callersMethodload_from_file
Populate members from instance saved to file
pretrain/megatron/legacy/data/realm_index.py:50
↓ 2 callersFunctionload_indexed_datasets
Loaded indexed datasets into memory-mapped datasets. Args: project_dir (str): Path to Retro project dir. indexed_dataset_infos (L
pretrain/megatron/core/datasets/retro/db/utils.py:109
↓ 2 callersFunctionloss_func
Loss function. Args: loss_mask (torch.Tensor): Used to mask out some portions of the loss output_tensor (torch.Tensor): The tenso
pretrain/pretrain_gpt.py:108
↓ 2 callersFunctionmake_attention_mask
Returns a 2-dimensional (2-D) attention mask :param source_block: 1-D array :param target_block: 1-D array
pretrain/megatron/legacy/data/ict_dataset.py:12
↓ 2 callersFunctionmake_sharded_optimizer_tensor
Build a ShardedTensor or ShardedTensorFactory for optimizer param based on model param Args: model_param (Union[ShardedTensor, ShardedTe
pretrain/megatron/core/dist_checkpointing/optimizer.py:66
↓ 2 callersFunctionmap_reduce
Simple map-reduce implementation following `more_itertools.map_reduce` interface.
pretrain/megatron/core/dist_checkpointing/dict_utils.py:220
↓ 2 callersFunctionmaybe_load_config
Returns checkpoint config if `checkpoint_dir` is a distributed checkpoint and None otherwise Args: checkpoint_dir: checkpoint directory
pretrain/megatron/core/dist_checkpointing/core.py:48
↓ 2 callersFunctionmcore_to_pyt_state_dict
Turn state dict with ShardedTensors and ShardedObjects to state dict compatible with PyT Dist format. Operates in-place and returns the original
pretrain/megatron/core/dist_checkpointing/strategies/torch.py:180
↓ 2 callersFunctionnested_items_iter
Returns iterator over (nested) tuples (container, key, value) of a given dict or list.
pretrain/megatron/core/dist_checkpointing/dict_utils.py:154
↓ 2 callersFunctionnum_floating_point_operations
(args, batch_size)
pretrain/megatron/training/training.py:65
↓ 2 callersFunctionparallel_self_attention
(tensor_model_parallel_size, num_att_heads_per_partition, hidden_size_per_att_head
pretrain/megatron/legacy/mpu/tests/test_layers.py:315
↓ 2 callersFunctionparallel_transformer
(tensor_model_parallel_size, num_att_heads_per_partition, hidden_size_per_att_head, b
pretrain/megatron/legacy/mpu/tests/test_layers.py:400
↓ 2 callersFunctionparam_is_not_shared
(param)
pretrain/megatron/legacy/model/module.py:19
↓ 2 callersFunctionparam_is_not_shared
(param)
pretrain/megatron/core/transformer/module.py:23
↓ 2 callersFunctionparam_is_not_tensor_parallel_duplicate
(param)
pretrain/megatron/core/tensor_parallel/layers.py:53
↓ 2 callersFunctionpermute
Permute the tokens based on the indices. Token with the same index will be grouped together. Args: tokens (torch.Tensor): The input token
pretrain/megatron/core/transformer/moe/moe_utils.py:106
↓ 2 callersFunctionpil_loader
(path: str)
pretrain/megatron/legacy/data/image_folder.py:237
↓ 2 callersFunctionpostprocess_numpy_array
(loaded_array, sharded_tensor, apply_flattened_range=True)
pretrain/megatron/core/dist_checkpointing/strategies/zarr.py:205
↓ 2 callersFunctionprepare_input_tensors_for_wgrad_compute
(grad_output, all_gathered_input)
pretrain/megatron/core/utils.py:239
↓ 2 callersFunctionread_metadata
(tracker_filename)
pretrain/megatron/training/checkpointing.py:193
↓ 2 callersFunctionreduce_from_tensor_model_parallel_region
(input_)
pretrain/megatron/core/tensor_parallel/mappings.py:435
↓ 2 callersFunctionreduce_scatter_to_sequence_parallel_region_from_moe
(input_)
pretrain/megatron/core/tensor_parallel/mappings.py:463
↓ 2 callersMethodregister_grad_ready
Registers grads for the passed-in param to be "ready" for grad sync. When the number of microbatches is greater than 1, we only want
pretrain/megatron/core/distributed/param_and_grad_buffer.py:163
↓ 2 callersFunctionreplace_prefix_for_sharding
Replaces the given prefix in *all* sharded keys in a given state dict. Errors out if some key does not begin with a given prefix. Args:
pretrain/megatron/core/dist_checkpointing/utils.py:106
↓ 2 callersMethodreset
Set to the initial state (no tracker).
pretrain/megatron/core/tensor_parallel/random.py:90
↓ 2 callersFunctionrotate_half
(x)
modeling_mole.py:151
↓ 2 callersFunctionrotate_half
(x)
modeling_dense.py:151
↓ 2 callersFunctionrotate_half
(x)
modeling_moe.py:151
↓ 2 callersFunctionrotate_half
(x)
modeling_mole_rep.py:153
↓ 2 callersFunctionsafely_set_viewless_tensor_data
Safely set tensor's '.data' field. Check first that the tensor is viewless (i.e., '._base' not set). If not, raise an exception.
pretrain/megatron/core/utils.py:153
↓ 2 callersFunctionsample_blocks
Sample a random subset of all blocks. Args: _blocks (List[Optional[Dict]]): List of all blocks. Returns:
pretrain/megatron/core/datasets/retro/utils.py:264
← previousnext →301–400 of 2,110, ranked by callers