MCPcopy Create free account

hub / github.com/JinjieNi/MegaDLMs / functions

Functions4,219 in github.com/JinjieNi/MegaDLMs

↓ 2 callersFunctionpretrain
( train_valid_test_dataset_provider, model_provider, model_type, forward_step_func, proces
megatron/training/training.py:442
↓ 2 callersMethodprint_processing_stats
(self, count, proc_start, total_bytes_processed)
tools/preprocess_data.py:117
↓ 2 callersFunctionprint_progress
(prefix, start_time, urls_counter, domain_blacklist_counter, extention_b
tools/openwebtext/blacklist_urls.py:223
↓ 2 callersFunctionprint_progress
(prefix, start_time, num_docs, num_fixed_text, num_non_english_docs, chars_non_english_docs
tools/openwebtext/cleanup_dataset.py:17
↓ 2 callersFunctionprint_rank_0
If distributed is initialized, print only on rank 0.
megatron/core/datasets/gpt_dataset.py:26
↓ 2 callersMethodprint_stats
Return a string describing the data distribution.
megatron/core/rerun_state_machine.py:933
↓ 2 callersFunctionprocess_batch
Process batch and produce inputs for the model.
tasks/finetune_utils.py:26
↓ 2 callersFunctionprocess_batch
Process batch and produce inputs for the model.
tasks/orqa/supervised/eval_utils.py:51
↓ 2 callersFunctionprocess_batch
Process batch and produce inputs for the model.
tasks/zeroshot_gpt/evaluate.py:50
↓ 2 callersFunctionprocess_batch
Process batch and produce inputs for the model.
tasks/vision/segmentation/finetune_segformer.py:74
↓ 2 callersFunctionprocess_batch
Process batch and produce inputs for the model.
tasks/vision/segmentation/finetune_setr.py:40
↓ 2 callersFunctionread_prompts
Read prompt data
tasks/msdp/prompt.py:39
↓ 2 callersFunctionrecreate_state_dict_after_load
Creates a final sharded state dictionary from a tensor-aware state dictionary. Args: sharded_state_dict (ShardedStateDict): T
megatron/core/dist_checkpointing/state_dict_transformation.py:178
↓ 2 callersFunctionrecv_forward
Receive tensor from previous rank in pipeline (forward receive). See _communicate for argument details.
megatron/core/pipeline_parallel/p2p_communication.py:412
↓ 2 callersFunctionrecv_from_prev_pipeline_rank_
Receive from previous pipeline stage and update the input buffer inplace.
megatron/core/inference/communication_utils.py:28
↓ 2 callersFunctionreformat_prompt
(query, neighbours, dataset_name, ft_neighbours, \ max_output_len, tokenizer, max_seq_leng
tools/retro/sft/dataset_conv.py:331
↓ 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
megatron/core/distributed/param_and_grad_buffer.py:382
↓ 2 callersFunctionremove_iter_ckpts
(invalid_folders)
megatron/training/checkpointing.py:611
↓ 2 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
tools/weights_conversion/hf_configs/gptneox_1.7b_dlm/modeling_dlm.py:119
↓ 2 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
tools/weights_conversion/hf_configs/gptneox_1.7b_ar/modeling_ar.py:113
↓ 2 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
tools/weights_conversion/hf_configs/gpt2_1b_dlm/modeling_dlm.py:119
↓ 2 callersFunctionreport_memory
Simple GPU memory report.
megatron/training/utils.py:185
↓ 2 callersMethodrequires_explicit_ckpt_mismatch_check
Whether a given strict flag involves mismatch check against the checkpoint.
megatron/core/dist_checkpointing/validation.py:88
↓ 2 callersMethodreset
Zero out the underlying grad_buffer.
megatron/core/distributed/param_and_grad_buffer.py:724
↓ 2 callersFunctionrestore_nd_flattened_tensors_formulation
Restores the original state dict from a reformulated form. Inverse of `apply_nd_flattened_tensors_reformulation`. Args: state_dict (
megatron/core/dist_checkpointing/strategies/resharding.py:165
↓ 2 callersFunctionretro_generate_and_post_process
Run inference and post-process outputs, i.e., detokenize, move to cpu and convert to list.
tools/retro/text_generation/retro_api.py:96
↓ 2 callersMethodrewind
Method to rewind the data iterator to the first microbatch of the iteration.
megatron/core/rerun_state_machine.py:855
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
tools/weights_conversion/hf_configs/gptneox_1.7b_dlm/modeling_dlm.py:85
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
tools/weights_conversion/hf_configs/gptneox_1.7b_ar/modeling_ar.py:79
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
tools/weights_conversion/hf_configs/gpt2_1b_dlm/modeling_dlm.py:85
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
megatron/core/models/common/embeddings/rope_utils.py:308
↓ 2 callersFunctionrouter_function
(self, state)
megatron/core/transformer/custom_layers/ut_modules.py:1293
↓ 2 callersFunctionrun_tokenizer_tests
(tok)
tests/unit_tests/test_tokenizer.py:138
↓ 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.
megatron/core/utils.py:255
↓ 2 callersFunctionsample
Sample and generate a token. Note: logits has the dimension [b, v] where b is the batch size and v is the vocabulary size. If vocab
megatron/inference/text_generation/sampling.py:45
↓ 2 callersFunctionsample_blocks
Sample a random subset of all blocks. Args: _blocks (List[Optional[Dict]]): List of all blocks. Returns:
megatron/core/datasets/retro/utils.py:264
↓ 2 callersFunctionsave_preprocess
Preprocesses the given state dictionary by applying factories, discarding non-persistent data and extracting the common state dictionary. Opti
megatron/core/dist_checkpointing/state_dict_transformation.py:34
↓ 2 callersFunctionscore_and_return_on_first_stage
Function for just scoring. Args: model: no interleaving is supported. tokens: prompt tokens extended to be of size [b, max_prompt
megatron/inference/text_generation/generation.py:22
↓ 2 callersFunctionsend_backward
Wrapper for p2p_communication.send_backward used with non-interleaving schedule.
megatron/core/pipeline_parallel/schedules.py:1569
↓ 2 callersFunctionsend_do_generate
()
megatron/inference/endpoints/common.py:11
↓ 2 callersFunctionsend_forward
Send tensor to next rank in pipeline (forward send). See _communicate for argument details.
megatron/core/pipeline_parallel/p2p_communication.py:459
↓ 2 callersFunctionsend_forward
Wrapper for p2p_communication.send_forward used with non-interleaving schedule.
megatron/core/pipeline_parallel/schedules.py:1559
↓ 2 callersFunctionsend_to_next_pipeline_rank
Send output to the next pipeline stage.
megatron/core/inference/communication_utils.py:41
↓ 2 callersMethodset_document_indices
Set the document indices This method is slated for deprecation. Args: document_indices (numpy.ndarray): The document ind
megatron/core/datasets/indexed_dataset.py:706
↓ 2 callersMethodset_input_tensor
See megatron.model.transformer.set_input_tensor()
megatron/core/models/T5/t5_model.py:346
↓ 2 callersMethodset_layer_number
Set the layer number for the router.
megatron/core/transformer/moe/router.py:92
↓ 2 callersMethodset_shared_experts
Set shared expert to the dispatcher.
megatron/core/transformer/moe/token_dispatcher.py:103
↓ 2 callersFunctionsetup_moe_model_and_optimizer
( seed, tp, pp, ep, initialize_fn=initialize_moe_model, bf16=True, dist_opt=True,
tests/unit_tests/dist_checkpointing/utils.py:192
↓ 2 callersMethodsharded_state_dict
Generate a sharded state dictionary for the transformer block. Args: prefix (str, optional): Prefix to be added to all k
megatron/core/transformer/transformer_block.py:573
↓ 2 callersMethodsharded_state_dict
Maps local expert to global experts. The sharded_state_dict for the weight parts are compatible with the SequentialMLP, where
megatron/core/transformer/moe/experts.py:240
↓ 2 callersFunctionshingles
(text, char_ngram=5)
tools/openwebtext/find_duplicates.py:17
↓ 2 callersMethodshould_checkpoint_and_exit
Method instructing whether to checkpoint and/or abort the job. Args: None Returns: A tuple formed of:
megatron/core/rerun_state_machine.py:347
↓ 2 callersFunctionshould_continue
(halting_probability, n_updates, threshold, act_max_steps)
megatron/core/transformer/custom_layers/ut_modules.py:393
↓ 2 callersFunctionshould_continue_router
(still_running, n_updates, act_max_steps)
megatron/core/transformer/custom_layers/ut_modules.py:1285
↓ 2 callersMethodshould_run_forward_backward
Method instructing whether to (re)run the forward-backward pass. Args: data_iterator: data iterator or list of data iterators use
megatron/core/rerun_state_machine.py:225
↓ 2 callersMethodsignals_received
(self)
megatron/training/dist_signal_handler.py:55
↓ 2 callersFunctionslice_for_logging
Return just one element from each dimension (0, 0, 0, ...). If you prefer to keep the entire hidden dimension and only slice the sequence
tools/weights_conversion/utils/verify_correctness_dlm.py:36
↓ 2 callersFunctionslidingcrops
(img, mask)
tasks/vision/segmentation/utils.py:6
↓ 2 callersMethodstart_grad_sync
Initiates grad sync (all-reduce or reduce-scatter) communication operations for all buckets in the bucket group. When ddp_co
megatron/core/distributed/param_and_grad_buffer.py:246
↓ 2 callersMethodstate
(self)
megatron/legacy/data/realm_index.py:38
↓ 2 callersMethodstate_dict_for_save_checkpoint
Save dict with state dicts of each of the models.
megatron/legacy/model/realm_model.py:91
↓ 2 callersMethodstate_dict_for_save_checkpoint
For easy load when model is combined with other heads, add an extra key.
megatron/legacy/model/t5_model.py:165
↓ 2 callersMethodstate_dict_for_save_checkpoint
Save dict with state dicts of each of the models.
megatron/legacy/model/biencoder_model.py:143
↓ 2 callersMethodstep
Clip gradients (if needed) and step the base optimizer. Always return successful since there is no overflow.
megatron/core/optimizer/optimizer.py:823
↓ 2 callersMethodstep_with_ready_grads
Step the optimizer with ready gradients, return successful.
megatron/core/optimizer/optimizer.py:805
↓ 2 callersFunctionswiglu
(y)
megatron/core/fusions/fused_bias_swiglu.py:12
↓ 2 callersFunctionswiglu_back
(g, y)
megatron/core/fusions/fused_bias_swiglu.py:27
↓ 2 callersFunctiont5_position_ids
(token_ids)
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
megatron/core/models/T5/t5_model.py:438
↓ 2 callersMethodtokenize
Convert text to embedding ids Args: text (str): The text to convert Returns: numpy.ndarray: The converted em
megatron/core/datasets/megatron_tokenizer.py:35
↓ 2 callersFunctiontokenize_prompts
Tokenize prompts and make them avaiable on all ranks. Args: data_parallel (bool): Broadcast tokens across a single data parallel model re
megatron/inference/text_generation/tokenization.py:50
↓ 2 callersFunctiontrack_moe_metrics
Track the MoE metrics for logging.
megatron/core/transformer/moe/moe_utils.py:711
↓ 2 callersFunctiontrain_index
Entry point for training the index. We select whether to train a new index, or validate an existing index. Args: config (RetroPrepro
megatron/core/datasets/retro/index/build.py:207
↓ 2 callersFunctionupdate_loader_saver
(key)
tools/checkpoint/convert.py:149
↓ 2 callersMethodupdate_momentum
(self, iteration)
megatron/legacy/model/vision/dino.py:286
↓ 2 callersFunctionupdate_train_iters
(args)
megatron/training/training.py:506
↓ 2 callersFunctionurl_pairs_to_remove
(args, bucket_urls, url_doc)
tools/openwebtext/find_duplicates.py:50
↓ 2 callersFunctionvalidate_added_encodings
Validate added encodings. Steps: - Randomly sample subset of text dataset blocks. - Encode each block. - Compare against saved encodi
megatron/core/datasets/retro/index/validate.py:104
↓ 2 callersFunctionvalidate_training_embeddings
Validate training embeddings. Steps: - Randomly sample subset of text dataset blocks. - Embed each block. - Compare against saved emb
megatron/core/datasets/retro/index/validate.py:40
↓ 2 callersFunctionvocab_parallel_cross_entropy
Performs cross entropy loss when logits are split across tensor parallel ranks Args: vocab_parallel_logits: logits split across tens
megatron/core/tensor_parallel/cross_entropy.py:219
↓ 2 callersMethodvocab_range_from_per_partition_vocab_size
Vocab range from per partition vocab size.
megatron/core/tensor_parallel/utils.py:97
↓ 2 callersFunctionwgrad_compute
(all_gathered_input, grad_output, weight)
megatron/core/utils.py:570
↓ 2 callersFunctionwindow_partition
Args: x: (B, H, W, C) window_size (int): window size Returns: windows: (num_windows*B, window_size, window_size, C)
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)
megatron/legacy/model/vision/swin_backbone.py:39
↓ 2 callersFunctionwrite_args_to_tensorboard
Write arguments to tensorboard.
megatron/training/initialize.py:362
↓ 2 callersFunctionwrite_remove_urls_list
(remove_urls_list, f_out)
tools/openwebtext/find_duplicates.py:86
↓ 2 callersFunctionz_loss_func
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) for d
megatron/core/transformer/moe/moe_utils.py:135
↓ 2 callersMethodzero_grad_buffer
Zeros out all grad buffers. Needs to be called at the beginning of each training iteration.
megatron/core/distributed/data_parallel_base.py:60
↓ 2 callersMethodzero_parameters
Zero out all parameters in embedding.
megatron/legacy/model/language_model.py:189
↓ 1 callersMethod__call__
Calls the forward pass of the cudagraphed module. Args: megatron_module (torch.nn.module): The megatron module to be graphed and
megatron/core/transformer/cuda_graphs.py:730
↓ 1 callersMethod__init__
(self, ict_head_size, num_tokentypes=1, parallel_output=Tru
megatron/legacy/model/realm_model.py:41
↓ 1 callersMethod__init__
(self, config, num_tokentypes=0, parallel_output=True,
megatron/legacy/model/t5_model.py:67
↓ 1 callersMethod__init__
(self, num_tokentypes=1, parallel_output=True, only_query_m
megatron/legacy/model/biencoder_model.py:68
↓ 1 callersMethod__init__
(self, module, args)
megatron/legacy/model/module.py:165
↓ 1 callersMethod__init__
(self, config, num_tokentypes=2, add_binary_head=True,
megatron/legacy/model/bert_model.py:130
↓ 1 callersMethod__init__
(self, config, num_classes, finetune=False, pre_process=True, post_process=True)
megatron/legacy/model/vision/classification.py:16
↓ 1 callersMethod__init__
(self, config, hidden_size, num_classes)
megatron/legacy/model/vision/vit_backbone.py:33
↓ 1 callersMethod__init__
( self, root: str, transform: Optional[Callable] = None, targe
megatron/legacy/data/image_folder.py:285
↓ 1 callersMethod__init__
(self, m, n)
megatron/legacy/mpu/tests/test_layers.py:164
↓ 1 callersMethod__init__
Initialize Timer. Args: name (str): Name of the timer.
megatron/core/timers.py:77
← previousnext →901–1,000 of 4,219, ranked by callers