Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/JinjieNi/MegaDLMs
/ functions
Functions
4,219 in github.com/JinjieNi/MegaDLMs
⨍
Functions
4,219
◇
Types & classes
650
↳
Endpoints
8
Method
forward
Forward of TEGroupedMLP Args: permuted_local_hidden_states (torch.Tensor): The permuted input hidden states of the lo
megatron/core/transformer/moe/experts.py:641
Method
forward
Forward step of the SequentialMLP.
megatron/core/transformer/moe/experts.py:777
Method
forward
Forward method for the MoE layer.
megatron/core/transformer/moe/moe_layer.py:63
Method
forward
(self, hidden_states: torch.Tensor)
megatron/core/transformer/moe/moe_layer.py:117
Method
forward
(self, hidden_states: torch.Tensor)
megatron/core/transformer/moe/moe_layer.py:202
Method
forward
Forward pass of the router. Args: input (torch.Tensor): Input tensor.
megatron/core/transformer/moe/router.py:83
Method
forward
Forward pass of the router. Args: input (torch.Tensor): Input tensor.
megatron/core/transformer/moe/router.py:327
Method
forward
Forward pass of the router. Args: input (torch.Tensor): Input tensor.
megatron/core/transformer/moe/router.py:507
Method
forward
Forward function of the MambaStack class. It either returns the Loss values if labels are given or the final hidden unit
megatron/core/ssm/mamba_block.py:228
Method
forward
hidden_states: (nL, B, D) / (L B D) Returns: same shape as hidden_states
megatron/core/ssm/mamba_mixer.py:269
Method
forward
Perform a forward pass through the Mamba layer. This method implements the core computation of a Mamba layer, including the
megatron/core/ssm/mamba_layer.py:74
Method
forward
Forward function. Args: predictions: Student model tensors (size [s, b, h]) targets: Teacher model tensors (
megatron/inference/algos/distillation.py:123
Method
forward
Forward function. Args: predictions: Student model tensors (size [s, b, h]) targets: Teacher model tensors (
megatron/inference/algos/distillation.py:173
Method
forward
Forward function. Args: predictions: Student model tensors (size [s, b, h]) targets: Teacher model tensors (
megatron/inference/algos/distillation.py:217
Method
forward
Forward function. Args: loss_dict: All individual scalar losses, passed in during ``mtd.DistillationModel.compute_kd_loss()``
megatron/inference/algos/distillation.py:333
Method
forward
Forward function. Args: student_tensor: Tensor to be fit to teacher size.
megatron/inference/algos/distillation.py:389
Method
forward
(ctx, op, group, tensor)
megatron/inference/algos/distillation.py:415
Method
forward
(self, x)
tests/unit_tests/test_optimizer.py:19
Method
forward
(self, input)
tasks/vision/segmentation/seg_models.py:42
Method
forward
(self, input)
tasks/vision/segmentation/seg_models.py:74
Method
forward
(self, hidden_states)
tasks/vision/segmentation/seg_heads.py:37
Method
forward
(self, x)
tasks/vision/segmentation/seg_heads.py:63
Method
forward
(self, inputs)
tasks/vision/segmentation/seg_heads.py:103
Function
forward_backward_no_pipelining
Run forward and backward passes with no pipeline parallelism (no inter-stage communication). Returns dictionary with losses. See get_fo
megatron/core/pipeline_parallel/schedules.py:407
Function
forward_backward_pipelining_with_interleaving
Run interleaved 1F1B schedule (model split into model chunks), with communication between pipeline stages as needed. Returns dictionary with
megatron/core/pipeline_parallel/schedules.py:547
Function
forward_backward_pipelining_without_interleaving
Run non-interleaved 1F1B schedule, with communication between pipeline stages. Returns dictionary with losses if the last stage, empty dict otherw
megatron/core/pipeline_parallel/schedules.py:1613
Method
forward_feature_maps
(self, x)
megatron/legacy/model/vision/esvit_swin_backbone.py:614
Method
forward_pass_without_pipeline_parallel
Utility to carry out simple forward pass for TP or no model parallel models Runs a very simple forward pass for model. Used in the case of m
megatron/core/inference/model_inference_wrappers/t5/t5_inference_wrapper.py:186
Method
forward_return_n_last_blocks
(self, x, n=1, return_patch_avgpool=False, depth=[])
megatron/legacy/model/vision/esvit_swin_backbone.py:663
Method
forward_selfattention
(self, x, n=1)
megatron/legacy/model/vision/esvit_swin_backbone.py:630
Function
forward_step
Forward training step. Args: data_iterator : Input data iterator model (GPTModel): The GPT Model
pretrain_difflm.py:322
Method
forward_step
Forward step. Args: orig_input_ids (T.Iterator): Input token IDs. model (GPTModel): The GPT Model.
tests/functional_tests/test_cases/common/ckpt_converter/__main__.py:302
Function
free_ngram
(line, args, key, ngrams, ngrams_freq_sorted)
tools/openwebtext/filter_ngrams.py:88
Method
freeze_patch_emb
(self)
megatron/legacy/model/vision/mit_backbone.py:293
Method
freeze_pretrained_layers
(self, frozen_layers=[])
megatron/legacy/model/vision/esvit_swin_backbone.py:783
Method
gen_file
(prefix="")
megatron/core/dist_checkpointing/strategies/filesystem_async.py:110
Function
general_ict_model_provider
Build the model.
megatron/legacy/model/realm_model.py:18
Method
generate
model_kwargs: model: Mask predictor. prompt: A tensor of shape (1, L). steps: Sampling steps, less than o
tools/weights_conversion/hf_configs/gptneox_1.7b_dlm/modeling_dlm.py:796
Method
generate
The abstract backend's generate function. To define a new backend, implement this and return the outputs as a dictionary. Returns:
megatron/core/inference/engines/abstract_engine.py:9
Method
generate_output_tokens_dynamic_batch
Utility to generate the output tokens and probabilities for the prompts This utility generates the output tokens for a dynamic batch. It will
megatron/core/inference/text_generation_controllers/text_generation_controller.py:222
Function
get_a_and_b_segments
Divide sample into a and b segments.
megatron/legacy/data/dataset_utils.py:84
Method
get_added_index
Get index that has been populated with vectors. Args: config (RetroPreprocessingConfig): Retro preprocessing config. Ret
megatron/core/datasets/retro/index/index.py:91
Function
get_all_ranks
Get caller's rank in tensor-model-parallel, data-parallel, context-parallel, pipeline-model-parallel and expert-model-parallel groups.
megatron/core/parallel_state.py:1758
Function
get_amax_reduction_group
Get the FP8 amax reduction group the caller rank belongs to.
megatron/core/parallel_state.py:1132
Function
get_base_model
Unwraps any nested .module attributes until you reach the actual GPTModel (or whichever base class you are after).
megatron/training/training_nan_skipping.py:100
Function
get_batch
(data_iterator)
tests/unit_tests/transformer/moe/test_upcycling.py:111
Method
get_batch_for_context_window
Returns the input data for inference This function gets called iteratively in the inference loop . It can be used to extract relevant input f
megatron/core/inference/model_inference_wrappers/abstract_model_inference_wrapper.py:71
Method
get_batch_for_context_window
Returns the inference data given context window This function gets called iteratively in a loop . Given the start and end context positions ,
megatron/core/inference/model_inference_wrappers/gpt/gpt_inference_wrapper.py:70
Method
get_block
Get the IDs for an evidence block plus the title of the corresponding document
megatron/legacy/data/ict_dataset.py:126
Function
get_block_samples_mapping
Get samples mapping for a dataset over fixed size blocks. This function also requires a dataset of the titles for the source documents since their
megatron/legacy/data/biencoder_dataset_utils.py:122
Method
get_converter_model_type
(self)
tests/functional_tests/test_cases/common/ckpt_converter/__main__.py:572
Function
get_data_modulo_expert_parallel_group
[Deprecated] Get expert data parallel group.
megatron/core/parallel_state.py:1710
Function
get_data_parallel_diff_rng_tracker_name
Get the data parallel rng tracker name
megatron/core/tensor_parallel/random.py:76
Function
get_data_parallel_group_gloo
Get the Gloo data-parallel group the caller rank belongs to.
megatron/core/parallel_state.py:1071
Function
get_data_parallel_src_rank
Calculate the global rank corresponding to the first local rank in the data parallel group.
megatron/core/parallel_state.py:1443
Function
get_datasets_weights_and_num_samples
(data_prefix, train_valid_test_num_samples)
megatron/legacy/data/dataset_utils.py:46
Method
get_decoder
(self)
tools/weights_conversion/hf_configs/gptneox_1.7b_dlm/modeling_dlm.py:770
Method
get_decoder
(self)
tools/weights_conversion/hf_configs/gptneox_1.7b_ar/modeling_ar.py:816
Method
get_decoder
(self)
tools/weights_conversion/hf_configs/gpt2_1b_dlm/modeling_dlm.py:770
Function
get_e2e_base_metrics
Get base metrics values for one-logger to calculate E2E tracking metrics.
megatron/training/training_nan_skipping.py:1529
Function
get_e2e_base_metrics
Get base metrics values for one-logger to calculate E2E tracking metrics.
megatron/training/training.py:1552
Function
get_embedding_group
Get the embedding group the caller rank belongs to.
megatron/core/parallel_state.py:1120
Function
get_expert_data_parallel_group_gloo
Get expert data parallel group-gloo.
megatron/core/parallel_state.py:1720
Function
get_expert_tensor_and_model_parallel_rank
Return caller's rank in the joint tensor- and expert-model-parallel group.
megatron/core/parallel_state.py:1688
Function
get_expert_tensor_and_model_parallel_world_size
Return world size for the expert model parallel group times expert tensor parallel group.
megatron/core/parallel_state.py:1677
Function
get_expert_tensor_model_pipeline_parallel_group
Get expert tensor-model-pipeline parallel group.
megatron/core/parallel_state.py:1696
Method
get_extra_state
Keep compatibility with TE state dict.
megatron/core/tensor_parallel/layers.py:984
Method
get_extra_state
Keep compatibility with TE state dict.
megatron/core/tensor_parallel/layers.py:1206
Method
get_extra_state
(self)
megatron/core/extensions/flex_attn.py:33
Method
get_extra_state
(self)
megatron/core/extensions/torch_modules.py:11
Function
get_feature_bank
()
megatron/legacy/model/vision/knn_monitor.py:96
Method
get_fp8_tensor
(fill_val=1)
tests/unit_tests/dist_checkpointing/test_fp8.py:59
Function
get_gpt_decoder_block_spec
GPT block spec.
megatron/core/models/difflm/gpt_layer_specs.py:483
Method
get_grad_stats_parallel_group
With the distributed optimizer, gradient statistics (num_zeros & norm) are reduced over all ranks (versus only the model-parallel ran
megatron/core/optimizer/distrib_optimizer.py:572
Function
get_ict_batch
(data_iterator)
megatron/legacy/data/realm_dataset_utils.py:41
Function
get_ict_batch
(data_iterator)
megatron/legacy/data/biencoder_dataset_utils.py:51
Function
get_ict_dataset
Get a dataset which uses block samples mappings to get ICT/block indexing data (via get_block()) rather than for training, since it is only built
megatron/legacy/data/ict_dataset.py:24
Method
get_input_embeddings
(self)
tools/weights_conversion/hf_configs/gptneox_1.7b_dlm/modeling_dlm.py:527
Method
get_input_embeddings
(self)
tools/weights_conversion/hf_configs/gptneox_1.7b_dlm/modeling_dlm.py:755
Method
get_input_embeddings
(self)
tools/weights_conversion/hf_configs/gptneox_1.7b_ar/modeling_ar.py:518
Method
get_input_embeddings
(self)
tools/weights_conversion/hf_configs/gptneox_1.7b_ar/modeling_ar.py:801
Method
get_input_embeddings
(self)
tools/weights_conversion/hf_configs/gpt2_1b_dlm/modeling_dlm.py:527
Method
get_input_embeddings
(self)
tools/weights_conversion/hf_configs/gpt2_1b_dlm/modeling_dlm.py:755
Function
get_inter_partial_data_parallel_group
Get the group spanning the different partial data-parallel groups.
megatron/core/parallel_state.py:1089
Method
get_loss_scale
(self)
megatron/core/optimizer/optimizer.py:371
Method
get_loss_scale
(self)
megatron/core/optimizer/optimizer.py:977
Function
get_merged_datasets
Get all merged datasets. Args: project_dir (str): Path to Retro project dir. chunk_length (int): GPT chunk length (e.g., 64).
megatron/core/datasets/retro/db/utils.py:350
Function
get_merged_valid_dataset
Get validation dataset (for testing the vector index). Args: project_dir (str): Path to Retro project dir. chunk_length (int): GP
megatron/core/datasets/retro/db/utils.py:328
Function
get_micro_batch_size
Get micro batch size.
megatron/core/num_microbatches_calculator.py:27
Method
get_model_argv
GPT model args.
tests/functional_tests/test_cases/common/ckpt_converter/__main__.py:546
Function
get_model_parallel_group
Get the model-parallel group the caller rank belongs to.
megatron/core/parallel_state.py:1030
Function
get_model_parallel_src_rank
Calculate the global rank corresponding to the first local rank in the model parallel group.
megatron/core/parallel_state.py:1436
Function
get_module
(spec_or_module: Union[ModuleSpec, type], **additional_kwargs)
megatron/core/transformer/spec_utils.py:45
Function
get_moe_layer_wise_logging_tracker
Return the moe layer wise tracker.
megatron/core/parallel_state.py:1771
Function
get_moe_pipelines
Get MoE pipelines.
tests/functional_tests/test_cases/common/ckpt_converter/__main__.py:594
Method
get_null_block
Get empty block and title - used in REALM pretraining
megatron/legacy/data/ict_dataset.py:136
Method
get_object
(self, Bucket: str, Key: str, Range: str)
tests/unit_tests/data/test_bin_reader.py:57
Function
get_one_epoch_dataloader
Specifically one epoch to be used in an indexing job.
megatron/legacy/data/realm_dataset_utils.py:14
Method
get_output_embeddings
(self)
tools/weights_conversion/hf_configs/gptneox_1.7b_dlm/modeling_dlm.py:761
Method
get_output_embeddings
(self)
tools/weights_conversion/hf_configs/gptneox_1.7b_ar/modeling_ar.py:807
← previous
next →
3,101–3,200 of 4,219, ranked by callers