MCPcopy Create free account

hub / github.com/JieShibo/MoLE / functions

Functions2,110 in github.com/JieShibo/MoLE

↓ 2 callersFunctionsave_to_aux_losses_tracker
Save the auxiliary loss for logging. Args: name (str): The name of the loss. loss (torch.Tensor): The loss tensor. layer_n
pretrain/megatron/core/transformer/moe/moe_utils.py:156
↓ 2 callersFunctionsend_backward
(input_tensor_grads, tensor_shapes, config)
pretrain/megatron/core/pipeline_parallel/schedules.py:1051
↓ 2 callersFunctionsend_forward
(output_tensors, tensor_shapes, config)
pretrain/megatron/core/pipeline_parallel/schedules.py:1042
↓ 2 callersMethodset_document_indices
Set the document indices This method is slated for deprecation. Args: document_indices (numpy.ndarray): The document ind
pretrain/megatron/core/datasets/indexed_dataset.py:572
↓ 2 callersFunctionshard_buffer
Shard buffer into data_parallel_world_size chunks of equal size.
pretrain/megatron/core/distributed/param_and_grad_buffer.py:21
↓ 2 callersFunctionsharded_state_dict_default
Provides implementation for sharded_state_dict method for non-MegatronModules. Tries to call `module.sharded_state_dict` when possible, other
pretrain/megatron/core/transformer/utils.py:154
↓ 2 callersMethodstate
(self)
pretrain/megatron/legacy/data/realm_index.py:37
↓ 2 callersMethodstate_dict
(self)
pretrain/megatron/training/optimizer_param_scheduler.py:140
↓ 2 callersMethodstate_dict_for_save_checkpoint
Save dict with state dicts of each of the models.
pretrain/megatron/legacy/model/realm_model.py:90
↓ 2 callersMethodstate_dict_for_save_checkpoint
For easy load when model is combined with other heads, add an extra key.
pretrain/megatron/legacy/model/t5_model.py:156
↓ 2 callersMethodstate_dict_for_save_checkpoint
Save dict with state dicts of each of the models.
pretrain/megatron/legacy/model/biencoder_model.py:142
↓ 2 callersMethodstep
Clip gradients (if needed) and step the base optimizer. Always return successful since there is no overflow.
pretrain/megatron/core/optimizer/optimizer.py:635
↓ 2 callersFunctionswiglu
(y)
pretrain/megatron/core/fusions/fused_bias_swiglu.py:12
↓ 2 callersFunctionswiglu_back
(g, y)
pretrain/megatron/core/fusions/fused_bias_swiglu.py:27
↓ 2 callersFunctiont5_position_ids
(token_ids)
pretrain/megatron/legacy/model/t5_model.py:29
↓ 2 callersFunctiont5_position_ids
Calculate position ids from token ids Args: token_ids (Tensor): input tokens Returns: Tensor: position ids
pretrain/megatron/core/models/T5/t5_model.py:422
↓ 2 callersFunctiontokenize_prompts
Tokenize prompts and make them avaiable on all ranks.
pretrain/megatron/inference/text_generation/tokenization.py:54
↓ 2 callersFunctiontrack_e2e_metrics
()
pretrain/megatron/training/training.py:946
↓ 2 callersFunctionunpermute
Unpermute a tensor of permuted tokens based on sorted indices, and optionally merge the tokens with their corresponding probabilities. Args:
pretrain/megatron/core/transformer/moe/moe_utils.py:125
↓ 2 callersFunctionvalidate_added_encodings
Validate added encodings. Steps: - Randomly sample subset of text dataset blocks. - Encode each block. - Compare against saved encodi
pretrain/megatron/core/datasets/retro/index/validate.py:104
↓ 2 callersFunctionvalidate_sharding_integrity
Validate if the ShardedTensors from multiple processes define correct sharding of a global tensor. Local ShardedTensors metadata is exchanged wi
pretrain/megatron/core/dist_checkpointing/serialization.py:363
↓ 2 callersFunctionvalidate_training_embeddings
Validate training embeddings. Steps: - Randomly sample subset of text dataset blocks. - Embed each block. - Compare against saved emb
pretrain/megatron/core/datasets/retro/index/validate.py:40
↓ 2 callersFunctionwgrad_compute
(all_gathered_input, grad_output, weight)
pretrain/megatron/core/utils.py:295
↓ 2 callersFunctionwindow_partition
Args: x: (B, H, W, C) window_size (int): window size Returns: windows: (num_windows*B, window_size, window_size, C)
pretrain/megatron/legacy/model/vision/esvit_swin_backbone.py:45
↓ 2 callersFunctionwindow_partition
Args: x: (B, H, W, C) window_size (int): window size Returns: windows: (num_windows*B, window_size, window_size, C)
pretrain/megatron/legacy/model/vision/swin_backbone.py:39
↓ 2 callersMethodzero_grad
Copied from torch.optim.optimizer
pretrain/megatron/core/optimizer/optimizer.py:625
↓ 1 callersMethod__init__
(self, ict_head_size, num_tokentypes=1, parallel_output=Tru
pretrain/megatron/legacy/model/realm_model.py:40
↓ 1 callersMethod__init__
(self, config, num_tokentypes=0, parallel_output=True,
pretrain/megatron/legacy/model/t5_model.py:67
↓ 1 callersMethod__init__
(self, num_tokentypes=1, parallel_output=True, only_query_m
pretrain/megatron/legacy/model/biencoder_model.py:67
↓ 1 callersMethod__init__
(self, module, args)
pretrain/megatron/legacy/model/module.py:166
↓ 1 callersMethod__init__
(self, config, num_tokentypes=2, add_binary_head=True,
pretrain/megatron/legacy/model/bert_model.py:130
↓ 1 callersMethod__init__
(self, config, num_classes, finetune=False, pre_process=True, post_process=True)
pretrain/megatron/legacy/model/vision/classification.py:16
↓ 1 callersMethod__init__
(self, config, hidden_size, num_classes)
pretrain/megatron/legacy/model/vision/vit_backbone.py:33
↓ 1 callersMethod__init__
( self, root: str, transform: Optional[Callable] = None, targe
pretrain/megatron/legacy/data/image_folder.py:285
↓ 1 callersMethod__init__
(self, m, n)
pretrain/megatron/legacy/mpu/tests/test_layers.py:164
↓ 1 callersMethod__init__
Initialize Timer. Args: name (str): Name of the timer.
pretrain/megatron/core/timers.py:62
↓ 1 callersMethod__init__
( self, *args, shapes_validation_sharded_tensors: Iterable[ShardedTensor] = (), **kwargs )
pretrain/megatron/core/dist_checkpointing/strategies/torch.py:350
↓ 1 callersMethod__init__
( self, indexed_dataset: IndexedDataset, dataset_path: str, indexed_indices: n
pretrain/megatron/core/datasets/gpt_dataset.py:166
↓ 1 callersMethod__init__
(self, idx_path: str, dtype: Type[numpy.number])
pretrain/megatron/core/datasets/indexed_dataset.py:111
↓ 1 callersMethod__init__
(self, block_paths: List[str], block_size: int)
pretrain/megatron/core/datasets/retro/utils.py:320
↓ 1 callersMethod__init__
( self, config: TransformerConfig, transformer_encoder_layer_spec: ModuleSpec,
pretrain/megatron/core/models/T5/t5_model.py:106
↓ 1 callersMethod__init__
( self, config: RetroConfig, submodules: Type, **kwargs: dict, )
pretrain/megatron/core/models/retro/encoder_attention.py:201
↓ 1 callersMethod__init__
( self, config: RetroConfig, submodules: CrossAttentionSubmodules, layer_numbe
pretrain/megatron/core/models/retro/decoder_attention.py:55
↓ 1 callersMethod__init__
(self, *args, **kwargs)
pretrain/megatron/core/transformer/identity_op.py:10
↓ 1 callersMethod__init__
(self, config: TransformerConfig, module: torch.nn.Module)
pretrain/megatron/core/transformer/module.py:144
↓ 1 callersMethod__init__
(self, num_local_experts: int, config: TransformerConfig)
pretrain/megatron/core/transformer/moe/experts.py:32
↓ 1 callersMethod__init__
( self, config: TransformerConfig, submodules: MLPSubmodules = None, layer_number: int = None )
pretrain/megatron/core/transformer/moe/moe_layer.py:61
↓ 1 callersMethod__init__
Initialize the Router module. Args: config (TransformerConfig): Configuration object for the Transformer model.
pretrain/megatron/core/transformer/moe/router.py:32
↓ 1 callersMethod__init__
(self, start: int, end: int)
pretrain/megatron/core/optimizer/distrib_optimizer.py:30
↓ 1 callersMethod_add
Add to index (rank 0's method). Args: config (RetroPreprocessingConfig): Retro preprocessing config. text_dataset (GP
pretrain/megatron/core/datasets/retro/index/indexes/faiss_base.py:90
↓ 1 callersFunction_add_autoresume_args
(parser)
pretrain/megatron/training/arguments.py:1433
↓ 1 callersFunction_add_biencoder_args
(parser)
pretrain/megatron/training/arguments.py:1445
↓ 1 callersFunction_add_checkpointing_args
(parser)
pretrain/megatron/training/arguments.py:1164
↓ 1 callersFunction_add_data_args
(parser)
pretrain/megatron/training/arguments.py:1337
↓ 1 callersFunction_add_distributed_args
(parser)
pretrain/megatron/training/arguments.py:1256
↓ 1 callersFunction_add_experimental_args
(parser)
pretrain/megatron/training/arguments.py:1606
↓ 1 callersFunction_add_inference_args
(parser)
pretrain/megatron/training/arguments.py:609
↓ 1 callersFunction_add_initialization_args
(parser)
pretrain/megatron/training/arguments.py:1092
↓ 1 callersFunction_add_learning_rate_args
(parser)
pretrain/megatron/training/arguments.py:1110
↓ 1 callersFunction_add_logging_args
(parser)
pretrain/megatron/training/arguments.py:760
↓ 1 callersFunction_add_mixed_precision_args
(parser)
pretrain/megatron/training/arguments.py:1218
↓ 1 callersFunction_add_moe_args
(parser)
pretrain/megatron/training/arguments.py:1573
↓ 1 callersFunction_add_network_size_args
(parser)
pretrain/megatron/training/arguments.py:682
↓ 1 callersMethod_add_non_coordinator_iobytes_request
(self, plan)
pretrain/megatron/core/dist_checkpointing/strategies/torch.py:332
↓ 1 callersFunction_add_regularization_args
(parser)
pretrain/megatron/training/arguments.py:852
↓ 1 callersFunction_add_retro_args
(parser)
pretrain/megatron/training/arguments.py:634
↓ 1 callersFunction_add_to_index
Add DB chunks to index. Args: config (RetroPreprocessingConfig): Retro preprocessing config. Returns: Path to the populated
pretrain/megatron/core/datasets/retro/index/build.py:251
↓ 1 callersFunction_add_training_args
(parser)
pretrain/megatron/training/arguments.py:884
↓ 1 callersFunction_add_transformer_engine_args
(parser)
pretrain/megatron/training/arguments.py:580
↓ 1 callersFunction_add_validation_args
(parser)
pretrain/megatron/training/arguments.py:1320
↓ 1 callersFunction_add_vision_args
(parser)
pretrain/megatron/training/arguments.py:1502
↓ 1 callersMethod_adjust_key_value_for_inference
Saves the generated key and value tensors to the end of the buffers in inference_params. Returns the full size keys and values from t
pretrain/megatron/core/transformer/attention.py:165
↓ 1 callersFunction_allreduce_embedding_grads
All-reduce both word and position embeddings.
pretrain/megatron/core/distributed/finalize_model_grads.py:62
↓ 1 callersFunction_allreduce_layernorm_grads
All-reduce layernorm grads (for sequence parallelism).
pretrain/megatron/core/distributed/finalize_model_grads.py:70
↓ 1 callersFunction_allreduce_position_embedding_grads
All-reduce position_embeddings grad across first (encoder) and split (decoder) stages to ensure that position embeddings parameters stay in s
pretrain/megatron/core/distributed/finalize_model_grads.py:44
↓ 1 callersFunction_allreduce_word_embedding_grads
All-reduce word embedding grads. Reduce grads across first and last stages to ensure that word_embeddings parameters stay in sync. This
pretrain/megatron/core/distributed/finalize_model_grads.py:13
↓ 1 callersMethod_build_blended_dataset_splits
Build all dataset splits according to the provided blend(s) See the BlendedMegatronDatasetBuilder.build alias for more information.
pretrain/megatron/core/datasets/blended_megatron_dataset_builder.py:77
↓ 1 callersFunction_build_document_index
Build an array with length = num epochs * num documents Args: documents (numpy.ndarray): the subset of exposed document indices
pretrain/megatron/core/datasets/gpt_dataset.py:580
↓ 1 callersMethod_build_document_sample_shuffle_indices
Build the document index, the sample index, and the shuffle index The document index: -- 1-D -- An ordered ar
pretrain/megatron/core/datasets/gpt_dataset.py:348
↓ 1 callersMethod_build_gbuf_range_map
Build mapping between params and their grad buffers. These mappings are partitioned according to data type. Iterate through
pretrain/megatron/core/optimizer/distrib_optimizer.py:158
↓ 1 callersMethod_build_indices
Build and optionally cache the dataset index and the dataset sample index The dataset index is a 1-D mapping which determines the dataset to
pretrain/megatron/core/datasets/blended_dataset.py:99
↓ 1 callersFunction_build_key_size_numel_dictionaries
Build the size on rank 0 and broadcast.
pretrain/megatron/core/tensor_parallel/data.py:23
↓ 1 callersMethod_build_layers
(self)
pretrain/megatron/core/transformer/transformer_block.py:138
↓ 1 callersMethod_build_load_plan
( self, sharded_state_dict: ShardedStateDict )
pretrain/megatron/core/dist_checkpointing/strategies/two_stage.py:160
↓ 1 callersMethod_build_model_and_main_param_groups
Create main parameter groups needed for the optimizer step. These groups encompass both: 1) groups used by this class, for r
pretrain/megatron/core/optimizer/distrib_optimizer.py:243
↓ 1 callersMethod_build_model_gbuf_param_range_map
Build mapping from param reference to grad buffer shard ranges. This method builds a mapping from parameter references to grad
pretrain/megatron/core/optimizer/distrib_optimizer.py:47
↓ 1 callersMethod_build_model_gbuf_range
Build mapping between params and their grad buffers. This method does the initial setup for the method above. This setup inc
pretrain/megatron/core/optimizer/distrib_optimizer.py:109
↓ 1 callersMethod_build_model_param_gbuf_map
Create a reverse of the gbuf_ranges, for referencing in opposite direction.
pretrain/megatron/core/optimizer/distrib_optimizer.py:178
↓ 1 callersFunction_build_num_microbatches_calculator
(args)
pretrain/megatron/training/global_vars.py:116
↓ 1 callersMethod_build_optimizer_group_ranges
Create optimizer groups. Given the set of parameter shard ranges that are owned by the current data-parallel (DP) rank, gath
pretrain/megatron/core/optimizer/distrib_optimizer.py:196
↓ 1 callersFunction_build_train_valid_test_datasets
(data_prefix, splits_string, train_valid_test_num_samples,
pretrain/megatron/legacy/data/dataset_utils.py:466
↓ 1 callersFunction_check_arg_is_not_none
(args, arg)
pretrain/megatron/training/arguments.py:534
↓ 1 callersFunction_check_arg_is_not_none
(args, arg)
pretrain/megatron/training/yaml_arguments.py:410
↓ 1 callersFunction_check_data_types
Check that all the keys have the same target data type.
pretrain/megatron/core/tensor_parallel/data.py:14
↓ 1 callersMethod_checkpointed_attention_forward
Forward method with activation checkpointing.
pretrain/megatron/legacy/model/transformer.py:604
↓ 1 callersMethod_checkpointed_attention_forward
Forward method with selective activation checkpointing.
pretrain/megatron/core/transformer/attention.py:108
↓ 1 callersMethod_checkpointed_forward
Forward method with activation checkpointing.
pretrain/megatron/legacy/model/transformer.py:1599
↓ 1 callersMethod_checkpointed_forward
Forward method with activation checkpointing.
pretrain/megatron/core/transformer/transformer_block.py:182
↓ 1 callersMethod_clean_text
Performs invalid character removal and whitespace cleanup on text.
pretrain/megatron/training/tokenizer/bert_tokenization.py:318
↓ 1 callersMethod_collect_main_grad_data_for_unscaling
(self)
pretrain/megatron/core/optimizer/optimizer.py:468
← previousnext →401–500 of 2,110, ranked by callers