MCPcopy Create free account

hub / github.com/JinjieNi/MegaDLMs / functions

Functions4,219 in github.com/JinjieNi/MegaDLMs

Method_key_config_attributes
Inherited method implementation Returns: List[str]: The key config attributes
megatron/core/datasets/bert_dataset.py:67
Method_key_config_attributes
Inherited method implementation Returns: List[str]: The key config attributes
megatron/core/datasets/masked_dataset.py:126
Method_key_config_attributes
Add custom attributes for building unique dataset hash. The preprocessing split used for preprocessing will constrain the samples available f
megatron/core/datasets/retro/query/multi_split_gpt_dataset.py:97
Function_load_from_array
( sharded_tensor: ShardedTensor, checkpoint_dir: Path, load_directly_on_device: bool = False,
megatron/core/dist_checkpointing/strategies/tensorstore.py:79
Method_load_from_state_dict
(self, state_dict, prefix, *args, **kwargs)
megatron/core/models/common/embeddings/rotary_pos_embedding.py:296
Function_load_state_dict_hook_ignore_param_names
Hook to ignore missing keys during checkpoint loading. By default, this should not be used to avoid accidentally missing weights in checkpoint lo
megatron/core/models/multimodal/llava_model.py:869
Function_loss_func
(loss_mask: torch.Tensor, output_tensor: torch.Tensor)
tests/unit_tests/export/trtllm/test_single_device_fp8.py:83
Function_merge_slice
(dim_slice, dim_size)
megatron/core/dist_checkpointing/strategies/tensorstore.py:66
Function_p2p_ops
( *, tensor_send_prev: Optional[torch.Tensor], tensor_recv_prev: Optional[torch.Tensor], tenso
megatron/core/pipeline_parallel/p2p_communication.py:157
Method_pad
(number_to_be_padded: int, divisor: int)
megatron/core/distributed/param_and_grad_buffer.py:461
Method_pad_end_of_bucket_if_needed
Pads end index of bucket if using distributed optimizer (to ensure uniform sharding).
megatron/core/distributed/param_and_grad_buffer.py:464
Method_pad_start_of_param_if_needed
Pads start index of param if using distributed optimizer (to ensure "good" alignment).
megatron/core/distributed/param_and_grad_buffer.py:476
Method_prepare_4d_causal_attention_mask_with_cache_position
Creates a causal 4D mask of shape `(batch_size, 1, query_length, key_value_length)` from a 2D mask of shape `(batch_size, key_value_l
tools/weights_conversion/hf_configs/gptneox_1.7b_dlm/modeling_dlm.py:670
Method_prepare_4d_causal_attention_mask_with_cache_position
Creates a causal 4D mask of shape `(batch_size, 1, query_length, key_value_length)` from a 2D mask of shape `(batch_size, key_value_l
tools/weights_conversion/hf_configs/gpt2_1b_dlm/modeling_dlm.py:670
Function_remove_prefix_state_dict_pre_hook
Pytorch state_dict pre_hook to remove prefix of the state_dict keys.
megatron/inference/checkpointing.py:107
Function_replace_prefix
(x)
megatron/core/dist_checkpointing/utils.py:186
Function_replace_prefixes
(x)
megatron/core/dist_checkpointing/utils.py:208
Function_ring_exchange_wrapper
(**kwargs)
megatron/core/pipeline_parallel/p2p_communication.py:323
Method_safe_div
(x, y)
megatron/core/dist_checkpointing/mapping.py:380
Method_set_param_groups
(self, value)
megatron/core/optimizer/optimizer.py:276
Method_set_state
(self, value)
megatron/core/optimizer/optimizer.py:262
Function_sharded_state_dict
(self, *args, **kwargs)
megatron/inference/algos/distillation.py:439
Method_sinkhorn_activation
(logits)
megatron/core/transformer/moe/router.py:122
Method_skip
(gram)
tasks/orqa/unsupervised/tokenizers.py:102
Method_split
Splits the np tensor v on dim and return the idx's slice.
megatron/core/export/trtllm/trtllm_weights_converter/single_device_trtllm_model_weights_converter.py:391
Function_teacher_provider
Teacher model factory (must be a non-local function to pickle).
megatron/inference/gpt/model_provider.py:98
Method_threading_helper
( megatron_datasets: List[List[Optional[MegatronDataset]]], num_workers: int,
megatron/core/datasets/blended_megatron_dataset_builder.py:325
Method_update_bucket_metadata
Record metadata for the bucket starting at bucket_start_index and ending with the passed-in param_end_index. Returns the buck
megatron/core/distributed/param_and_grad_buffer.py:496
Method_update_causal_mask
( self, attention_mask: torch.Tensor, input_tensor: torch.Tensor, cache_positi
tools/weights_conversion/hf_configs/gptneox_1.7b_dlm/modeling_dlm.py:647
Method_update_causal_mask
( self, attention_mask: torch.Tensor, input_tensor: torch.Tensor, cache_positi
tools/weights_conversion/hf_configs/gpt2_1b_dlm/modeling_dlm.py:647
Method_update_tuple
(x, ind, val)
megatron/core/dist_checkpointing/mapping.py:375
Function_validate_sharding_for_key_flattened
(tensors_by_shard)
megatron/core/dist_checkpointing/validation.py:485
Functionaccuracy_func_provider
Provide function that calculates accuracies.
tasks/eval_utils.py:19
Functionaccuracy_func_provider
Provide function that calculates accuracies.
tasks/vision/classification/eval_utils.py:19
Functionaccuracy_func_provider
Provide function that calculates accuracies.
tasks/vision/segmentation/finetune_segformer.py:194
Functionaccuracy_func_provider
Provide function that calculates accuracies.
tasks/vision/segmentation/finetune_setr.py:168
Functionadacom_layer_forward
Perform the adacom forward pass through the transformer layer. Args: layer: TransformerLayer: The transformer la
megatron/core/transformer/custom_layers/ut_modules.py:35
Methodadd
Add vectors to index. Args: config (RetroPreprocessingConfig): Retro preprocessing config. text_dataset (GPTToTextDat
megatron/core/datasets/retro/index/indexes/faiss_par_add.py:190
Methodadd
Track the rng state.
megatron/core/extensions/transformer_engine.py:1152
Functionadd_arguments
(parser)
tools/checkpoint/loader_core.py:13
Functionadd_arguments
(parser)
tools/checkpoint/loader_mixtral_hf.py:12
Functionadd_arguments
(parser)
tools/checkpoint/loader_legacy.py:11
Functionadd_arguments
(parser)
tools/checkpoint/saver_core.py:12
Functionadd_arguments
(parser)
tools/checkpoint/saver_legacy.py:8
Functionadd_arguments
(parser)
tools/checkpoint/loader_llama_mistral.py:17
Functionadd_calib_args
(parser)
tasks/quantize/calibrate_gpt.py:190
Functionadd_modelopt_args
Add additional arguments for using TensorRT Model Optimizer (modelopt) features.
megatron/inference/arguments.py:4
Functionadd_prefix
(t)
megatron/core/dist_checkpointing/utils.py:162
Functionadd_retro_args
(parser)
tools/retro/preprocess_data.py:51
Methodadd_section
Add or replace a section. :param section: The new section.
tools/retro/config_utils.py:387
Functionadd_text_generate_args
(parser)
tools/run_mamba_text_generation_server.py:79
Functionadd_text_generate_args
(parser)
tools/run_text_generation_server.py:92
Functionadd_text_generate_args
Text generation arguments.
tools/retro/text_generation/retro_text_generation.py:84
Functionadd_text_generation_args
Text generation arguments.
tools/run_vlm_text_generation.py:27
Methodadd_tokentype_embeddings
Add token-type embedding. This function is provided so we can add token-type embeddings in case the pretrained model does not have it.
megatron/legacy/model/language_model.py:200
Methodadditional_special_tokens
All the additional special tokens you may want to use (list of strings).
megatron/training/tokenizer/tokenizer.py:302
Methodadditional_special_tokens_ids
Ids of all the additional special tokens in the vocabulary (list of integers).
megatron/training/tokenizer/tokenizer.py:307
Methodadditional_special_tokens_ids
(self)
megatron/training/tokenizer/tokenizer.py:516
Methodadditional_special_tokens_ids
(self)
megatron/training/tokenizer/tokenizer.py:556
Methodadditional_special_tokens_ids
(self)
megatron/training/tokenizer/tokenizer.py:606
Methodadditional_special_tokens_ids
(self)
megatron/training/tokenizer/tokenizer.py:823
Functionadjust_distillation_model_for_mcore
Extra modifcations to ``mtd.DistillationModel`` requried for Megatron-Core.
megatron/inference/algos/distillation.py:435
Functionall_gather_last_dim_from_tensor_parallel_region
Wrapper for autograd function: forward: AG, backward RS <last dim>
megatron/core/tensor_parallel/mappings.py:514
Functionall_to_all_hp2sp
Perform AlltoAll communication on tensor parallel group, transform the input tensor from shape [num_tokens, H/TP] to [num_tokens/TP, H].
megatron/core/tensor_parallel/mappings.py:554
Functionall_to_all_sp2hp
Perform AlltoAll communication on tensor parallel group, transform the input tensor from shape [num_tokens/TP, H] to [num_tokens, H/TP].
megatron/core/tensor_parallel/mappings.py:529
Methodallocate_inference_cache
Allocate inference cache for each layer. Args: batch_size (int): The batch size to use for inference. max_se
megatron/core/ssm/mamba_block.py:202
Methodallocate_inference_cache
allocate inference cache
megatron/core/ssm/mamba_mixer.py:533
Methodallocate_inference_cache
Allocate the inference cache.
megatron/core/ssm/mamba_layer.py:114
Functionapp
()
tests/unit_tests/test_inference.py:38
Functionapply
(x)
megatron/core/dist_checkpointing/mapping.py:658
Functionapply_2d_rotary_pos_emb
Applies 2D Rotary Position Embedding with Sections to the query and key tensors (adapted from https://qwenlm.github.io/blog/qwen2-vl/).
megatron/core/models/common/embeddings/rope_utils.py:263
Methodas_array
(self)
megatron/legacy/data/biencoder_dataset_utils.py:100
Methodas_tuple
(self)
megatron/legacy/data/biencoder_dataset_utils.py:103
Functionassert_grouped_gemm_is_available
Assert that grouped_gemm is available.
megatron/core/transformer/moe/grouped_gemm_util.py:14
Methodasync_save
(self, sharded_state_dict: ShardedStateDict, checkpoint_dir: Path)
megatron/core/dist_checkpointing/strategies/fully_parallel.py:76
Methodasync_save
Translates MCore ShardedTensors to PyT ShardedTensors & saves in PyT Distributed format. Args: sharded_state_dict (ShardedStateDi
megatron/core/dist_checkpointing/strategies/torch.py:637
Functionattention_mask_func
(attention_scores, attention_mask)
megatron/legacy/fused_kernels/tests/test_fused_kernels.py:282
Functionattention_mask_func
(attention_scores, attention_mask)
megatron/core/transformer/utils.py:37
Methodbackward
(ctx, output_grads)
megatron/legacy/model/fused_softmax.py:33
Methodbackward
(ctx, output_grads)
megatron/legacy/model/fused_softmax.py:69
Methodbackward
(ctx, grad_output)
megatron/legacy/model/fused_bias_gelu.py:39
Methodbackward
(ctx, output_grads)
megatron/core/fusions/fused_softmax.py:31
Methodbackward
(ctx, output_grads)
megatron/core/fusions/fused_softmax.py:61
Methodbackward
(ctx, grad_output)
megatron/core/fusions/fused_cross_entropy.py:122
Methodbackward
(ctx, grad_output)
megatron/core/fusions/fused_bias_geglu.py:56
Methodbackward
(ctx, grad_output)
megatron/core/fusions/fused_bias_geglu.py:70
Methodbackward
(ctx, grad_output)
megatron/core/fusions/fused_bias_gelu.py:44
Methodbackward
(ctx, grad_output)
megatron/core/fusions/fused_bias_swiglu.py:51
Methodbackward
(ctx, grad_output)
megatron/core/fusions/fused_bias_swiglu.py:69
Methodbackward
Backward with frozen weight.
megatron/core/tensor_parallel/layers.py:317
Methodbackward
Backward.
megatron/core/tensor_parallel/layers.py:447
Methodbackward
Vocab parallel cross entropy backward function.
megatron/core/tensor_parallel/cross_entropy.py:192
Methodbackward
(ctx, *args)
megatron/core/tensor_parallel/random.py:281
Methodbackward
Backward function.
megatron/core/tensor_parallel/mappings.py:215
Methodbackward
Backward function.
megatron/core/tensor_parallel/mappings.py:234
Methodbackward
Backward function.
megatron/core/tensor_parallel/mappings.py:253
Methodbackward
Backward function.
megatron/core/tensor_parallel/mappings.py:272
Methodbackward
Backward function.
megatron/core/tensor_parallel/mappings.py:291
Methodbackward
Backward function.
megatron/core/tensor_parallel/mappings.py:328
Methodbackward
Backward function.
megatron/core/tensor_parallel/mappings.py:368
← previousnext →2,601–2,700 of 4,219, ranked by callers