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
↓ 1 callers
Function
generate_and_write_samples_conditional
(model)
tools/retro/text_generation/retro_text_generation.py:226
↓ 1 callers
Function
generate_masked_orthogonal_rank_groups
r"""Generate orthogonal parallel groups based on the parallel size and mask. Arguments: world_size (int): world size parallel_si
megatron/core/parallel_state.py:145
↓ 1 callers
Method
generate_query_vectors
(self, qa_data, split)
tasks/orqa/evaluate_utils.py:71
↓ 1 callers
Function
generate_samples
Text generation using a trained vision language model. This is an example for the COCO dataset.
tools/run_vlm_text_generation.py:87
↓ 1 callers
Function
generate_samples_by_calling_api
Generate outputs by calling
tasks/msdp/prompt.py:76
↓ 1 callers
Function
generate_samples_by_prompting_input_from_file
Prompt a pretrained language model to generate knowledge/response
tasks/msdp/prompt.py:156
↓ 1 callers
Function
generate_samples_conditional
(model)
tools/retro/text_generation/retro_text_generation.py:134
↓ 1 callers
Function
generate_tokens_probs_and_return_on_first_stage
Main token generation function. Args: model: no interleaving is supported. forward_step (ForwardStep): Class for running the mode
megatron/inference/text_generation/generation.py:115
↓ 1 callers
Function
get_added_code_paths
Get paths to all saved encodings. Args: config (RetroPreprocessingConfig): Retro preprocessing config. Returns: Paths of all
megatron/core/datasets/retro/index/utils.py:117
↓ 1 callers
Method
get_all_timers_string
Returns the output string with logged timer values according to configured options. Args: names (List[str]): Names of the timers
megatron/core/timers.py:317
↓ 1 callers
Function
get_args
()
tools/preprocess_mmdata.py:73
↓ 1 callers
Function
get_args
()
tools/preprocess_data_nmt.py:33
↓ 1 callers
Function
get_args
()
tools/preprocess_data.py:190
↓ 1 callers
Function
get_args
()
tools/merge_datasets.py:18
↓ 1 callers
Function
get_args
()
tasks/msdp/preprocessing.py:12
↓ 1 callers
Function
get_base_model
Unwraps any nested .module attributes until you reach the actual GPTModel (or whichever base class you are after).
pretrain_difflm.py:42
↓ 1 callers
Function
get_base_model
Unwraps any nested .module attributes until you reach the actual GPTModel (or whichever base class you are after).
tools/weights_conversion/utils/verify_correctness_dlm.py:27
↓ 1 callers
Method
get_batch
Get batch of data, from input token IDs.
tests/functional_tests/test_cases/common/ckpt_converter/__main__.py:242
↓ 1 callers
Method
get_batch_per_block
(sq, sk, b, np)
megatron/legacy/model/fused_softmax.py:228
↓ 1 callers
Method
get_batch_per_block
(sq, sk, b, np)
megatron/core/fusions/fused_softmax.py:217
↓ 1 callers
Function
get_bert_embedders
(config)
tools/retro/preprocess_data.py:83
↓ 1 callers
Function
get_bert_layer_with_transformer_engine_spec
Use this spec to use lower-level Transformer Engine modules (required for fp8 training). Returns: ModuleSpec: Module specification with T
megatron/core/models/bert/bert_layer_specs.py:40
↓ 1 callers
Function
get_bert_tokenizer
Bert (Wordpiece) tokenizer.
tools/retro/preprocess_data.py:177
↓ 1 callers
Function
get_bias_dropout_add
(training)
megatron/legacy/model/transformer.py:846
↓ 1 callers
Function
get_blend_and_blend_per_split
Get blend and blend_per_split from passed-in arguments.
megatron/training/utils.py:336
↓ 1 callers
Function
get_block_nload
Compute number of blocks to load. This is computed by multiplying the total number of available blocks with the fraction of blocks to load.
megatron/core/datasets/retro/index/build.py:53
↓ 1 callers
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/realm_dataset_utils.py:112
↓ 1 callers
Function
get_blocks
Divide range [0, num_samples) to sequence of block ranges. This is a core method within the concept of block processing. The idea is to divid
megatron/core/datasets/retro/utils.py:112
↓ 1 callers
Function
get_config_leaf_field_names
(config_cls)
tools/retro/config_utils.py:569
↓ 1 callers
Function
get_config_path
Config copy stored within retro project dir.
megatron/core/models/retro/utils.py:8
↓ 1 callers
Function
get_context_parallel_global_ranks
Get all global ranks of the context-parallel group that the caller rank belongs to.
megatron/core/parallel_state.py:1104
↓ 1 callers
Function
get_context_parallel_rank
Return caller's rank in the context-parallel group.
megatron/core/parallel_state.py:1557
↓ 1 callers
Function
get_context_parallel_world_size
Return world size for the context parallel group.
megatron/core/parallel_state.py:1549
↓ 1 callers
Method
get_converter_model_type
Get converter type: 'GPT' or 'Bert'.
tests/functional_tests/test_cases/common/ckpt_converter/__main__.py:117
↓ 1 callers
Function
get_core_transformer_block_key
(model_key)
tools/checkpoint/schema_core.py:10
↓ 1 callers
Function
get_cpu_offload_context
Get CPU offload context and sync function.
megatron/core/extensions/transformer_engine.py:1214
↓ 1 callers
Function
get_data_loader
Build data loader over data subset. Get a subset of the dataset (from start_idx -> end_idx), and wrap it in a sequential sampler and data loa
tools/bert_embedding/embed.py:70
↓ 1 callers
Function
get_data_parallel_rng_tracker_name
Get the data parallel rng tracker name
megatron/core/tensor_parallel/random.py:71
↓ 1 callers
Function
get_database
Get the database by topics
tasks/msdp/preprocessing.py:244
↓ 1 callers
Function
get_datadirs_and_weights
(weighted_prefix: str)
tools/count_tokens.py:26
↓ 1 callers
Method
get_db_chunk_and_continuation_text
Get DB chunk along with continuation, as text.
tools/retro/cli/cli.py:130
↓ 1 callers
Method
get_db_chunk_bert
Get DB chunk as Bert token ids.
tools/retro/cli/cli.py:120
↓ 1 callers
Method
get_db_indexed_dataset_infos
Dataset infos, including number of training & sampled sets.
tools/retro/cli/cli.py:101
↓ 1 callers
Method
get_db_num_chunks
Number of DB chunks.
tools/retro/cli/cli.py:110
↓ 1 callers
Method
get_db_num_indexed_datasets
Number of indexed datasets within blended dataset.
tools/retro/cli/cli.py:96
↓ 1 callers
Function
get_default_causal_mask
Return the causal upper triangular mask for softmax input.
megatron/core/transformer/utils.py:32
↓ 1 callers
Function
get_default_save_common_strategy
Get default save common strategy.
megatron/core/dist_checkpointing/serialization.py:415
↓ 1 callers
Function
get_detokenizer
(path)
tasks/zeroshot_gpt/detokenizer.py:64
↓ 1 callers
Function
get_device
(local_rank=None)
megatron/training/dist_signal_handler.py:15
↓ 1 callers
Function
get_difflm_decoder_block_spec
GPT block spec.
megatron/core/models/difflm/gpt_layer_specs.py:570
↓ 1 callers
Function
get_difflm_layer_local_spec
Use this spec for an implementation using only modules in Megatron-Core. Args: num_experts (int, optional): Number of experts. Defaults
megatron/core/models/difflm/gpt_layer_specs.py:327
↓ 1 callers
Method
get_evidence_dataset
(self)
tasks/orqa/evaluate_utils.py:51
↓ 1 callers
Method
get_evidence_embedding
(self)
tasks/orqa/evaluate_utils.py:47
↓ 1 callers
Function
get_expert_data_parallel_rank
Return caller's rank in the expert data parallel group.
megatron/core/parallel_state.py:1728
↓ 1 callers
Function
get_expert_model_parallel_world_size
Return world size for the expert-model-parallel group.
megatron/core/parallel_state.py:1591
↓ 1 callers
Function
get_file_name
(args, file_id)
tools/preprocess_data.py:237
↓ 1 callers
Function
get_gpt_chunk_datasets
(config)
tools/retro/preprocess_data.py:95
↓ 1 callers
Function
get_gpt_decoder_block_spec
GPT block spec.
megatron/core/models/gpt/gpt_layer_specs.py:266
↓ 1 callers
Function
get_gpt_pipelines
Get GPT (non-MoE) pipelines.
tests/functional_tests/test_cases/common/ckpt_converter/__main__.py:576
↓ 1 callers
Function
get_gpt_tokenizer
GPT (BPE) tokenizer.
tools/retro/preprocess_data.py:152
↓ 1 callers
Method
get_grad_norm
Compute and return grad norm.
megatron/core/optimizer/optimizer.py:187
↓ 1 callers
Function
get_hierarchical_context_parallel_groups
Get the inner ring of context parallel group the caller rank belongs to.
megatron/core/parallel_state.py:1113
↓ 1 callers
Function
get_index
Read index from disk. Args: config (RetroPreprocessingConfig): Retro preprocessing config. ondisk (bool): If `ondisk = True`, mem
megatron/core/datasets/retro/query/query.py:42
↓ 1 callers
Method
get_index_class
Get an index class, given a type string. Args: index_type (str): One of 'faiss-base' (naive Faiss index wrapper) or 'faiss-par-ad
megatron/core/datasets/retro/index/factory.py:17
↓ 1 callers
Function
get_individual_chunk_db
Load individual dataset's chunk DB. Args: project_dir (str): Path to Retro project dir. ds_id (int): Index of dataset within blen
megatron/core/datasets/retro/db/utils.py:166
↓ 1 callers
Function
get_individual_doc_offsets
Load individual dataset's document offsets. Args: project_dir (str): Path to Retro project dir. ds_id (int): Index of dataset wit
megatron/core/datasets/retro/db/utils.py:194
↓ 1 callers
Method
get_input_ids
Randomly initialize input token IDs.
tests/functional_tests/test_cases/common/ckpt_converter/__main__.py:210
↓ 1 callers
Function
get_layer_name_without_prefix
Get TRTLayer name without prefix Given a layer e.g TRTLLMLayers.attention_qkv_weight it returns 'attention.qkv.weight' Args: layer (
megatron/core/export/trtllm/trtllm_layers.py:145
↓ 1 callers
Method
get_loss_scale
Get current loss scale factor. NOTE: The output should be a CUDA tensor of size 1.
megatron/core/optimizer/optimizer.py:227
↓ 1 callers
Method
get_mask
Create a mask for the specified tokens based on the given order. Args: order (str): The order of parallelism types (e.g., 'tp-dp-
megatron/core/parallel_state.py:332
↓ 1 callers
Function
get_merged_sampled_dataset
Get sampled dataset (for training the vector index). Args: project_dir (str): Path to Retro project dir. chunk_length (int): GPT
megatron/core/datasets/retro/db/utils.py:284
↓ 1 callers
Function
get_merged_train_dataset
Get training dataset (for adding to the vector index). Args: project_dir (str): Path to Retro project dir. chunk_length (int): GP
megatron/core/datasets/retro/db/utils.py:306
↓ 1 callers
Method
get_model_argv
Get argv list for customizing initialization.
tests/functional_tests/test_cases/common/ckpt_converter/__main__.py:113
↓ 1 callers
Function
get_model_provider
Based on evaluation metric set the parallel-output flag and return the model provider.
tasks/zeroshot_gpt/evaluate.py:24
↓ 1 callers
Function
get_model_xattn
Returns whether the model has the xattn_needed attribute
megatron/core/utils.py:146
↓ 1 callers
Function
get_moe_module_spec
Helper function to get module spec for MoE
megatron/core/models/gpt/moe_module_specs.py:27
↓ 1 callers
Function
get_neighbor_dir
Get directory containing neighbor IDs for a dataset (i.e., train, valid, or test). Args: project_dir (str): Retro project dir. ke
megatron/core/datasets/retro/query/utils.py:22
↓ 1 callers
Method
get_neighbor_tokens
(cls, sample_id: int, chunk_id: int, data_key: str="train")
tools/retro/cli/cli.py:176
↓ 1 callers
Function
get_ngrams_below_threshold
(args, ngrams, ngrams_below_threshold, \ dedup_file, dedup_key, ngrams_freq_sorted)
tools/openwebtext/filter_ngrams.py:286
↓ 1 callers
Function
get_nq_dataset
(qa_data, split)
tasks/orqa/unsupervised/nq.py:19
↓ 1 callers
Function
get_num_image_embeddings
Get the number of image embeddings per image tile.
megatron/core/models/vision/clip_vit_model.py:189
↓ 1 callers
Method
get_num_transfer_tokens
In the reverse process, the interval [0, 1] is uniformly discretized into steps intervals. Furthermore, because LLaDA employs a linea
tools/weights_conversion/hf_configs/gptneox_1.7b_dlm/modeling_dlm.py:774
↓ 1 callers
Method
get_num_transfer_tokens
In the reverse process, the interval [0, 1] is uniformly discretized into steps intervals. Furthermore, because LLaDA employs a linea
tools/weights_conversion/hf_configs/gpt2_1b_dlm/modeling_dlm.py:774
↓ 1 callers
Method
get_num_unfinalized_calls
Get the number of active async calls.
megatron/core/dist_checkpointing/strategies/async_utils.py:218
↓ 1 callers
Method
get_object
(self, Bucket: str, Key: str, Range: str)
megatron/core/datasets/utils_s3.py:43
↓ 1 callers
Function
get_one_epoch_dataloader
Specifically one epoch to be used in an indexing job.
megatron/legacy/data/biencoder_dataset_utils.py:25
↓ 1 callers
Function
get_one_epoch_nq_dataloader
Data loader. Note that batch-size is the local (per GPU) batch-size. NOTE: This dataloader is not distributed !!!
tasks/orqa/unsupervised/nq.py:64
↓ 1 callers
Function
get_open_retrieval_batch
(data_iterator)
megatron/legacy/data/orqa_wiki_dataset.py:28
↓ 1 callers
Function
get_optim_param_to_id_map
Generate mapping from optimizer param to optimizer state id.
megatron/core/dist_checkpointing/optimizer.py:29
↓ 1 callers
Function
get_optimizer_param_scheduler
Build the learning rate scheduler.
megatron/training/training_nan_skipping.py:656
↓ 1 callers
Function
get_optimizer_param_scheduler
Build the learning rate scheduler.
megatron/training/training.py:664
↓ 1 callers
Method
get_output
Gets the module forward output. This function is used to overlap shared experts with the dispatcher. It is only useful when -
megatron/core/transformer/moe/shared_experts.py:210
↓ 1 callers
Method
get_padded_vocab_size
Return the paded vocab size We extract the lm head and vocab embedding and use that to determine padded_vocab_size Returns:
megatron/core/export/trtllm/trtllm_weights_converter/single_device_trtllm_model_weights_converter.py:364
↓ 1 callers
Method
get_parameter_state_fs_bucket_space
Get internal representation of parameter state without any copies and modifications. This is referred to as "fully sharded bucket space" beca
megatron/core/optimizer/distrib_optimizer.py:787
↓ 1 callers
Method
get_params
Get a randomized transform to be applied on image. Arguments are same as that of __init__. Returns: Transform which rand
tasks/vision/segmentation/transforms.py:387
↓ 1 callers
Function
get_path_count
keeps tracks of number of times we've seen the input `path` and return count-1
megatron/core/config_logger.py:26
↓ 1 callers
Function
get_path_with_count
calls get_path_count and appends returned value to path
megatron/core/config_logger.py:38
↓ 1 callers
Method
get_query_key_value_tensors
Derives `query`, `key` and `value` tensors from `hidden_states`.
megatron/core/transformer/multi_latent_attention.py:290
↓ 1 callers
Function
get_rank
()
tasks/orqa/supervised/eval_utils.py:171
↓ 1 callers
Function
get_retro_decoder_block_spec
Retro decoder block spec. Retro decoder block implementation details: - The retro decoder block consists of interleaved GPT layers an
megatron/core/models/retro/decoder_spec.py:123
← previous
next →
1,501–1,600 of 4,219, ranked by callers