MCPcopy Create free account

hub / github.com/JinjieNi/MegaDLMs / functions

Functions4,219 in github.com/JinjieNi/MegaDLMs

↓ 4 callersMethodvocab_range_from_global_vocab_size
Vocab range from global vocab size.
megatron/core/tensor_parallel/utils.py:106
↓ 3 callersMethod__enter__
(self)
megatron/training/dist_signal_handler.py:61
↓ 3 callersMethod__enter__
(self)
tests/unit_tests/dist_checkpointing/__init__.py:59
↓ 3 callersMethod__init__
(self, model_type, layer_schema)
tools/checkpoint/schema_core.py:19
↓ 3 callersMethod__init__
(self, out_dim, ncrops, warmup_teacher_temp, teacher_temp, warmup_teacher_temp_epochs, nepoch
megatron/legacy/model/vision/dino.py:24
↓ 3 callersMethod__init__
( self, input_size: int, output_size: int, *, config: ModelParallelCon
megatron/core/tensor_parallel/layers.py:1025
↓ 3 callersMethod__init__
(self, inner_dicts: List[dict])
megatron/core/optimizer/optimizer.py:904
↓ 3 callersFunction_allocate_recv_buffer
Receive happens between the layers with size [s, b, h].
megatron/inference/text_generation/forward_step.py:170
↓ 3 callersMethod_allocate_recv_buffer
Receive happens between the layers with size [seq_len, batch_size, hidden_size].
megatron/core/inference/model_inference_wrappers/abstract_model_inference_wrapper.py:99
↓ 3 callersFunction_apply_rotary_pos_emb_bshd
Apply rotary positional embedding to input tensor T. check https://kexue.fm/archives/8265 for detailed formulas Args: t (Tensor): In
megatron/core/models/common/embeddings/rope_utils.py:88
↓ 3 callersFunction_bias_dropout_add_func
(x_with_bias, residual, prob, training)
megatron/core/fusions/fused_bias_dropout.py:9
↓ 3 callersMethod_broadcast
Broadcast data from TP rank 0 to other ranks.
tests/functional_tests/test_cases/common/ckpt_converter/__main__.py:232
↓ 3 callersMethod_build_megatron_dataset_splits
Build each MidLevelDataset split from a single LowLevelDataset Args: dataset_path (Optional[str]): The path on disk which defines
megatron/core/datasets/blended_megatron_dataset_builder.py:388
↓ 3 callersMethod_cast_value
Casts weights to the expected datatype. When appropriate scaling factor is found inside self.scales, the weight gets scaled before the cas
megatron/core/export/trtllm/trtllm_weights_converter/single_device_trtllm_model_weights_converter.py:88
↓ 3 callersFunction_deinit_distributed
()
tests/unit_tests/test_utils.py:63
↓ 3 callersFunction_download_file
Download the object at the given S3 path to the given local file system path Args: client (S3Client): The S3 client s3_path (str
megatron/core/datasets/utils_s3.py:103
↓ 3 callersMethod_get_actual
(self, loss_type)
tests/functional_tests/python_test_utils/test_fp8_ci_pipeline.py:28
↓ 3 callersMethod_get_global_min_max_time
Report only min and max times across all ranks.
megatron/core/timers.py:260
↓ 3 callersFunction_get_iterator
Return dataset iterator.
megatron/training/training_nan_skipping.py:2039
↓ 3 callersFunction_get_iterator
Return dataset iterator.
megatron/training/training.py:2164
↓ 3 callersMethod_get_layers
(self, model)
tools/checkpoint/schema_base.py:52
↓ 3 callersFunction_get_ltor_masks_and_position_ids
Build masks and position id for left to right model. Args: data (torch.Tensor): The data tenor that holds the tokens from the dataset
megatron/core/datasets/gpt_dataset.py:634
↓ 3 callersMethod_get_main_param_and_optimizer_states
Return a dict containing the main param and optimizer states corresponding to the input model_param. The structure of the returned di
megatron/core/optimizer/distrib_optimizer.py:738
↓ 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.
megatron/core/optimizer/distrib_optimizer.py:562
↓ 3 callersFunction_get_tn
args: y_true : 3-d ndarray in [batch_size, img_rows, img_cols] y_pred : 3-d ndarray in [batch_size, img_rows, img_cols] retur
tasks/vision/segmentation/metrics.py:58
↓ 3 callersFunction_init_distributed
(world, rank)
tests/unit_tests/test_utils.py:53
↓ 3 callersFunction_is_cuda_contiguous
Check if a tensor is not none, is cuda, and is contiguous.
megatron/inference/text_generation/communication.py:50
↓ 3 callersFunction_normalize
(text)
tasks/orqa/unsupervised/qa_utils.py:176
↓ 3 callersFunction_pad_bucket_if_needed
(numel_unpadded)
tests/unit_tests/distributed/test_param_and_grad_buffer.py:90
↓ 3 callersMethod_populate_vocab
(self)
megatron/training/tokenizer/tokenizer.py:361
↓ 3 callersMethod_query_document_sample_shuffle_indices
Get the text (token ids) and document ids for a given index Args: idx (int): The index into the dataset Returns:
megatron/core/datasets/gpt_dataset.py:247
↓ 3 callersFunction_reduce
All-reduce the input tensor across model parallel group.
megatron/core/tensor_parallel/mappings.py:23
↓ 3 callersFunction_reduce_scatter_along_last_dim
Reduce-scatter tensors on the last dimension.
megatron/core/tensor_parallel/mappings.py:100
↓ 3 callersFunction_reshard_if_dtensor
Reshards the input tensor to match the sharding configuration of the reference tensor if the reference tensor is a DTensor. Otherwise, return
megatron/core/distributed/finalize_model_grads.py:40
↓ 3 callersFunction_set_elem
(target, k, v)
megatron/core/dist_checkpointing/dict_utils.py:31
↓ 3 callersMethod_set_main_param_and_optimizer_states
Set the main param and optimizer states corresponding to the input model_param. The structure of the input `tensors`: tensors = {
megatron/core/optimizer/distrib_optimizer.py:762
↓ 3 callersMethod_set_mips_index
Create a Faiss Flat index with inner product as the metric to search against
megatron/legacy/data/realm_index.py:131
↓ 3 callersMethod_setup
(self)
tests/functional_tests/python_test_utils/test_fp8_ci_pipeline.py:21
↓ 3 callersFunction_split_along_first_dim
Split the tensor along its first dimension and keep the corresponding slice.
megatron/core/tensor_parallel/mappings.py:55
↓ 3 callersFunction_split_along_last_dim
Split the tensor along its last dimension and keep the corresponding slice.
megatron/core/tensor_parallel/mappings.py:36
↓ 3 callersFunction_unshard_if_dtensor
Unshards the input tensor if it is a DTensor and otherwise returns the tensor unmodified. Args: tensor (Union[torch.Tensor, DTen
megatron/core/distributed/finalize_model_grads.py:20
↓ 3 callersFunction_yarn_get_mscale
(scale: float = 1, mscale: float = 1)
megatron/core/models/common/embeddings/yarn_rotary_pos_embedding.py:176
↓ 3 callersFunctionaccuracy_func_provider
Provide function that calculates accuracies.
tasks/orqa/supervised/eval_utils.py:78
↓ 3 callersMethodadd_item
Add a single item to the dataset Args: tensor (torch.Tensor): The item to add to the data file mode (int, optional):
megatron/core/datasets/indexed_dataset.py:767
↓ 3 callersMethodadd_request
Add an incoming request This method will add the request to either the active pool or the waiting pool depending on the batch size.
megatron/core/inference/scheduler.py:31
↓ 3 callersMethodadd_token
(self, token)
megatron/training/tokenizer/tokenizer.py:210
↓ 3 callersFunctionapply_prefix_mapping
Replaces prefixes *only in keys matching* with one of prefixes in the map. Args: sharded_state_dict (ShardedStateDict): sharded state dic
megatron/core/dist_checkpointing/utils.py:196
↓ 3 callersFunctionapply_rotary_pos_emb_with_cos_sin
This function applies rotary positional embedding to the target tensor t using precomputed cos and sin of size (seq_len, d_rot / 2)
megatron/core/models/common/embeddings/rope_utils.py:229
↓ 3 callersFunctionapply_swiglu_sharded_factory
(original_sh_ten, sharded_offsets)
megatron/core/transformer/mlp.py:147
↓ 3 callersMethodaux_loss_test
(self, input, baseline_grad)
tests/unit_tests/transformer/moe/test_aux_loss.py:22
↓ 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
megatron/core/pipeline_parallel/schedules.py:930
↓ 3 callersFunctionbeam_search_and_post_process
Run beam search and post-process outputs, i.e., detokenize, move to cpu and convert to list.
megatron/inference/text_generation/api.py:172
↓ 3 callersFunctionbias_geglu_impl
(input, bias)
megatron/core/fusions/fused_bias_geglu.py:76
↓ 3 callersFunctionbias_swiglu_impl
(input, bias, fp8_input_store=False)
megatron/core/fusions/fused_bias_swiglu.py:76
↓ 3 callersFunctionbroadcast_float_list
Broadcast a list of float values. Args: data_parallel (bool): Broadcast across a single data parallel model replica.
megatron/inference/text_generation/communication.py:221
↓ 3 callersFunctionbroadcast_int_list
Broadcast a list of integer values. Args: data_parallel (bool): Broadcast across a single data parallel model replica.
megatron/inference/text_generation/communication.py:210
↓ 3 callersFunctionbuild_data_loader
Data loader. Note that batch-size is the local (per GPU) batch-size.
tasks/finetune_utils.py:72
↓ 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
megatron/core/datasets/blended_megatron_dataset_builder.py:453
↓ 3 callersFunctionbuild_split_dataset
(index, name)
megatron/legacy/data/dataset_utils.py:501
↓ 3 callersFunctionbuild_tokens_types_paddings_from_ids
Build token types and paddings, trim if needed, and pad if needed.
tasks/orqa/supervised/data.py:57
↓ 3 callersFunctioncalc_params_l2_norm
Calculate l2 norm of parameters
megatron/training/utils.py:69
↓ 3 callersFunctioncheck_and_append_tensor_for_gather
(group, rank, world_size, input_)
tasks/orqa/supervised/finetune.py:24
↓ 3 callersFunctioncheck_and_clean_text
(args, words, ngrams, text, start_position, \ text_buf_ngram_free, text_buf, local_ngram)
tools/openwebtext/filter_ngrams.py:51
↓ 3 callersFunctioncheck_files_exist
(in_ss_out_names, key, num_partitions)
tools/preprocess_data.py:249
↓ 3 callersMethodcleanup
(self, override_sync: Optional[bool] = None)
tests/unit_tests/dist_checkpointing/__init__.py:49
↓ 3 callersFunctioncommon_test_parallel_reconfiguration_e2e
Test model saving and loading with different TP/PP
tests/unit_tests/dist_checkpointing/models/common.py:52
↓ 3 callersMethodconfigure
This method is called to configure the Singleton instance It should be called once per instantiation per process. Note:
megatron/core/utils.py:834
↓ 3 callersFunctionconvert_to_unicode
Converts `text` to Unicode (if it's not already), assuming utf-8 input.
megatron/training/tokenizer/bert_tokenization.py:81
↓ 3 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.
megatron/inference/text_generation/communication.py:129
↓ 3 callersFunctioncore_transformer_config_from_yaml
(args, transfomer_key = "language_model")
megatron/training/yaml_arguments.py:412
↓ 3 callersMethodcount_zeros
Count number of zeros in model's gradients.
megatron/core/optimizer/optimizer.py:212
↓ 3 callersFunctioncreate_cudagraphs
Should be called at the end of each schedule function, (e.g. forward_backward_pipelining_with_interleaving) in `megatron.core.pipeline_paralle
megatron/core/transformer/cuda_graphs.py:195
↓ 3 callersFunctiondetach
(tensor)
megatron/legacy/data/realm_index.py:14
↓ 3 callersFunctiondetermine_main_replica_uniform_distribution
Computes the save distribution. Should be used in conjunction with `distribute_main_replicas_with_precomputed_distribution` which applies the
megatron/core/dist_checkpointing/exchange_utils.py:168
↓ 3 callersFunctiondetokenize_generations
Detokenize the generated tokens.
megatron/inference/text_generation/tokenization.py:14
↓ 3 callersFunctiondisable_grad_sync
Disable asynchronous grad reductions
megatron/core/pipeline_parallel/schedules.py:619
↓ 3 callersFunctiondummy_jsonl
(odir)
tests/unit_tests/data/test_preprocess_data.py:33
↓ 3 callersMethodembed_text
Embed a batch of tokens using the model
megatron/legacy/model/biencoder_model.py:136
↓ 3 callersMethodembed_text_dataset
Embed a text dataset.
tools/bert_embedding/embed.py:188
↓ 3 callersMethodenable_forward_pre_hook
Enable forward pre-hooks needed for param all-gather overlap with forward compute.
megatron/core/distributed/distributed_data_parallel.py:297
↓ 3 callersFunctionevaluate_and_print_results
Helper function to evaluate and dump results on screen.
megatron/training/training_nan_skipping.py:1879
↓ 3 callersFunctionextract_nonpersistent
Extract a dict consisting of only LocalNonpersistentObjects from a given state dict. Args: sharded_state_dict: state dict possibly contai
megatron/core/dist_checkpointing/utils.py:131
↓ 3 callersFunctionextract_sharded_base
Extract a dict consisting of only ShardedBase from a given state dict with any objects. Args: sharded_state_dict: state dict possibly con
megatron/core/dist_checkpointing/utils.py:115
↓ 3 callersMethodflash_decoding
The flash decoding kernel will do the following in a single execution: 1. Compute RoPE embedding with precomputed cos & sin tensors
megatron/core/transformer/attention.py:287
↓ 3 callersMethodflops
(self)
megatron/legacy/model/vision/swin_backbone.py:414
↓ 3 callersMethodforward_model
Forward pass data, and gather parallel output tensors.
tests/functional_tests/test_cases/common/ckpt_converter/__main__.py:332
↓ 3 callersFunctionforward_step_helper
Helper method to run forward step with model split into chunks (run set_virtual_pipeline_model_parallel_rank() before calling forward_
megatron/core/pipeline_parallel/schedules.py:858
↓ 3 callersFunctionforward_torch_softmax
(input, mask, scale)
megatron/legacy/fused_kernels/tests/test_fused_kernels.py:287
↓ 3 callersFunctiongather_from_tensor_model_parallel_region
Wrapper for autograd function: forward: AG, backward: split <last dim>
megatron/core/tensor_parallel/mappings.py:482
↓ 3 callersMethodgenerate_all_output_tokens_static_batch
Utility to generate the all the output tokens and probabilities for the prompts . This utility generates the output tokens for a static batch
megatron/core/inference/text_generation_controllers/text_generation_controller.py:240
↓ 3 callersFunctionget_all_true_mask
(size, device)
megatron/core/models/retro/utils.py:23
↓ 3 callersFunctionget_batch_on_this_cp_rank
Slice batch input along sequence dimension into multiple chunks, which are parallelized across GPUs in a context parallel group.
megatron/core/utils.py:1423
↓ 3 callersFunctionget_checkpoint_version
()
megatron/training/checkpointing.py:73
↓ 3 callersMethodget_cos_sin
Cosine and sine values for RoPE are precomputed for all positions up to the maximum sequence length
megatron/core/models/common/embeddings/rotary_pos_embedding.py:130
↓ 3 callersFunctionget_data_parallel_group_if_dtensor
Gets the data parallel group of the given tensor if it is a DTensor.
megatron/core/utils.py:495
↓ 3 callersFunctionget_data_parallel_world_size
Return world size for the data parallel group.
megatron/core/parallel_state.py:1511
↓ 3 callersMethodget_db_dataset
(cls)
tools/retro/cli/cli.py:106
↓ 3 callersFunctionget_db_dir
Sub-directory for DB data. Args: project_dir (str): Path to Retro project dir. Returns: Path of the DB sub-directory within
megatron/core/datasets/retro/db/utils.py:20
↓ 3 callersFunctionget_difflm_layer_with_transformer_engine_spec
Use this spec to use lower-level Transformer Engine modules (required for fp8 training). Args: num_experts (int, optional): Number of ex
megatron/core/models/difflm/gpt_layer_specs.py:148
↓ 3 callersMethodget_empty_index
Get empty index (i.e., trained, but unpopulated). Args: config (RetroPreprocessingConfig): Retro preprocessing config. R
megatron/core/datasets/retro/index/index.py:65
← previousnext →401–500 of 4,219, ranked by callers