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
get_retro_encoder_block_spec
Retro encoder block spec. The retro encoder block consists of one customized Retro encoder layer (layer 1), and all of the following layers a
megatron/core/models/retro/encoder_spec.py:118
↓ 1 callers
Function
get_retro_preprocessing_config
()
tools/retro/preprocess_data.py:199
↓ 1 callers
Function
get_router_linear_layer
(config)
megatron/legacy/model/transformer.py:194
↓ 1 callers
Method
get_save_function_and_args
Get function that saves the data to storage along with its arguments. Allows the external caller to apply the save function synchrono
megatron/core/dist_checkpointing/strategies/filesystem_async.py:150
↓ 1 callers
Function
get_start_time_from_progress_log
Gets start time of earliest job with same world size. Also returns the number of floating-point operations completed in last saved checkpoint
megatron/training/training_nan_skipping.py:180
↓ 1 callers
Function
get_start_time_from_progress_log
Gets start time of earliest job with same world size. Also returns the number of floating-point operations completed in last saved checkpoint
megatron/training/training.py:176
↓ 1 callers
Function
get_student_backbone_and_num_features
(config, pre_process=True, post_process=True)
megatron/legacy/model/vision/dino.py:176
↓ 1 callers
Function
get_tasks_args
Provide extra arguments required for tasks.
tools/retro/sft/sft_retro.py:26
↓ 1 callers
Function
get_te_version_str
()
megatron/core/utils.py:66
↓ 1 callers
Function
get_teacher_backbone_and_num_features
(config, pre_process=True, post_process=True)
megatron/legacy/model/vision/dino.py:198
↓ 1 callers
Function
get_threshold
(all_predictions, all_labels, one_threshold=False)
tasks/ensemble_classifier.py:36
↓ 1 callers
Method
get_tokens
(self, text)
tasks/zeroshot_gpt/datasets.py:86
↓ 1 callers
Function
get_torch_version_str
()
megatron/core/utils.py:49
↓ 1 callers
Function
get_train_valid_test_num_samples
Train/valid/test num samples.
megatron/training/training_nan_skipping.py:1935
↓ 1 callers
Function
get_train_valid_test_split_
Get dataset splits from comma or '/' separated string list.
megatron/legacy/data/dataset_utils.py:614
↓ 1 callers
Function
get_training_data_block_paths
Get paths to saved embedding blocks. Args: config (RetroPreprocessingConfig): Retro preprocessing config. Returns: Paths of
megatron/core/datasets/retro/index/utils.py:78
↓ 1 callers
Function
get_world_size
()
megatron/training/dist_signal_handler.py:7
↓ 1 callers
Method
global_coordinates
Returns a tuple of np.ndarrays representing the coordinates of the global tensor that this ShardedTensor corresponds to.
megatron/core/dist_checkpointing/mapping.py:167
↓ 1 callers
Function
glue_classification
(num_classes, Dataset, name_from_datapath_func)
tasks/glue/finetune.py:14
↓ 1 callers
Function
golden_rank_result_from_past_code
( world_size: int, tensor_model_parallel_size: int = 1, pipeline_model_parallel_size:
tests/unit_tests/test_parallel_state.py:327
↓ 1 callers
Function
has_answer
Check if a document contains an answer string. If `match_type` is string, token matching is done between the text and answer. If
tasks/orqa/unsupervised/qa_utils.py:111
↓ 1 callers
Method
has_position_embeddings
(self, model)
tools/checkpoint/schema_base.py:90
↓ 1 callers
Method
head_object
(self, Bucket: str, Key: str)
megatron/core/datasets/utils_s3.py:41
↓ 1 callers
Function
hf_provider
(args, cache_dir: Optional[Path], device: str, bf16: bool = False)
tools/weights_conversion/utils/verify_correctness_dlm.py:98
↓ 1 callers
Method
hue
Hue distortion.
tasks/vision/segmentation/transforms.py:86
↓ 1 callers
Function
import_class_by_path
(path: str)
tests/unit_tests/test_imports.py:26
↓ 1 callers
Function
init_indexed_dataset_infos
Gather meta-info about each indexed dataset. The returned info array allows for easy access to the configuration, and helps remove ambiguity.
megatron/core/datasets/retro/db/utils.py:32
↓ 1 callers
Method
init_llava_model
(self)
tests/unit_tests/models/test_llava_model.py:485
↓ 1 callers
Function
init_merged_ckpt
(pth_00, num_pth=8, emb_dim=8192)
tools/weights_conversion/utils/merge_llama.py:39
↓ 1 callers
Function
init_method_normal
Init method based on N(0, sigma).
megatron/core/utils.py:269
↓ 1 callers
Function
init_num_microbatches_calculator
Initialize number of microbatches calculator. Supporting backward compatibility. Args: rank (int): Rank of the GPU, only rank
megatron/core/num_microbatches_calculator.py:64
↓ 1 callers
Function
initialize_megatron_retro
Initialize megatron & save Retro config.
tools/retro/preprocess_data.py:57
↓ 1 callers
Function
inspect_index
Given a path prefix (without '.bin' or '.idx'), load the indexed dataset and print out some basic information such as total number of sequenc
tools/count_tokens.py:46
↓ 1 callers
Method
is_current_async_call_done
Check if async save is finished on all ranks. For semantic correctness, requires rank synchronization in each check. This method must
megatron/core/dist_checkpointing/strategies/async_utils.py:107
↓ 1 callers
Method
is_done
If there are enough hypotheses and that none of the hypotheses being generated can become better than the worst one in the heap, then
megatron/inference/text_generation/beam_utils.py:51
↓ 1 callers
Method
is_first_pp_rank
(self)
tests/unit_tests/export/trtllm/test_trtllm_single_device_converter.py:133
↓ 1 callers
Function
is_initialized
Useful for code segments that may be accessed with or without mpu initialization
megatron/core/parallel_state.py:1004
↓ 1 callers
Method
is_kernel_available
(self, mask, b, np, sq, sk)
megatron/legacy/model/fused_softmax.py:170
↓ 1 callers
Method
is_kernel_available
(self, mask, b, np, sq, sk)
megatron/core/fusions/fused_softmax.py:150
↓ 1 callers
Method
is_last_pp_rank
(self)
tests/unit_tests/export/trtllm/test_trtllm_single_device_converter.py:136
↓ 1 callers
Function
is_pipeline_first_stage
Return True if in the first pipeline model-parallel stage, False otherwise.
megatron/core/parallel_state.py:1276
↓ 1 callers
Function
is_pipeline_last_stage
Return True if in the last pipeline-model-parallel stage, False otherwise.
megatron/core/parallel_state.py:1287
↓ 1 callers
Function
is_pipeline_stage_after_split
Return True if pipeline stage executes decoder block for a model with both encoder and decoder.
megatron/core/parallel_state.py:1342
↓ 1 callers
Function
is_pipeline_stage_before_split
Return True if pipeline stage executes encoder block for a model with both encoder and decoder.
megatron/core/parallel_state.py:1327
↓ 1 callers
Function
is_valid_file
(x: str)
megatron/legacy/data/image_folder.py:93
↓ 1 callers
Function
iter_finalize_fn
()
megatron/training/checkpointing.py:496
↓ 1 callers
Function
jaccard
(set_a, set_b, args)
tools/openwebtext/find_duplicates.py:24
↓ 1 callers
Function
launch_and_wait_for_completion
( test_case: str, environment: str, n_repeat: int, time_limit: int, container_image: Optio
tests/test_utils/python_scripts/launch_jet_workload.py:35
↓ 1 callers
Method
linear_fc1_forward_and_act
Do Linear FC1 and activation function forward. This function is used to overlap shared experts with the dispatcher. It is onl
megatron/core/transformer/moe/shared_experts.py:128
↓ 1 callers
Method
linear_fc2_forward
Do Linear FC2 forward. This function is used to overlap shared experts with the dispatcher. It is only useful when --moe-shar
megatron/core/transformer/moe/shared_experts.py:175
↓ 1 callers
Function
linear_with_frozen_weight
Linear layer execution with weight.requires_grad == False. This function handles linear layers with weight frozen (untrainable). In the forwa
megatron/core/tensor_parallel/layers.py:329
↓ 1 callers
Function
llama_to_megatron
(weights: dict, size: int, source: str = "meta", version: int = 1)
tools/weights_conversion/hf_to_megatron_te.py:127
↓ 1 callers
Function
load
(args)
megatron/legacy/fused_kernels/__init__.py:17
↓ 1 callers
Function
load_and_flatten
Wrapper function for doing all the fun at once.
tests/test_utils/python_scripts/common.py:71
↓ 1 callers
Function
load_args_from_checkpoint
(args)
tools/checkpoint/loader_mixtral_hf.py:26
↓ 1 callers
Function
load_args_from_checkpoint
(args, model_size)
tools/checkpoint/loader_llama_mistral.py:278
↓ 1 callers
Method
load_attributes
Load the necessary attributes: model, dataloader and empty BlockData
megatron/legacy/indexer.py:43
↓ 1 callers
Function
load_checkpoint_to_model
Set model params.
tools/checkpoint/loader_mixtral_hf.py:128
↓ 1 callers
Function
load_checkpoint_to_model
Set model params.
tools/checkpoint/loader_llama_mistral.py:382
↓ 1 callers
Method
load_doc_tuples
Load the dataset & document ids. Load the dataset id & document id of each chunk in the database, to be used for causality filtering
megatron/core/datasets/retro/db/dataset.py:90
↓ 1 callers
Function
load_groundtruth_file
(data_file)
tools/retro/text_generation/evaluate.py:66
↓ 1 callers
Function
load_modelopt_checkpoint
Load a sharded (untar .nemo or megatron --use-dist-ckpt) or unsharded checkpoint. Essentially, the function is detecting whether the checkpoint i
megatron/inference/checkpointing.py:82
↓ 1 callers
Function
load_modelopt_state
Loading modelopt_state without loading the model. If --use-dist-ckpt, we try to load from the sharded modelopt_state. This will not load the mode
megatron/inference/checkpointing.py:23
↓ 1 callers
Method
load_parameter_state
Load the distributed parameter states of all optimizers from a file. Args: filename (str): path to load parameter state from.
megatron/core/optimizer/optimizer.py:1097
↓ 1 callers
Method
load_parameter_state_from_dp_zero_legacy
Load parameter state (i.e., parameter & optimizer tensors) from DP 0 rank, using the legacy checkpoint format as described below. The
megatron/core/optimizer/distrib_optimizer.py:1291
↓ 1 callers
Method
load_parameter_state_from_fs_bucket_space
Loads the parameter state from an internal representation. Inverse of the `get_parameter_state_fs_bucket_space` method.
megatron/core/optimizer/distrib_optimizer.py:1212
↓ 1 callers
Method
load_parameter_state_from_fs_model_space
Loads the parameter state from a "model space" representation. Inverse of the `sharded_param_state_fs_model_space` method.
megatron/core/optimizer/distrib_optimizer.py:1252
↓ 1 callers
Function
load_prediction
(data_file)
tools/retro/text_generation/evaluate.py:164
↓ 1 callers
Function
load_retro_args
Load predefined args from Retro config (if applicable). When using Retro (or GPT for comparison purposes), data arguments are overridden by t
megatron/training/arguments.py:102
↓ 1 callers
Method
load_sharded_objects
Load sharded objects from the checkpoint.
megatron/core/dist_checkpointing/strategies/base.py:121
↓ 1 callers
Method
load_state_dict
Customized load.
megatron/legacy/model/bert_model.py:243
↓ 1 callers
Method
load_state_dict
Load the state dict. Args: state_dict (dict): state dict to be load
megatron/core/optimizer_param_scheduler.py:234
↓ 1 callers
Method
load_state_dict
Method that restores the state from a checkpoint. Args: state_dict: the state dict saved in the checkpoint and originally
megatron/core/rerun_state_machine.py:689
↓ 1 callers
Method
load_state_dict
Copies parameters and buffers from state_dict into the wrapped module and its descendants. If strict is True, then the keys of state_
megatron/core/distributed/data_parallel_base.py:90
↓ 1 callers
Method
load_tensor_from_storage
(self, checkpoint_dir, ten_meta: _ShardedTensorMetadata)
megatron/core/dist_checkpointing/strategies/two_stage.py:126
↓ 1 callers
Method
load_tensors_metadata
Uses tensors metadata stored in the metadata file.
megatron/core/dist_checkpointing/strategies/torch.py:806
↓ 1 callers
Function
load_vocab
Loads a vocabulary file into a dictionary.
megatron/training/tokenizer/bert_tokenization.py:124
↓ 1 callers
Function
load_yaml
(yaml_path)
megatron/training/yaml_arguments.py:449
↓ 1 callers
Method
local_coordinates
Returns a tuple of np.ndarrays representing the coordinates of the local tensor that this ShardedTensor corresponds to.
megatron/core/dist_checkpointing/mapping.py:189
↓ 1 callers
Function
local_multi_tensor_applier
Multi tensor op applier
megatron/core/utils.py:619
↓ 1 callers
Function
local_step
()
megatron/core/dist_checkpointing/strategies/state_dict_saver.py:84
↓ 1 callers
Function
log_on_each_pipeline_stage
Log on first rank in each pipeline stage Args: logger (logging.Logger): The logger to write the logs args (Tuple[Any]): All logg
megatron/core/utils.py:307
↓ 1 callers
Function
loss_func
Loss function. Args: loss_mask (torch.Tensor): Used to mask out some portions of the loss output_tensor (torch.Tensor): The tenso
pretrain_difflm.py:251
↓ 1 callers
Function
loss_func
(output_predictions, labels, output_tensor)
tasks/eval_utils.py:90
↓ 1 callers
Function
lower
(text)
tools/retro/text_generation/evaluate.py:28
↓ 1 callers
Function
lower
(text)
tasks/orqa/unsupervised/qa_utils.py:170
↓ 1 callers
Function
main
Count tokens from all tokenized (_document.bin) files in a directory using IndexedDatasetCustom. This avoids memory-mapping the index file.
tools/count_tokens.py:69
↓ 1 callers
Function
main
Vision language model text generation.
tools/run_vlm_text_generation.py:197
↓ 1 callers
Function
main
()
tools/preprocess_mmdata.py:124
↓ 1 callers
Function
main
()
tools/preprocess_data_nmt.py:69
↓ 1 callers
Function
main
()
tools/preprocess_data.py:256
↓ 1 callers
Function
main
()
tools/merge_datasets.py:57
↓ 1 callers
Function
main
(model_name: str = "falcon", size: int = 7, out: Optional[Path] = None, cache_dir: Optional[Path] = N
tools/weights_conversion/hf_to_megatron_te.py:398
↓ 1 callers
Function
main
()
tools/weights_conversion/megatron_to_hf_te.py:303
↓ 1 callers
Function
main
()
tools/weights_conversion/utils/verify_correctness_dlm.py:186
↓ 1 callers
Function
main
(args)
tools/checkpoint/hybrid_conversion.py:222
↓ 1 callers
Function
main
()
tools/checkpoint/convert.py:124
↓ 1 callers
Function
main
Main program.
tools/retro/text_generation/retro_text_generation.py:240
↓ 1 callers
Function
main
(model: Optional[str], scope: Optional[str], test_case: Optional[str], output_path: str)
tests/test_utils/python_scripts/generate_local_jobs.py:39
↓ 1 callers
Function
main
( model: str, test_case: str, environment: str, n_repeat: int, time_limit: int, accoun
tests/test_utils/python_scripts/launch_jet_workload.py:184
← previous
next →
1,601–1,700 of 4,219, ranked by callers