MCPcopy Create free account

hub / github.com/JinjieNi/MegaDLMs / functions

Functions4,219 in github.com/JinjieNi/MegaDLMs

↓ 1 callersMethodsetup_method
(self, method)
tests/unit_tests/transformer/moe/test_sequential_mlp.py:21
↓ 1 callersMethodsetup_model
(self, tensor_parallel_size, pipeline_parallel_size)
tests/unit_tests/inference/model_inference_wrappers/t5/test_t5_inference_wrapper.py:28
↓ 1 callersFunctionsetup_model_and_optimizer
Setup model and optimizer.
megatron/training/training_nan_skipping.py:712
↓ 1 callersFunctionsetup_model_only
Setup model and optimizer.
megatron/training/training.py:828
↓ 1 callersMethodsharded_param_state_dp_zero
Naive implementation which reuses gather/scatter from the legacy ckpt format. During saving, gathers the parameters state on DP rank 0 and sa
megatron/core/optimizer/distrib_optimizer.py:997
↓ 1 callersMethodsharded_param_state_fs_bucket_space
Sharded state dict where each noncontiguous buffer is a separate ShardedTensor. Results in fully parallel save and load without any inter-pro
megatron/core/optimizer/distrib_optimizer.py:1030
↓ 1 callersMethodsharded_param_state_fs_model_space
Sharded state dict where each buffer is mapped to corresponding model param. In this approach the optimizer state tensors are directly relate
megatron/core/optimizer/distrib_optimizer.py:1145
↓ 1 callersMethodsharded_state_dict
( self, model_sharded_state_dict: ShardedStateDict, is_loading: bool = False )
megatron/core/optimizer/optimizer.py:870
↓ 1 callersFunctionsharded_tensor_to_torch_sharded_tensor
Convert MCore ShardedTensor to PyT ShardedTensor. PyT requires information about all chunks. On high-level, this function follows the logic of
megatron/core/dist_checkpointing/strategies/torch.py:128
↓ 1 callersMethodshared_embedding_or_output_weight
This is a convenience method to surface the language model's word embeddings, which is necessary for `finalize_model_grads._allreduce_word_emb
megatron/core/models/multimodal/llava_model.py:231
↓ 1 callersMethodshutdown
(self)
tasks/orqa/unsupervised/tokenizers.py:149
↓ 1 callersFunctionsingle_dataset_provider
(datapath)
tasks/orqa/supervised/finetune.py:206
↓ 1 callersFunctionsingle_dataset_provider
(datapath)
tasks/race/finetune.py:45
↓ 1 callersFunctionsinkhorn
(cost, tol=0.0001)
megatron/legacy/model/transformer.py:178
↓ 1 callersFunctionsinkhorn
Sinkhorn based MoE routing function
megatron/core/transformer/moe/moe_utils.py:150
↓ 1 callersMethodsinkhorn_load_balancing
Apply sinkhorn routing to the logits tensor. Args: logits (torch.Tensor): The logits tensor. Returns: Tuple[
megatron/core/transformer/moe/router.py:111
↓ 1 callersMethodslice
Return a view of the list of tokens from [i, j).
tasks/orqa/unsupervised/tokenizers.py:42
↓ 1 callersFunctionslidingjoins
(preds, probs, labels, slices_info, img_size)
tasks/vision/segmentation/utils.py:47
↓ 1 callersMethodsplit_state_dict_if_needed
When "--fp8-param-gather" is disabled, weights and biases are stored in the same `_ParamAndGradBuffer`. So, when saving a checkpoint,
megatron/core/optimizer/distrib_optimizer.py:1507
↓ 1 callersFunctionsplit_tensor_along_last_dim
Split a tensor along its last dimension. Args: tensor: input tensor. num_partitions: number of partitions to split the tensor
megatron/core/tensor_parallel/utils.py:16
↓ 1 callersFunctionsplit_tensor_for_tp
(params, key, dim, tensor)
tools/checkpoint/hybrid_conversion.py:114
↓ 1 callersFunctionsplit_tensor_into_1d_equal_chunks
Break a tensor into equal 1D chunks across tensor parallel ranks. Returns a Tensor or View with this rank's portion of the data. Args:
megatron/core/tensor_parallel/utils.py:42
↓ 1 callersFunctionsplit_text
(text, start_position, remove_char_each_side, seq)
tools/openwebtext/filter_ngrams.py:29
↓ 1 callersMethodstart_param_sync
Initiates param sync (all-gather) communication operations for all model parameters. By default, when overlap_param_gather is set to
megatron/core/distributed/distributed_data_parallel.py:403
↓ 1 callersMethodstate_dict
Return the state dict.
megatron/core/optimizer_param_scheduler.py:195
↓ 1 callersMethodstate_dict
(self)
megatron/core/optimizer/optimizer.py:661
↓ 1 callersMethodstep_with_ready_grads
Step the optimizer with ready gradients, return successful.
megatron/core/optimizer/optimizer.py:443
↓ 1 callersMethodstep_with_ready_grads
Step the optimizer with ready gradients, return successful.
megatron/core/optimizer/optimizer.py:1023
↓ 1 callersFunctionstr_dtype_to_torch
Get torch datatype from input datatype
megatron/core/export/trtllm/trtllm_weights_converter/single_device_trtllm_model_weights_converter.py:26
↓ 1 callersFunctionstr_dtype_to_torch
Get torch datatype from input datatype
megatron/core/export/trtllm/trtllm_weights_converter/distributed_trtllm_model_weights_converter.py:16
↓ 1 callersFunctionstraggler_detector_disabled
()
tests/unit_tests/test_utils.py:121
↓ 1 callersFunctionstraggler_detector_enable
()
tests/unit_tests/test_utils.py:129
↓ 1 callersFunctionstraggler_detector_enabled
()
tests/unit_tests/test_utils.py:125
↓ 1 callersFunctionstraggler_detector_exception_propagate
()
tests/unit_tests/test_utils.py:159
↓ 1 callersFunctionstraggler_detector_report
()
tests/unit_tests/test_utils.py:170
↓ 1 callersFunctionstraggler_detector_timeit
()
tests/unit_tests/test_utils.py:137
↓ 1 callersFunctionstraggler_value_error
()
tests/unit_tests/test_utils.py:155
↓ 1 callersMethodswap_key_value_dict
swap between batches
megatron/core/inference_params.py:13
↓ 1 callersFunctiont5_extended_attention_mask
(attention_mask_list)
megatron/legacy/model/t5_model.py:19
↓ 1 callersFunctionte_checkpoint
Checkpointing with Transformer-Engine.
megatron/core/extensions/transformer_engine.py:1158
↓ 1 callersMethodteardown_method
(self, method)
tests/unit_tests/transformer/moe/test_grouped_mlp.py:278
↓ 1 callersMethodteardown_method
(self, method)
tests/unit_tests/transformer/moe/test_sequential_mlp.py:45
↓ 1 callersFunctiontest_all_pipelines
Run all pipelines.
tests/functional_tests/test_cases/common/ckpt_converter/__main__.py:602
↓ 1 callersFunctiontest_allmasked_softmax_backward
()
megatron/legacy/fused_kernels/tests/test_fused_kernels.py:346
↓ 1 callersFunctiontest_allmasked_softmax_forward
()
megatron/legacy/fused_kernels/tests/test_fused_kernels.py:330
↓ 1 callersFunctiontest_bin_reader
()
tests/unit_tests/data/test_bin_reader.py:94
↓ 1 callersFunctiontest_broadcast_data
(tensor_model_parallel_size)
megatron/legacy/mpu/tests/test_data.py:14
↓ 1 callersFunctiontest_builder
()
tests/unit_tests/data/test_builder.py:51
↓ 1 callersFunctiontest_column_parallel_linear
(tensor_model_parallel_size)
megatron/legacy/mpu/tests/test_layers.py:173
↓ 1 callersMethodtest_constructor
(self)
tests/unit_tests/transformer/moe/test_grouped_mlp.py:282
↓ 1 callersMethodtest_constructor
(self)
tests/unit_tests/transformer/moe/test_sequential_mlp.py:49
↓ 1 callersFunctiontest_cross_entropy
(tensor_model_parallel_size)
megatron/legacy/mpu/tests/test_cross_entropy.py:45
↓ 1 callersFunctiontest_cuda_rng_tracker
(tensor_model_parallel_size)
megatron/legacy/mpu/tests/test_random.py:73
↓ 1 callersFunctiontest_domain_mcore
()
tests/unit_tests/test_imports.py:125
↓ 1 callersFunctiontest_fused_softmax
()
megatron/legacy/fused_kernels/tests/test_fused_kernels.py:25
↓ 1 callersFunctiontest_fused_upper_triangle_mask_softmax
()
megatron/legacy/fused_kernels/tests/test_fused_kernels.py:123
↓ 1 callersFunctiontest_get_tensor_model_parallel_src_rank
(tensor_model_parallel_size_)
megatron/legacy/mpu/tests/test_initialize.py:49
↓ 1 callersMethodtest_gpu_forward
(self)
tests/unit_tests/transformer/moe/test_grouped_mlp.py:164
↓ 1 callersMethodtest_gpu_forward
(self)
tests/unit_tests/transformer/moe/test_sequential_mlp.py:57
↓ 1 callersMethodtest_gpu_forward_with_no_tokens_allocated
Test the case when no token is allocated for groupedGEMM kernels.
tests/unit_tests/transformer/moe/test_grouped_mlp.py:187
↓ 1 callersMethodtest_gpu_forward_with_no_tokens_allocated
(self)
tests/unit_tests/transformer/moe/test_sequential_mlp.py:185
↓ 1 callersMethodtest_gpu_forward_with_one_local_expert
(self)
tests/unit_tests/transformer/moe/test_sequential_mlp.py:160
↓ 1 callersFunctiontest_initialize_affine_weight
(tensor_model_parallel_size)
megatron/legacy/mpu/tests/test_layers.py:94
↓ 1 callersFunctiontest_initialize_model_parallel
(tensor_model_parallel_size)
megatron/legacy/mpu/tests/test_initialize.py:11
↓ 1 callersFunctiontest_layer_norm
()
megatron/legacy/fused_kernels/tests/test_fused_kernels.py:223
↓ 1 callersFunctiontest_load_fused_kernels
()
megatron/legacy/fused_kernels/tests/test_fused_kernels.py:13
↓ 1 callersFunctiontest_masked_softmax_backward
()
megatron/legacy/fused_kernels/tests/test_fused_kernels.py:309
↓ 1 callersFunctiontest_masked_softmax_forward
()
megatron/legacy/fused_kernels/tests/test_fused_kernels.py:294
↓ 1 callersFunctiontest_mock_gpt_dataset
()
tests/unit_tests/data/test_gpt_dataset.py:31
↓ 1 callersFunctiontest_mock_multimodal_dataset
()
tests/unit_tests/data/test_multimodal_dataset.py:20
↓ 1 callersFunctiontest_model_parallel_cuda_manual_seed
(tensor_model_parallel_size)
megatron/legacy/mpu/tests/test_random.py:144
↓ 1 callersFunctiontest_parallel_embedding
(tensor_model_parallel_size)
megatron/legacy/mpu/tests/test_layers.py:16
↓ 1 callersFunctiontest_parallel_self_attention
(tensor_model_parallel_size)
megatron/legacy/mpu/tests/test_layers.py:348
↓ 1 callersFunctiontest_parallel_transformer_layer
(tensor_model_parallel_size)
megatron/legacy/mpu/tests/test_layers.py:436
↓ 1 callersFunctiontest_preprocess_data_bert
()
tests/unit_tests/data/test_preprocess_data.py:218
↓ 1 callersFunctiontest_preprocess_data_gpt
()
tests/unit_tests/data/test_preprocess_data.py:186
↓ 1 callersFunctiontest_preprocess_mmdata
()
tests/unit_tests/data/test_preprocess_mmdata.py:195
↓ 1 callersFunctiontest_row_parallel_linear
(tensor_model_parallel_size)
megatron/legacy/mpu/tests/test_layers.py:240
↓ 1 callersFunctiontest_set_cuda_rng_state
(tensor_model_parallel_size)
megatron/legacy/mpu/tests/test_random.py:11
↓ 1 callersMethodtest_weight_init_value_the_same
(self)
tests/unit_tests/transformer/moe/test_grouped_mlp.py:136
↓ 1 callersMethodtext_to_bert
Text to Bert tokens.
tools/retro/cli/cli.py:87
↓ 1 callersFunctionthreshold_predictions
(all_predictions, threshold)
tasks/ensemble_classifier.py:69
↓ 1 callersMethodtie_embeddings_and_output_weights_state_dict
Ties the embedding and output weights in a given sharded state dict. Args: sharded_state_dict (ShardedStateDict): state dict with
megatron/core/models/common/language_module/language_module.py:204
↓ 1 callersMethodto_2D
(self, x)
tasks/vision/segmentation/seg_heads.py:29
↓ 1 callersFunctionto_cuda
(d)
tests/unit_tests/test_optimizer.py:54
↓ 1 callersMethodtokenize
(self, *text)
tools/preprocess_mmdata.py:41
↓ 1 callersMethodtokenize
Tokenize a string.
megatron/training/tokenizer/gpt2_tokenization.py:239
↓ 1 callersMethodtokenize
Tokenize conversation or string input.
megatron/training/tokenizer/multimodal_tokenizer.py:153
↓ 1 callersMethodtokenize_encoder_prompt
Utility to tokenize the encoder_prompt Args: encoder_prompt (str): The encoder_prompt tokenizer (_type_): Tokenizer u
megatron/core/inference/model_inference_wrappers/t5/t5_inference_wrapper.py:87
↓ 1 callersMethodtokenize_prompt
Utility to tokenize the input prompts Args: prompt (str): The input prompt Returns: torch.Tensor: Returns th
megatron/core/inference/text_generation_controllers/text_generation_controller.py:36
↓ 1 callersFunctiontokenize_prompts
Tokenize prompts and make them avaiable on all ranks.
tools/retro/text_generation/retro_api.py:18
↓ 1 callersFunctiontopk_accuracy
(k)
tasks/orqa/supervised/eval_utils.py:166
↓ 1 callersFunctiontorch_cross_entropy
(batch_size, seq_length, vocab_size, logits_scale, seed)
megatron/legacy/mpu/tests/test_cross_entropy.py:16
↓ 1 callersMethodtrack_and_report_progress
Utility function for tracking progress
megatron/legacy/indexer.py:68
↓ 1 callersFunctiontrain
Training function: run train_step desired number of times, run validation, checkpoint.
megatron/training/training_nan_skipping.py:1448
↓ 1 callersFunctiontrain
Training function: run train_step desired number of times, run validation, checkpoint.
megatron/training/training.py:1460
↓ 1 callersMethodtrain
Train index. Args: config (RetroPreprocessingConfig): Retro preprocessing config.
megatron/core/datasets/retro/index/indexes/faiss_base.py:77
↓ 1 callersFunctiontrain_on_embeddings
Train index on embedded DB chunks. Args: config (RetroPreprocessingConfig): Retro preprocessing config.
megatron/core/datasets/retro/index/build.py:159
↓ 1 callersFunctiontrain_step
Single training step.
megatron/training/training_nan_skipping.py:811
↓ 1 callersFunctiontrain_valid_datasets_provider
Provide train and validation datasets.
tasks/race/finetune.py:15
← previousnext →1,901–2,000 of 4,219, ranked by callers