MCPcopy Create free account

hub / github.com/JieShibo/MoLE / functions

Functions2,110 in github.com/JieShibo/MoLE

↓ 1 callersMethod_validate_global_shapes
(self, metadata, sharded_tensors)
pretrain/megatron/core/dist_checkpointing/strategies/torch.py:356
↓ 1 callersFunction_validate_objects_for_key
Ensure uniqueness of saved objects.
pretrain/megatron/core/dist_checkpointing/serialization.py:486
↓ 1 callersFunction_validate_sharding_for_key
(rank_sharding: List[Tuple[int, ShardedTensor]])
pretrain/megatron/core/dist_checkpointing/serialization.py:397
↓ 1 callersFunction_vocab_size_with_padding
Pad vocab size so it is divisible by model parallel size and still having GPU friendly size.
pretrain/megatron/training/tokenizer/tokenizer.py:73
↓ 1 callersFunction_warmup_jit_function
Compilie JIT functions before the main training steps
pretrain/megatron/training/initialize.py:330
↓ 1 callersFunction_with_pipelining_forward_step
No interleaving is supported.
pretrain/megatron/inference/text_generation/forward_step.py:126
↓ 1 callersFunctionaccimage_loader
(path: str)
pretrain/megatron/legacy/data/image_folder.py:245
↓ 1 callersMethodactive_time
(self)
pretrain/megatron/core/timers.py:143
↓ 1 callersMethodadd
Add to index. Args: config (RetroPreprocessingConfig): Retro preprocessing config. text_dataset (GPTToTextDataset): T
pretrain/megatron/core/datasets/retro/index/indexes/faiss_base.py:131
↓ 1 callersMethodadd_additional_special_tokens
(self, tokens_list)
pretrain/megatron/training/tokenizer/tokenizer.py:223
↓ 1 callersMethodadd_block_data
Add data for set of blocks :param row_id: 1D array of unique int ids for the blocks :param block_embeds: 2D array of embeddin
pretrain/megatron/legacy/data/realm_index.py:61
↓ 1 callersMethodadd_codes
Read codes from disk, and add them to the index. Args: config (RetroPreprocessingConfig): Retro preprocessing config.
pretrain/megatron/core/datasets/retro/index/indexes/faiss_par_add.py:133
↓ 1 callersMethodadd_embed_data
Add the embedding of each block to the underlying FAISS index
pretrain/megatron/legacy/data/realm_index.py:186
↓ 1 callersFunctionadd_prefix_for_sharding
Prepend a given prefix to all ShardedBase objects in a given state dict *in-place*. Args: sharded_state_dict (ShardedStateDict): sharded
pretrain/megatron/core/dist_checkpointing/utils.py:87
↓ 1 callersFunctionadd_to_index
Entry point for adding to the index. We select whether to add to a new index, or validate an existing index. Args: config (RetroPrep
pretrain/megatron/core/datasets/retro/index/build.py:273
↓ 1 callersFunctionaggregate_aux_losses_tracker_across_pipeline_parallel
Sum aux losses across PP.
pretrain/megatron/core/transformer/moe/moe_utils.py:186
↓ 1 callersFunctionall_gather_item
(item, dtype, group=None, async_op=False, local_rank=None)
pretrain/megatron/training/dist_signal_handler.py:28
↓ 1 callersFunctionapply_factory_merges
Apply merges defined by ShardedTensorFactories *in-place*. Args: x1 (StateDict): state dict loaded from the checkpoint x2 (Shard
pretrain/megatron/core/dist_checkpointing/mapping.py:310
↓ 1 callersMethodapply_input_jitter
Add noise to the input tensor. Refer to https://arxiv.org/abs/2101.03961. Args: input (Tensor): Input tensor. Re
pretrain/megatron/core/transformer/moe/router.py:200
↓ 1 callersMethodapply_load_balancing_loss
Applies auxiliary loss to the MoE layer. Args: loss_func (callable): The loss function to be used. probs (torch.Tenso
pretrain/megatron/core/transformer/moe/router.py:154
↓ 1 callersFunctionapply_prefix_mapping
Replaces prefixes *only in keys matching* with one of prefixes in the map. Args: sharded_state_dict (ShardedStateDict): sharded state di
pretrain/megatron/core/dist_checkpointing/utils.py:132
↓ 1 callersFunctionapply_rotary_pos_emb_thd
A baseline implementation of applying RoPE for `thd` format. Args: t (Tensor): Input tensor T is of shape [t, h, d] cu_seqlens(Te
pretrain/megatron/core/models/common/embeddings/rotary_pos_embedding.py:199
↓ 1 callersMethodapply_z_loss
Encourages the router's logits to remain small to enhance stability. Please refer to the ST-MoE paper (https://arxiv.org/pdf/2202.08906.pdf) f
pretrain/megatron/core/transformer/moe/router.py:179
↓ 1 callersMethodas_array
(self)
pretrain/megatron/legacy/data/realm_dataset_utils.py:89
↓ 1 callersMethodas_tuple
(self)
pretrain/megatron/legacy/data/realm_dataset_utils.py:92
↓ 1 callersFunctionassert_viewless_tensor
Assert that a tensor is not a view (i.e., its '._base' field is not set).
pretrain/megatron/core/utils.py:137
↓ 1 callersFunctionattention_mask_func
(attention_scores, attention_mask)
pretrain/megatron/legacy/model/utils.py:31
↓ 1 callersFunctionattn_mask_postprocess
(attn_mask)
pretrain/megatron/legacy/model/t5_model.py:21
↓ 1 callersFunctionattn_mask_postprocess
(attn_mask)
pretrain/megatron/core/models/T5/t5_model.py:414
↓ 1 callersMethodaux_loss_load_balancing
Apply loss-based load balancing to the logits tensor. Args: logits (torch.Tensor): The logits tensor. Returns:
pretrain/megatron/core/transformer/moe/router.py:138
↓ 1 callersFunctionaverage_losses_across_data_parallel_group
Reduce a tensor of losses across all GPUs.
pretrain/megatron/training/utils.py:96
↓ 1 callersMethodbackward
(ctx, *grad_output)
pretrain/megatron/core/tensor_parallel/mappings.py:417
↓ 1 callersFunctionbeam_search
(model, prompts=None, tokens_to_generate=0, beam_size=0, add_BOS=False, stop_token=50256, num_return_gen=1, le
pretrain/megatron/inference/text_generation/api.py:184
↓ 1 callersFunctionbeam_search_and_post_process
Run beam search and post-process outputs, i.e., detokenize, move to cpu and convert to list.
pretrain/megatron/inference/text_generation/api.py:153
↓ 1 callersFunctionbeam_search_and_return_on_first_stage
(model, tokens, lengths, beam_size, stop_token, num_return_gen, length_penalty, prevent_newline_after_colon=Tr
pretrain/megatron/inference/text_generation/generation.py:291
↓ 1 callersMethodbert_extended_attention_mask
Creates the extended attention mask Converts the attention mask of dimension [batch size, 1, seq len] to [batch size, 1, seq len, seq len] an
pretrain/megatron/core/models/bert/bert_model.py:143
↓ 1 callersMethodbert_position_ids
(self, token_ids)
pretrain/megatron/core/models/bert/bert_model.py:169
↓ 1 callersFunctionbias_dropout_add_fused_train
(x: torch.Tensor, bias: Optional[torch.Tensor],
pretrain/megatron/legacy/model/transformer.py:836
↓ 1 callersFunctionbias_dropout_add_unfused
(training)
pretrain/megatron/core/fusions/fused_bias_dropout.py:41
↓ 1 callersFunctionbias_geglu
(bias, y)
pretrain/megatron/core/fusions/fused_bias_geglu.py:23
↓ 1 callersFunctionbias_geglu_back
(g, y, bias)
pretrain/megatron/core/fusions/fused_bias_geglu.py:43
↓ 1 callersFunctionbias_gelu
(bias, y)
pretrain/megatron/core/fusions/fused_bias_gelu.py:17
↓ 1 callersFunctionbias_gelu_back
(g, bias, y)
pretrain/megatron/legacy/model/fused_bias_gelu.py:24
↓ 1 callersFunctionbias_gelu_back
(g, bias, y)
pretrain/megatron/core/fusions/fused_bias_gelu.py:26
↓ 1 callersFunctionbias_swiglu
(y, bias)
pretrain/megatron/core/fusions/fused_bias_swiglu.py:18
↓ 1 callersFunctionbias_swiglu_back
(g, y, bias)
pretrain/megatron/core/fusions/fused_bias_swiglu.py:35
↓ 1 callersFunctionbiencoder_model_provider
Build the model.
pretrain/megatron/legacy/model/biencoder_model.py:36
↓ 1 callersMethodbpe
(self, token)
pretrain/megatron/training/tokenizer/gpt2_tokenization.py:195
↓ 1 callersFunctionbroadcast_int_list
Broadcast a list of interger values.
pretrain/megatron/inference/text_generation/communication.py:174
↓ 1 callersMethodbroadcast_params
Syncs parameters across all DP ranks.
pretrain/megatron/core/distributed/distributed_data_parallel.py:255
↓ 1 callersFunctionbuild_block_db
Split each document within block into consecutive retro_gpt_chunk_length size chunks. Args: config (RetroPreprocessingConfig): For DB bui
pretrain/megatron/core/datasets/retro/db/build.py:165
↓ 1 callersFunctionbuild_data_loader
Data loader. Note that batch-size is the local (per GPU) batch-size.
pretrain/megatron/legacy/model/vision/knn_monitor.py:11
↓ 1 callersFunctionbuild_gpt_chunk_datasets_from_gpt_datasets
Get train, valid, test GPT chunk datasets. Args: project_dir (str): Retro project dir. gpt_datasets (dict): Mapping of 'train', '
pretrain/megatron/core/datasets/retro/query/gpt_chunk_dataset.py:82
↓ 1 callersFunctionbuild_individual_db
Process a single indexed dataset & extract chunks. Args: config (RetroPreprocessingConfig): Retro preprocessing config. dataset_i
pretrain/megatron/core/datasets/retro/db/build.py:271
↓ 1 callersFunctionbuild_individual_dbs
Iterate each indexed dataset & process its chunks. Args: config (RetroPreprocessingConfig): Retro preprocessing config. indexed_d
pretrain/megatron/core/datasets/retro/db/build.py:372
↓ 1 callersMethodbuild_low_level_dataset
Abstract method implementation Args: dataset_path (str): The real path prefix to the IndexedDataset .bin and .idx files
pretrain/megatron/core/datasets/gpt_dataset.py:217
↓ 1 callersFunctionbuild_merged_dbs
Merge individual dataset components into single database. This method merges databases for DB types: - 'sampled': used for training the vecto
pretrain/megatron/core/datasets/retro/db/build.py:580
↓ 1 callersFunctionbuild_num_microbatches_calculator
(args)
pretrain/megatron/training/microbatches.py:9
↓ 1 callersFunctionbuild_sample
Convert to numpy and return a sample consumed by the batch producer.
pretrain/megatron/legacy/data/orqa_wiki_dataset.py:105
↓ 1 callersFunctionbuild_tokenizer
Initialize tokenizer.
pretrain/megatron/training/tokenizer/tokenizer.py:15
↓ 1 callersFunctionbuild_tokens_types_paddings_from_ids
Build token types and paddings, trim if needed, and pad if needed.
pretrain/megatron/legacy/data/orqa_wiki_dataset.py:68
↓ 1 callersFunctionbuild_tokens_types_paddings_from_text
Build token types and paddings, trim if needed, and pad if needed.
pretrain/megatron/legacy/data/orqa_wiki_dataset.py:51
↓ 1 callersFunctionbuild_train_valid_test_data_loaders
Build pretraining data loaders.
pretrain/megatron/training/training.py:1324
↓ 1 callersFunctionbuild_train_valid_test_datasets
Build pretraining datasets.
pretrain/megatron/training/training.py:1314
↓ 1 callersFunctionbytes_to_unicode
Returns list of utf-8 byte and a corresponding list of unicode strings. The reversible bpe codes work on unicode strings. This means you
pretrain/megatron/training/tokenizer/gpt2_tokenization.py:55
↓ 1 callersFunctioncalc_params_l2_norm
Calculate l2 norm of parameters
pretrain/megatron/training/utils.py:48
↓ 1 callersMethodcancel_gradients_last_layer
(self, iteration)
pretrain/megatron/legacy/model/vision/dino.py:278
↓ 1 callersFunctioncheck_adlr_autoresume_termination
Check for autoresume signal and exit if it is received.
pretrain/megatron/training/utils.py:143
↓ 1 callersFunctioncheck_checkpoint_args
Ensure fixed arguments for a model are the same for the input arguments and the one retrieved from checkpoint.
pretrain/megatron/training/checkpointing.py:36
↓ 1 callersFunctionchunk_offset
(sharding)
pretrain/megatron/core/dist_checkpointing/serialization.py:436
↓ 1 callersFunctionclear_aux_losses_tracker
Clear the auxiliary losses.
pretrain/megatron/core/transformer/moe/moe_utils.py:175
↓ 1 callersFunctionclip_grad_norm_fp32
Clips gradient norm of an iterable of parameters whose gradients are in fp32. This is adapted from torch.nn.utils.clip_grad.clip_grad_norm
pretrain/megatron/core/optimizer/clip_grads.py:17
↓ 1 callersMethodcode_from_dtype
Get the code from the dtype Args: value (Type[numpy.number]): The dtype Returns: int: The code
pretrain/megatron/core/datasets/indexed_dataset.py:43
↓ 1 callersFunctioncompile_helpers
Compile C++ helper functions at runtime. Make sure this is invoked on a single process.
pretrain/megatron/core/datasets/utils.py:19
↓ 1 callersFunctioncompute_activation_memory
(args, num_microbatches, verbose=False)
pretrain/megatron/training/theoretical_memory_usage.py:79
↓ 1 callersFunctioncompute_feature_bank
(model)
pretrain/megatron/legacy/model/vision/knn_monitor.py:37
↓ 1 callersFunctioncompute_throughputs_and_append_to_progress_log
(iteration, num_floating_point_operations_so_far)
pretrain/megatron/training/training.py:826
↓ 1 callersFunctioncompute_weight_and_optimizer_memory
(args, verbose=False)
pretrain/megatron/training/theoretical_memory_usage.py:11
↓ 1 callersFunctioncondition
(model, attr)
pretrain/megatron/core/utils.py:35
↓ 1 callersMethodconvert_tokens_to_string
Converts a sequence of tokens (string) in a single string.
pretrain/megatron/training/tokenizer/bert_tokenization.py:185
↓ 1 callersFunctioncopy_to_tensor_model_parallel_region
(input_)
pretrain/megatron/core/tensor_parallel/mappings.py:431
↓ 1 callersFunctioncore_config_from_args
Builds core config object from namespace args from given dataclass Raises exception if argument missing in args Args: args(SimpleNam
pretrain/megatron/training/yaml_arguments.py:389
↓ 1 callersFunctioncore_gpt_dataset_config_from_args
(args)
pretrain/pretrain_gpt.py:166
↓ 1 callersFunctioncore_transformer_config_from_yaml
(args, transfomer_key = "language_model")
pretrain/megatron/training/yaml_arguments.py:413
↓ 1 callersFunctioncosine_scheduler
(base_value, final_value, epochs, niter_per_ep, warmup_epochs=0, start_warmup_value=0)
pretrain/megatron/legacy/model/vision/dino.py:159
↓ 1 callersFunctioncount_zeros_fp32
Counts the number of zeros in gradients associated with the passed-in list of parameters. Args: parameters (Iterable[Tensor] or Tenso
pretrain/megatron/core/optimizer/clip_grads.py:114
↓ 1 callersMethodcreate_attn_mask
(self, H, W)
pretrain/megatron/legacy/model/vision/esvit_swin_backbone.py:229
↓ 1 callersFunctioncustom_backward
Directly call C++ autograd engine. To make the 'deallocate_output_tensor' (above) optimization work, the C++ autograd engine must be called d
pretrain/megatron/core/pipeline_parallel/schedules.py:121
↓ 1 callersFunctioncyclic_iter
(iter)
pretrain/megatron/training/training.py:1287
↓ 1 callersFunctiondecoder_model_with_local_spec
T5 decoder local spec (uses Megatron-Core components).
pretrain/megatron/core/models/T5/t5_spec.py:134
↓ 1 callersFunctiondecoder_model_with_transformer_engine_default_spec
T5 decoder TE spec (uses Transformer Engine components).
pretrain/megatron/core/models/T5/t5_spec.py:59
↓ 1 callersMethoddeduplicate_chunks
Group tensors by chunk and then pick the tensor with the lowest rank. NOTE: with proper loading overlap, loading from randomized ranks
pretrain/megatron/core/dist_checkpointing/strategies/two_stage.py:179
↓ 1 callersMethoddefault_decoder_cross_attention
Cross attention for a standard encoder-decoder model.
pretrain/megatron/legacy/model/transformer.py:934
↓ 1 callersMethoddetokenize
Convert embedding ids to text Args: ids (numpy.ndarray): The ids to convert Returns: str: The converted text
pretrain/megatron/core/datasets/megatron_tokenizer.py:45
↓ 1 callersMethoddetokenize
(self, token_ids)
pretrain/megatron/training/tokenizer/tokenizer.py:126
↓ 1 callersFunctionembed_block
Embed block of chunks. Args: config (RetroPreprocessingConfig): Retro preprocessing config. gpt_dataset (GPTChunkDataset): Chunk
pretrain/megatron/core/datasets/retro/query/query.py:69
↓ 1 callersMethodembed_block
Embed a batch of tokens using the block model
pretrain/megatron/legacy/model/realm_model.py:81
↓ 1 callersMethodembed_query
Embed a batch of tokens using the query model
pretrain/megatron/legacy/model/realm_model.py:72
↓ 1 callersFunctionembed_training_chunks
Embed DB chunks. Store chunks in blocks on disk. These blocks will later be merged into a single dataset for training the index. Args:
pretrain/megatron/core/datasets/retro/index/build.py:134
↓ 1 callersMethodenable_pre_hook
(self)
pretrain/megatron/core/optimizer/optimizer.py:768
← previousnext →601–700 of 2,110, ranked by callers