MCPcopy Create free account

hub / github.com/JinjieNi/MegaDLMs / functions

Functions4,219 in github.com/JinjieNi/MegaDLMs

↓ 1 callersMethod__init__
( self, strategy: SaveShardedStrategy, parallelization_group: Optional[torch.distribut
megatron/core/dist_checkpointing/strategies/fully_parallel.py:63
↓ 1 callersMethod__init__
(self, idx_path: str, dtype: Type[numpy.number])
megatron/core/datasets/indexed_dataset.py:122
↓ 1 callersMethod__init__
(self, block_paths: List[str], block_size: int)
megatron/core/datasets/retro/utils.py:320
↓ 1 callersMethod__init__
( self, config: TransformerConfig, encoder_config: TransformerConfig, transfor
megatron/core/models/T5/t5_model.py:125
↓ 1 callersMethod__init__
( self, kv_channels: int, rotary_percent: float, rotary_interleaved: bool = Fa
megatron/core/models/common/embeddings/rotary_pos_embedding.py:54
↓ 1 callersMethod__init__
(self, config: RetroConfig, submodules: Type, **kwargs: dict)
megatron/core/models/retro/encoder_attention.py:196
↓ 1 callersMethod__init__
( self, config: RetroConfig, submodules: CrossAttentionSubmodules, layer_numbe
megatron/core/models/retro/decoder_attention.py:54
↓ 1 callersMethod__init__
Creates a _CudaGraphRunner, which holds a single pair of fwd and bwd cudagraphs, which are not created until this runner records its graph cre
megatron/core/transformer/cuda_graphs.py:350
↓ 1 callersMethod__init__
(self, *args, **kwargs)
megatron/core/transformer/identity_op.py:10
↓ 1 callersMethod__init__
(self, config: TransformerConfig, module: torch.nn.Module)
megatron/core/transformer/module.py:149
↓ 1 callersMethod__init__
( self, config: MLATransformerConfig, submodules: MLASelfAttentionSubmodules,
megatron/core/transformer/multi_latent_attention.py:195
↓ 1 callersMethod__init__
(self, start: int, end: int)
megatron/core/optimizer/distrib_optimizer.py:67
↓ 1 callersMethod__init__
Source & destination metas.
tests/functional_tests/test_cases/common/ckpt_converter/__main__.py:106
↓ 1 callersMethod__init__
(self)
tests/unit_tests/dist_checkpointing/test_optimizer.py:46
↓ 1 callersMethod__init__
(self)
tests/unit_tests/dist_checkpointing/test_fully_parallel.py:32
↓ 1 callersMethod__init__
(self, task_name, dataset_name, datapath, tokenizer, max_seq_length)
tasks/orqa/unsupervised/nq.py:165
↓ 1 callersMethod__init__
(self, num_classes, pre_process=True, post_process=True)
tasks/vision/segmentation/seg_models.py:16
↓ 1 callersMethod__post_init__
(self)
tools/retro/sft/dataset_conv.py:44
↓ 1 callersMethod__post_init__
Do asserts and set fields post init
megatron/core/datasets/gpt_dataset.py:63
↓ 1 callersMethod_add
Add to index (rank 0's method). Args: config (RetroPreprocessingConfig): Retro preprocessing config. text_dataset (GP
megatron/core/datasets/retro/index/indexes/faiss_base.py:90
↓ 1 callersFunction_add_autoresume_args
(parser)
megatron/training/arguments.py:1950
↓ 1 callersFunction_add_biencoder_args
(parser)
megatron/training/arguments.py:1962
↓ 1 callersFunction_add_checkpointing_args
(parser)
megatron/training/arguments.py:1548
↓ 1 callersFunction_add_config_logger_args
(parser)
megatron/training/arguments.py:1074
↓ 1 callersFunction_add_custom_args
(parser)
megatron/training/arguments.py:2223
↓ 1 callersFunction_add_data_args
(parser)
megatron/training/arguments.py:1865
↓ 1 callersFunction_add_distributed_args
(parser)
megatron/training/arguments.py:1692
↓ 1 callersFunction_add_experimental_args
(parser)
megatron/training/arguments.py:2181
↓ 1 callersFunction_add_ft_package_args
(parser)
megatron/training/arguments.py:1066
↓ 1 callersFunction_add_inference_args
(parser)
megatron/training/arguments.py:861
↓ 1 callersFunction_add_initialization_args
(parser)
megatron/training/arguments.py:1469
↓ 1 callersFunction_add_learning_rate_args
(parser)
megatron/training/arguments.py:1487
↓ 1 callersFunction_add_logging_args
(parser)
megatron/training/arguments.py:1082
↓ 1 callersFunction_add_mixed_precision_args
(parser)
megatron/training/arguments.py:1656
↓ 1 callersFunction_add_mla_args
(parser)
megatron/training/arguments.py:2164
↓ 1 callersFunction_add_moe_args
(parser)
megatron/training/arguments.py:2090
↓ 1 callersFunction_add_network_size_args
(parser)
megatron/training/arguments.py:939
↓ 1 callersFunction_add_one_logger_args
(parser)
megatron/training/arguments.py:1037
↓ 1 callersFunction_add_regularization_args
(parser)
megatron/training/arguments.py:1168
↓ 1 callersFunction_add_rerun_machine_args
(parser)
megatron/training/arguments.py:1451
↓ 1 callersFunction_add_retro_args
(parser)
megatron/training/arguments.py:891
↓ 1 callersFunction_add_straggler_detector_args
(parser)
megatron/training/arguments.py:1024
↓ 1 callersFunction_add_to_index
Add DB chunks to index. Args: config (RetroPreprocessingConfig): Retro preprocessing config. Returns: Path to the populated
megatron/core/datasets/retro/index/build.py:251
↓ 1 callersFunction_add_training_args
(parser)
megatron/training/arguments.py:1200
↓ 1 callersFunction_add_transformer_engine_args
(parser)
megatron/training/arguments.py:830
↓ 1 callersFunction_add_validation_args
(parser)
megatron/training/arguments.py:1813
↓ 1 callersFunction_add_vision_args
(parser)
megatron/training/arguments.py:2019
↓ 1 callersMethod_adjust_key_value_for_latent_forward
Saves the generated key and value tensors to the end of the buffers in inference_params. Returns the full size keys and values from t
megatron/core/transformer/attention.py:831
↓ 1 callersFunction_allocate_auto
( total_layers_count: int, target_attention_ratio: float, target_mlp_ratio: float )
megatron/core/ssm/mamba_hybrid_layer_allocation.py:24
↓ 1 callersFunction_allocate_override
(total_layers_count: int, override_pattern: str)
megatron/core/ssm/mamba_hybrid_layer_allocation.py:61
↓ 1 callersFunction_allreduce_embedding_grads
All-reduce both word and position embeddings.
megatron/core/distributed/finalize_model_grads.py:165
↓ 1 callersFunction_allreduce_layernorm_grads
All-reduce layernorm grads (for sequence parallelism).
megatron/core/distributed/finalize_model_grads.py:173
↓ 1 callersFunction_allreduce_position_embedding_grads
All-reduce position_embeddings grad across encoder and decoder stages to ensure that position embeddings parameters stay in sync.
megatron/core/distributed/finalize_model_grads.py:139
↓ 1 callersFunction_allreduce_word_embedding_grads
All-reduce word embedding grads. Reduce grads across first and last stages to ensure that word_embeddings parameters stay in sync.
megatron/core/distributed/finalize_model_grads.py:110
↓ 1 callersFunction_apply_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
megatron/core/models/common/embeddings/rope_utils.py:139
↓ 1 callersMethod_apply_scaling
( self, freqs, factor=8, low_freq_factor=1, high_freq_factor=4,
megatron/core/models/common/embeddings/rotary_pos_embedding.py:80
↓ 1 callersMethod_apply_scaling
( self, freqs, factor=8, low_freq_factor=1, high_freq_factor=4,
megatron/core/models/common/embeddings/rotary_pos_embedding.py:243
↓ 1 callersMethod_apply_tile_tagging
Apply tile tagging. The image embeddings of multiple tiles are prepended with tile tags such as <tile_1>. This implements the method
megatron/core/models/multimodal/llava_model.py:678
↓ 1 callersMethod_assert_has_kv_scales
(self, state_dict, kv_quantized)
tests/unit_tests/export/trtllm/test_single_device_fp8.py:151
↓ 1 callersMethod_assert_has_kv_scales
(self, state_dict, kv_quantized)
tests/unit_tests/export/trtllm/test_distributed_fp8.py:154
↓ 1 callersMethod_assert_has_scales
(self, state_dict, quantized)
tests/unit_tests/export/trtllm/test_single_device_fp8.py:138
↓ 1 callersMethod_assert_has_scales
(self, state_dict, quantized)
tests/unit_tests/export/trtllm/test_distributed_fp8.py:141
↓ 1 callersMethod_assert_non_quantizable_layers
(self, state_dict)
tests/unit_tests/export/trtllm/test_single_device_fp8.py:176
↓ 1 callersMethod_assert_non_quantizable_layers
(self, state_dict)
tests/unit_tests/export/trtllm/test_distributed_fp8.py:179
↓ 1 callersMethod_assert_quantizable_layers
(self, state_dict, quantized)
tests/unit_tests/export/trtllm/test_single_device_fp8.py:164
↓ 1 callersMethod_assert_quantizable_layers
(self, state_dict, quantized)
tests/unit_tests/export/trtllm/test_distributed_fp8.py:167
↓ 1 callersMethod_auc_test_helper
(self, loss_type)
tests/functional_tests/python_test_utils/test_fp8_ci_pipeline.py:56
↓ 1 callersMethod_build_attention_mask_and_position_ids
Builds the full attention mask and position ids for the input tokens Args: prompts_tokens (torch.Tensor): A tensor of shape [batc
megatron/core/inference/model_inference_wrappers/gpt/gpt_inference_wrapper.py:44
↓ 1 callersMethod_build_blended_dataset_splits
Build all dataset splits according to the provided blend(s) See the BlendedMegatronDatasetBuilder.build alias for more information.
megatron/core/datasets/blended_megatron_dataset_builder.py:159
↓ 1 callersFunction_build_document_index
Build an array with length = num epochs * num documents Args: documents (numpy.ndarray): the subset of exposed document indices
megatron/core/datasets/gpt_dataset.py:570
↓ 1 callersFunction_build_document_index_epoch_ordered
Build an array with length = num epochs * num documents Args: documents (numpy.ndarray): the subset of exposed document indices
megatron/core/datasets/gpt_dataset.py:1397
↓ 1 callersMethod_build_document_sample_ordered_indices
Build the document index, the sample index, and the shuffle index The document index: -- 1-D -- An ordered array of d
megatron/core/datasets/gpt_dataset.py:1117
↓ 1 callersMethod_build_document_sample_shuffle_indices
Build the document index, the sample index, and the shuffle index The document index: -- 1-D -- An ordered array of d
megatron/core/datasets/gpt_dataset.py:318
↓ 1 callersMethod_build_gbuf_range_map
Build mapping between params and their grad buffers. These mappings are partitioned according to data type. Iterate through
megatron/core/optimizer/distrib_optimizer.py:205
↓ 1 callersFunction_build_import_path
(subdomains: list, imp)
tests/unit_tests/test_imports.py:35
↓ 1 callersMethod_build_indices
Build and optionally cache the dataset index and the dataset sample index The dataset index is a 1-D mapping which determines the dataset to
megatron/core/datasets/blended_dataset.py:98
↓ 1 callersFunction_build_infinite_size_dataloader
Build a looped dataloader with infinite size.
tasks/finetune_utils.py:95
↓ 1 callersFunction_build_infinite_size_dataloader
Build a looped dataloader with infinite size.
tasks/vision/finetune_utils.py:55
↓ 1 callersFunction_build_key_size_numel_dictionaries
Build the size on rank 0 and broadcast.
megatron/core/tensor_parallel/data.py:24
↓ 1 callersFunction_build_lambada_dataset
Build lambada dataset.
tasks/zeroshot_gpt/datasets.py:116
↓ 1 callersMethod_build_layers
(self)
megatron/core/transformer/transformer_block.py:241
↓ 1 callersMethod_build_load_plan
( self, sharded_state_dict: ShardedStateDict )
megatron/core/dist_checkpointing/strategies/two_stage.py:157
↓ 1 callersMethod_build_model_and_main_param_groups
Create main parameter groups needed for the optimizer step. These groups encompass both: 1) groups used by this class, for r
megatron/core/optimizer/distrib_optimizer.py:291
↓ 1 callersMethod_build_model_gbuf_param_range_map
Build mapping from param reference to grad buffer shard ranges. This method builds a mapping from parameter references to grad
megatron/core/optimizer/distrib_optimizer.py:96
↓ 1 callersMethod_build_model_gbuf_range
Build mapping between params and their grad buffers. This method does the initial setup for the method above. This setup inc
megatron/core/optimizer/distrib_optimizer.py:158
↓ 1 callersMethod_build_model_param_gbuf_map
Create a reverse of the gbuf_ranges, for referencing in opposite direction.
megatron/core/optimizer/distrib_optimizer.py:225
↓ 1 callersMethod_build_multi_meta
( section: Section, before: str, desc: str )
tools/retro/config_utils.py:344
↓ 1 callersFunction_build_num_microbatches_calculator
Build number of microbatches calculator. Internal helper method. Args: rank (int): Rank of the GPU, only rank 0 will log the
megatron/core/num_microbatches_calculator.py:191
↓ 1 callersMethod_build_optimizer_group_ranges
Create optimizer groups. Given the set of parameter shard ranges that are owned by the current data-parallel (DP) rank, gath
megatron/core/optimizer/distrib_optimizer.py:244
↓ 1 callersMethod_build_single_meta
(section: Section, desc: str)
tools/retro/config_utils.py:323
↓ 1 callersFunction_build_train_valid_dataloaders
Traing and validation dataloaders.
tasks/finetune_utils.py:106
↓ 1 callersFunction_build_train_valid_dataloaders
Traing and validation dataloaders.
tasks/vision/finetune_utils.py:66
↓ 1 callersFunction_build_train_valid_test_datasets
(data_prefix, splits_string, train_valid_test_num_samples,
megatron/legacy/data/dataset_utils.py:467
↓ 1 callersFunction_build_wikitext103_dataset
()
tasks/zeroshot_gpt/datasets.py:129
↓ 1 callersFunction_check_arg_is_not_none
(args, arg)
megatron/training/arguments.py:778
↓ 1 callersFunction_check_arg_is_not_none
(args, arg)
megatron/training/yaml_arguments.py:409
↓ 1 callersFunction_check_data_types
Check that all the keys have the same target data type.
megatron/core/tensor_parallel/data.py:14
↓ 1 callersMethod_check_toggle
Helper method to check if a request to toggle the collection state was made It checks iof collection state toggle req was made via the server
megatron/core/utils.py:1106
↓ 1 callersMethod_checkpointed_attention_forward
Forward method with activation checkpointing.
megatron/legacy/model/transformer.py:621
↓ 1 callersMethod_checkpointed_forward
Forward method with activation checkpointing.
megatron/legacy/model/transformer.py:1590
← previousnext →1,001–1,100 of 4,219, ranked by callers