MCPcopy Create free account

hub / github.com/JinjieNi/MegaDLMs / functions

Functions4,219 in github.com/JinjieNi/MegaDLMs

↓ 1 callersMethod_clean_text
Performs invalid character removal and whitespace cleanup on text.
megatron/training/tokenizer/bert_tokenization.py:321
↓ 1 callersMethod_collect_main_grad_data_for_unscaling
(self)
megatron/core/optimizer/optimizer.py:598
↓ 1 callersFunction_communicate_shapes
Communicate tensor shapes between stages. Used to communicate tensor shapes before the actual tensor communication happens. This is required w
megatron/core/pipeline_parallel/p2p_communication.py:21
↓ 1 callersFunction_compile_dependencies
()
megatron/training/initialize.py:149
↓ 1 callersFunction_compute_shards_access
(rank_sharding)
megatron/core/dist_checkpointing/validation.py:475
↓ 1 callersMethod_controller
Installs a controller listener that is used to toggle collection state. Called from configure(). Ignored for all ranks other than rank-0
megatron/core/utils.py:1167
↓ 1 callersMethod_convert_non_transformer_layer
Convert Non Transformer layers to TRTLLM weights Non transformer layers referes to layers that occur only once in the model (e.g Embedding ,
megatron/core/export/trtllm/trtllm_weights_converter/single_device_trtllm_model_weights_converter.py:74
↓ 1 callersMethod_convert_non_transformer_layer
Convert Non Transformer layers to TRTLLM weights Non transformer layers referes to layers that occur only once in the model (e.g Embedding ,
megatron/core/export/trtllm/trtllm_weights_converter/distributed_trtllm_model_weights_converter.py:187
↓ 1 callersMethod_convert_transformer_layer
Convert Transformer layers to TRTLLM weights Transformer layers referes to layers within the transformber block. They have a layer number ass
megatron/core/export/trtllm/trtllm_weights_converter/single_device_trtllm_model_weights_converter.py:107
↓ 1 callersMethod_convert_transformer_layer
Convert Transformer layers to TRTLLM weights Transformer layers referes to layers within the transformber block. They have a layer number ass
megatron/core/export/trtllm/trtllm_weights_converter/distributed_trtllm_model_weights_converter.py:93
↓ 1 callersMethod_copy_main_params_to_model_params
(self)
megatron/core/optimizer/optimizer.py:647
↓ 1 callersMethod_copy_model_grads_to_main_grads
(self)
megatron/core/optimizer/optimizer.py:627
↓ 1 callersMethod_copy_model_params_to_main_params
(self)
megatron/core/optimizer/optimizer.py:654
↓ 1 callersMethod_correlation_test_helper
(self, loss_type)
tests/functional_tests/python_test_utils/test_fp8_ci_pipeline.py:79
↓ 1 callersFunction_create_build_dir
(buildpath)
megatron/legacy/fused_kernels/__init__.py:70
↓ 1 callersFunction_create_or_open_zarr_arrays
Returns list of zarr arrays corresponding to given tensors. For a sharded tensors that: a) is main replica and represents the first chunk (al
megatron/core/dist_checkpointing/strategies/zarr.py:82
↓ 1 callersFunction_create_zarr_array
(sharded_tensor: ShardedTensor, checkpoint_dir: Path)
megatron/core/dist_checkpointing/strategies/zarr.py:150
↓ 1 callersMethod_defer_loading_sharded_tensors
Divides state dict into parts loaded by this vs other ranks. ShardedTensors with main replica_id will be loaded by this rank, others
megatron/core/dist_checkpointing/strategies/fully_parallel.py:260
↓ 1 callersFunction_determine_missing_and_unexpected_keys
Determines load mismatches based on metadata. There is an asymmetry between "unexpected" and "missing" keys. Unexpected keys can be determine
megatron/core/dist_checkpointing/validation.py:275
↓ 1 callersMethod_distribute_data_to_state_dict
( self, ten_meta: _ShardedTensorMetadata, loaded_ten: torch.Tensor, sharded_st
megatron/core/dist_checkpointing/strategies/two_stage.py:226
↓ 1 callersMethod_dynamic_frequency_update
dynamic RoPE layers should recompute `inv_freq` in the following situations: 1 - growing beyond the cached sequence length (allow sca
tools/weights_conversion/hf_configs/gptneox_1.7b_dlm/modeling_dlm.py:334
↓ 1 callersMethod_dynamic_frequency_update
dynamic RoPE layers should recompute `inv_freq` in the following situations: 1 - growing beyond the cached sequence length (allow sca
tools/weights_conversion/hf_configs/gptneox_1.7b_ar/modeling_ar.py:325
↓ 1 callersMethod_dynamic_frequency_update
dynamic RoPE layers should recompute `inv_freq` in the following situations: 1 - growing beyond the cached sequence length (allow sca
tools/weights_conversion/hf_configs/gpt2_1b_dlm/modeling_dlm.py:334
↓ 1 callersMethod_encode
Tokenize text input.
megatron/training/tokenizer/multimodal_tokenizer.py:161
↓ 1 callersMethod_exchange_loaded_tensors
( self, ten_metas: List[_ShardedTensorMetadata], sharded_state_dict, checkpoint_dir )
megatron/core/dist_checkpointing/strategies/two_stage.py:191
↓ 1 callersMethod_find_classes
Finds the class folders in a dataset. Args: dir (string): Root directory path. Returns: tuple: (class
megatron/legacy/data/image_folder.py:191
↓ 1 callersMethod_forward
(self, tokens, position_ids, attention_mask)
megatron/inference/text_generation/forward_step.py:38
↓ 1 callersMethod_get_all_ranks_time_string
Report times across all ranks.
megatron/core/timers.py:296
↓ 1 callersFunction_get_block_submodules
Retrieve or construct TransformerBlockSubmodules based on the provided specification. Args: config (TransformerConfig): Configuratio
megatron/core/transformer/transformer_block.py:147
↓ 1 callersFunction_get_class_from_path
(subdomains, imp)
tests/unit_tests/test_imports.py:43
↓ 1 callersFunction_get_cuda_bare_metal_version
(cuda_dir)
megatron/legacy/fused_kernels/__init__.py:57
↓ 1 callersFunction_get_extra_state_offsets
Turns ShardedTensor offsets into offsets suitable for ShardedObject.
megatron/core/transformer/utils.py:140
↓ 1 callersMethod_get_global_min_max_time_string
Report strings for max/minmax times across all ranks.
megatron/core/timers.py:277
↓ 1 callersFunction_get_iter_num
(folder_name)
megatron/training/checkpointing.py:584
↓ 1 callersMethod_get_layer
(self, layer_number: int)
megatron/core/transformer/transformer_block.py:272
↓ 1 callersFunction_get_layer_type
(model_type, default_layer_type, retro_layer_numbers, layer_number)
megatron/legacy/model/transformer.py:1354
↓ 1 callersFunction_get_non_persistent_iteration
(non_persistent_global_dir, args, checkpointing_context=None)
megatron/training/checkpointing.py:807
↓ 1 callersMethod_get_num_epochs
Calculate the number of epochs Args: num_tokens_per_epoch (int): The number of tokens in a single epoch Returns:
megatron/core/datasets/gpt_dataset.py:547
↓ 1 callersFunction_get_num_layers
Compute the number of transformer layers resident on the current rank.
megatron/legacy/model/transformer.py:1325
↓ 1 callersMethod_get_num_tokens_per_epoch
Calculate the number of tokens in a single epoch Returns: int: The number of tokens in a single epoch
megatron/core/datasets/gpt_dataset.py:539
↓ 1 callersFunction_get_packed_seq_params
Get the packed sequence parameters for the given tokens.
pretrain_difflm.py:166
↓ 1 callersFunction_get_param_groups
Create parameter groups for optimizer. Creates parameter groups based on weight decay condition (regularized vs non regularized), learning ra
megatron/core/optimizer/__init__.py:44
↓ 1 callersFunction_get_recv_buffer_dtype
Receive happens between the layers.
megatron/inference/text_generation/forward_step.py:164
↓ 1 callersMethod_get_remove_vocab_padding
(self, layer_name, model_state_dict, tokenizer_vocab_size)
megatron/core/export/trtllm/trtllm_weights_converter/distributed_trtllm_model_weights_converter.py:201
↓ 1 callersMethod_get_save_and_finalize_callbacks
(self, writer, save_state_dict_ret)
megatron/core/dist_checkpointing/strategies/torch.py:701
↓ 1 callersMethod_get_states_from_cache
(self, inference_params, batch_size, initialize_states=False)
megatron/core/ssm/mamba_mixer.py:554
↓ 1 callersFunction_get_thd_freqs_on_this_cp_rank
(cp_rank: int, cp_size: int, x: Tensor, freqs: Tensor)
megatron/core/models/common/embeddings/rope_utils.py:125
↓ 1 callersMethod_get_token_mask
(self, numpy_random_state: numpy.random.RandomState)
megatron/core/datasets/masked_dataset.py:424
↓ 1 callersFunction_get_train_data_iterator
()
tests/unit_tests/export/trtllm/test_single_device_fp8.py:53
↓ 1 callersFunction_get_train_data_iterator
()
tests/unit_tests/export/trtllm/test_distributed_fp8.py:56
↓ 1 callersMethod_get_trtllm_pretrained_config_and_model_weights_in_distributed_setting
Get the TRTLLM Pretrained config and model weights list in a distributed setting This function assumes the model state dict is distributed a
megatron/core/export/trtllm/trtllm_helper.py:350
↓ 1 callersMethod_get_trtllm_pretrained_config_and_model_weights_list_on_single_device
Get the TRTLLM Pretrained config and model weights list (one per gpu rank) on single device (CPU/GPU) This function assumes the entire model
megatron/core/export/trtllm/trtllm_helper.py:425
↓ 1 callersMethod_get_validation_call_info
Internal method to get the context about the caller to validate_result().
megatron/core/rerun_state_machine.py:742
↓ 1 callersFunction_get_write_results_queue
()
megatron/core/dist_checkpointing/strategies/filesystem_async.py:30
↓ 1 callersFunction_init_autoresume
Set autoresume start time.
megatron/training/initialize.py:336
↓ 1 callersMethod_initalize
(self, vocab_extra_ids)
megatron/training/tokenizer/tokenizer.py:370
↓ 1 callersFunction_initialize_distributed
Initialize torch.distributed and core model parallel.
megatron/training/initialize.py:264
↓ 1 callersFunction_initialize_tp_communicators
initializing the communicators with user buffers for high-performance tensor-model-parallel communication overlap
megatron/training/initialize.py:221
↓ 1 callersMethod_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
megatron/training/tokenizer/bert_tokenization.py:299
↓ 1 callersFunction_is_control
Checks whether `chars` is a control character.
megatron/training/tokenizer/bert_tokenization.py:409
↓ 1 callersFunction_is_cuda
Check if a tensor is not none and is cuda.
megatron/core/inference/communication_utils.py:7
↓ 1 callersFunction_is_punctuation
Checks whether `chars` is a punctuation character.
megatron/training/tokenizer/bert_tokenization.py:421
↓ 1 callersFunction_is_whitespace
Checks whether `chars` is a whitespace character.
megatron/training/tokenizer/bert_tokenization.py:397
↓ 1 callersFunction_item_size
Calculates size (in bytes) of a single write item. Same as torch.distributed.checkpoint.filesystem._item_size, but fixes computing chunk
megatron/core/dist_checkpointing/strategies/filesystem_async.py:409
↓ 1 callersMethod_key_config_attributes
Return all config attributes which contribute to uniquely identifying the dataset. These attributes will be used to build a uniquely identify
megatron/core/datasets/megatron_dataset.py:109
↓ 1 callersFunction_layer_counts_match
(a: list, b: list)
megatron/core/ssm/mamba_hybrid_layer_allocation.py:77
↓ 1 callersFunction_load_checkpoint
(queue, args)
tools/checkpoint/loader_mixtral_hf.py:149
↓ 1 callersFunction_load_checkpoint
(queue, args)
tools/checkpoint/loader_legacy.py:30
↓ 1 callersFunction_load_checkpoint
(queue, args)
tools/checkpoint/loader_llama_mistral.py:403
↓ 1 callersFunction_load_from_array
(sharded_tensor: ShardedTensor, checkpoint_dir: Path)
megatron/core/dist_checkpointing/strategies/zarr.py:198
↓ 1 callersMethod_load_from_state_dict
(self, state_dict, prefix, *args, **kwargs)
megatron/core/models/common/embeddings/rotary_pos_embedding.py:172
↓ 1 callersFunction_load_non_persistent_base_checkpoint
Load the base state_dict from a non-persistent distributed checkpoint. Depending on the non_persistent_ckpt_type, different logic may be required
megatron/training/checkpointing.py:829
↓ 1 callersFunction_load_regular_chunk
(sharded_tensor: ShardedTensor, checkpoint_dir: Path)
megatron/core/dist_checkpointing/strategies/tensorstore.py:94
↓ 1 callersMethod_load_scaling_factors
Loads scaling factors from model state dictionary. Args: model_state_dict (dict): Model state dictionary Returns:
megatron/core/export/trtllm/trtllm_helper.py:185
↓ 1 callersFunction_load_teacher_model_config
Reads teacher config from a file. The file named ``model_config.yaml`` within the checkpoint directory should specify (in NEMO format) any mo
megatron/inference/gpt/model_provider.py:39
↓ 1 callersMethod_make_backward_post_hook
Creates a backward post-hook to dispatch an all-reduce / reduce-scatter when ready (i.e., when all grads in a bucket have been comput
megatron/core/distributed/distributed_data_parallel.py:362
↓ 1 callersMethod_make_forward_pre_hook
Create a forward pre-hook to wait on all-gather handles when necessary (i.e., when a module uses a parameter in a bucket with a still
megatron/core/distributed/distributed_data_parallel.py:326
↓ 1 callersMethod_margin_test_helper
(self, loss_type)
tests/functional_tests/python_test_utils/test_fp8_ci_pipeline.py:35
↓ 1 callersMethod_maybe_report_stats
Internal method that reports stats if needed.
megatron/core/rerun_state_machine.py:787
↓ 1 callersFunction_mcore_to_torch_sharded_object
Build io.BytesIO from given sharded objects data.
megatron/core/dist_checkpointing/strategies/torch.py:355
↓ 1 callersFunction_mcore_to_torch_sharded_tensor
Build a PyT ShardedTensor from given shards. During loading: - if data is None, initialize it with an empty tensor (will be used to c
megatron/core/dist_checkpointing/strategies/torch.py:328
↓ 1 callersMethod_min_max
Helper function to find the min/max values Args: ptime (float): avg per iteration gpu time btime (float): avg per ite
megatron/core/utils.py:1187
↓ 1 callersFunction_model_provider
Build the model.
tests/unit_tests/export/trtllm/test_single_device_fp8.py:27
↓ 1 callersFunction_model_provider
Build the model.
tests/unit_tests/export/trtllm/test_distributed_fp8.py:29
↓ 1 callersMethod_no_pipelining_forward_step
If recv_buffer is none, we will allocate one on the fly.
megatron/inference/text_generation/forward_step.py:97
↓ 1 callersMethod_norm
(self, x)
megatron/legacy/model/rms_norm.py:27
↓ 1 callersFunction_pad_param_if_needed
(numel_unpadded)
tests/unit_tests/distributed/test_param_and_grad_buffer.py:95
↓ 1 callersMethod_prec_recall_f1_score
Compute precision, recall and f1 given a set of gold and prediction items. :param pred_items: iterable of predicted values :p
tools/retro/text_generation/metrics.py:36
↓ 1 callersMethod_prec_recall_f1_score
Compute precision, recall and f1 given a set of gold and prediction items. :param pred_items: iterable of predicted values :p
tasks/msdp/metrics.py:35
↓ 1 callersMethod_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_ar/modeling_ar.py:715
↓ 1 callersFunction_print_args
Print arguments.
megatron/training/arguments.py:763
↓ 1 callersFunction_print_args
Print arguments.
megatron/training/yaml_arguments.py:374
↓ 1 callersFunction_produce_e2e_metrics
Generate APP metrics for E2E tracking NOTE: always call this function after barrier call Args: log_throughput (bool, optional): if l
megatron/training/one_logger_utils.py:71
↓ 1 callersFunction_replace_sharded_keys_with_state_dict_keys
Inverse of _replace_state_dict_keys_with_sharded_keys.
megatron/core/dist_checkpointing/strategies/torch.py:410
↓ 1 callersFunction_restore_dict_types
Recursively update `x` keys, based on `keys_template`.
megatron/core/dist_checkpointing/strategies/torch.py:425
↓ 1 callersFunction_rotate_half
Change sign so the last dimension becomes [-odd, +even] Args: x (Tensor): Input tensor Returns: Tensor: Tensor rotated half
megatron/core/models/common/embeddings/rope_utils.py:69
↓ 1 callersMethod_run_split_on_punc
Splits punctuation on a piece of text.
megatron/training/tokenizer/bert_tokenization.py:266
↓ 1 callersMethod_run_strip_accents
Strips accents from a piece of text.
megatron/training/tokenizer/bert_tokenization.py:255
↓ 1 callersMethod_save_state
Internal method that saves the state that needs to be restored when rewound. Any state that may change during the execution of a step before
megatron/core/rerun_state_machine.py:755
↓ 1 callersFunction_save_to_existing_array
(sharded_tensor: ShardedTensor, arr: Optional[zarr.Array])
megatron/core/dist_checkpointing/strategies/zarr.py:130
← previousnext →1,101–1,200 of 4,219, ranked by callers