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
Method
difflm_forward_process
(self, input_ids)
megatron/core/models/difflm/gpt_model.py:303
↓ 1 callers
Method
dispatcher_capacity_test
(self)
tests/unit_tests/transformer/moe/test_token_dispatcher.py:133
↓ 1 callers
Method
dispatcher_drop_and_pad_test
Test if the tokens are dropped and padded correctly
tests/unit_tests/transformer/moe/test_token_dispatcher.py:168
↓ 1 callers
Function
distribute_shards_to_ranks
Computes uniform distribution of workload across ranks, based on sizes. Currently, the assignment is greedy, based on: 1. Firstly, the covera
megatron/core/dist_checkpointing/exchange_utils.py:122
↓ 1 callers
Function
do_setup
(odir)
tests/unit_tests/data/test_builder.py:35
↓ 1 callers
Function
do_test_preprocess_mmdata
(temp_dir, extra_args=[])
tests/unit_tests/data/test_preprocess_mmdata.py:58
↓ 1 callers
Function
domain_is_in_blacklist
(url)
tools/openwebtext/blacklist_urls.py:128
↓ 1 callers
Method
download_file
(self, Bucket: str, Key: str, Filename: str)
megatron/core/datasets/utils_s3.py:37
↓ 1 callers
Function
download_job_assets
(logs: List[jet_log.JETLog], iteration: int = 0)
tests/test_utils/python_scripts/launch_jet_workload.py:111
↓ 1 callers
Function
drain_embedding_wgrad_compute
Helper for performing embedding wgrad GEMM's during the pipeline drain phase, pipelines the AllGather and GEMM's. Should only be used when pi
megatron/core/utils.py:531
↓ 1 callers
Function
dummy_img
(odir_txt, odir_img)
tests/unit_tests/data/test_preprocess_mmdata.py:19
↓ 1 callers
Method
elapsed
This method is called from report(), or can be called directly It is called to collect all the elapsed time since last reset(). It
megatron/core/utils.py:986
↓ 1 callers
Function
embed_block
Embed block of chunks. Args: config (RetroPreprocessingConfig): Retro preprocessing config. gpt_dataset (GPTChunkDataset): Chunk
megatron/core/datasets/retro/query/query.py:69
↓ 1 callers
Method
embed_block
Embed a batch of tokens using the block model
megatron/legacy/model/realm_model.py:82
↓ 1 callers
Function
embed_data_loader
Iterate data loader and compute embeddings.
tools/bert_embedding/embed.py:96
↓ 1 callers
Method
embed_query
Embed a batch of tokens using the query model
megatron/legacy/model/realm_model.py:73
↓ 1 callers
Method
embed_text_blocks
Process a text dataset in blocks.
tools/bert_embedding/embed.py:227
↓ 1 callers
Method
embed_text_dataset
(self, text_dataset, verbose=True)
tools/bert_embedding/huggingface.py:81
↓ 1 callers
Function
embed_training_chunks
Embed DB chunks. Store chunks in blocks on disk. These blocks will later be merged into a single dataset for training the index. Args:
megatron/core/datasets/retro/index/build.py:134
↓ 1 callers
Function
empty_dir
(path: Path)
tests/unit_tests/dist_checkpointing/__init__.py:18
↓ 1 callers
Function
ems
(prediction, ground_truths)
tools/retro/text_generation/evaluate.py:118
↓ 1 callers
Function
encoder_model_with_local_spec
T5 encoder local spec (uses Megatron-Core components).
megatron/core/models/T5/t5_spec.py:117
↓ 1 callers
Function
encoder_model_with_transformer_engine_default_spec
T5 encoder TE spec (uses Transformer Engine components).
megatron/core/models/T5/t5_spec.py:47
↓ 1 callers
Function
ensemble_predictions
(args)
tasks/ensemble_classifier.py:120
↓ 1 callers
Function
ensure_divisibility
Ensure that numerator is divisible by the denominator.
megatron/core/utils.py:101
↓ 1 callers
Method
entities
Returns a list of named-entity-recognition tags of each token. Returns None if this annotation was not included.
tasks/orqa/unsupervised/tokenizers.py:83
↓ 1 callers
Function
evaluate
Evaluation.
megatron/training/training_nan_skipping.py:1758
↓ 1 callers
Function
evaluate
Evaluation.
megatron/training/training.py:1777
↓ 1 callers
Function
evaluate
Evaluation.
tasks/zeroshot_gpt/evaluate.py:114
↓ 1 callers
Function
evaluate_and_print_results
Evaluate and print results on screen.
tasks/zeroshot_gpt/evaluate.py:141
↓ 1 callers
Function
evaluate_ems
(prediction_file, ground_truth_file, dev_num=3000)
tools/retro/text_generation/evaluate.py:122
↓ 1 callers
Function
evaluate_f1
(ground_truth_file, prediction_file, reduced_test_only=False)
tools/retro/text_generation/evaluate.py:173
↓ 1 callers
Function
evaluate_f1
Evaluating F1 Score
tasks/msdp/evaluate.py:11
↓ 1 callers
Function
exact_match_score
(prediction, ground_truth)
tools/retro/text_generation/evaluate.py:114
↓ 1 callers
Function
expert_choice_softmax_with_capacity
Apply capacity and padding to the top-k selection. Args: logits (torch.Tensor): Logits tensor. topk (int): The average number of t
megatron/core/transformer/moe/moe_utils.py:497
↓ 1 callers
Function
extention_is_in_blacklist
(url)
tools/openwebtext/blacklist_urls.py:204
↓ 1 callers
Function
extra_args_provider_difflm
difflm arguments.
tools/checkpoint/model_args.py:70
↓ 1 callers
Function
extra_args_provider_plmt
plmt arguments.
tools/checkpoint/model_args.py:3
↓ 1 callers
Function
extract_data_config
Extract data config from dataset. Args: config (RetroPreprocessingConfig): Retro preprocessing config. Returns: The config o
megatron/core/datasets/retro/utils.py:49
↓ 1 callers
Function
extract_logs_to_string
(logs: List[jet_log.JETLog])
tests/test_utils/python_scripts/launch_jet_workload.py:127
↓ 1 callers
Function
extract_sharded_tensors
Extract a dict consisting of only ShardedTensor objects from a given state dict with any objects. Args: sharded_state_dict: state dic
megatron/core/dist_checkpointing/utils.py:54
↓ 1 callers
Method
faiss_wrapper
(self)
tasks/orqa/evaluate_utils.py:54
↓ 1 callers
Method
fake_initialize_model_parallel
Used for layer-wise UT as a proxy for NeMo-style intialization.
tests/unit_tests/test_utilities.py:121
↓ 1 callers
Function
falcon_to_megatron
(weights: dict, size: int)
tools/weights_conversion/hf_to_megatron_te.py:70
↓ 1 callers
Function
fast_hist
(pred, gtruth, num_classes)
tasks/vision/segmentation/finetune_segformer.py:31
↓ 1 callers
Method
fill_in_deferred_sharded_tensors
Fill in tensors not loaded by current rank with tensors from `loaded_tensors` map. Args: sharded_state_dict (ShardedStateDict): s
megatron/core/dist_checkpointing/strategies/fully_parallel.py:342
↓ 1 callers
Method
filter
(self, record: LogRecord)
megatron/training/log_handler.py:18
↓ 1 callers
Function
filter_by_environment
( workload_manifests: List[jetclient.JETWorkloadManifest], environment: str )
tests/test_utils/python_scripts/common.py:116
↓ 1 callers
Function
filter_by_model
Returns all workload with matching model.
tests/test_utils/python_scripts/common.py:135
↓ 1 callers
Function
filter_by_scope
Returns all workload with matching scope.
tests/test_utils/python_scripts/common.py:99
↓ 1 callers
Function
filter_by_tag
Returns all workload with matching tag.
tests/test_utils/python_scripts/common.py:152
↓ 1 callers
Function
filter_by_test_case
Returns a workload with matching name. Raises an error if there no or more than a single workload.
tests/test_utils/python_scripts/common.py:78
↓ 1 callers
Function
filter_by_test_cases
Returns a workload with matching name. Raises an error if there no or more than a single workload.
tests/test_utils/python_scripts/common.py:169
↓ 1 callers
Function
filter_corpus
(filename, out_filename, print_interval=10000)
tools/openwebtext/cleanup_dataset.py:32
↓ 1 callers
Function
finalize_checkpoint
(sample_model, model, params, verbose=False)
tools/checkpoint/hybrid_conversion.py:170
↓ 1 callers
Function
find_pair_urls_parallel
(args, lshcache, url_doc)
tools/openwebtext/find_duplicates.py:119
↓ 1 callers
Function
find_pair_urls_sequential
(args, lshcache, url_doc)
tools/openwebtext/find_duplicates.py:150
↓ 1 callers
Function
finish_mpu_init
()
megatron/training/initialize.py:101
↓ 1 callers
Method
finish_param_sync
Finishes param sync communication operation for this bucket. Dispatches next bucket's param sync if available, unless skip_next_bucke
megatron/core/distributed/param_and_grad_buffer.py:216
↓ 1 callers
Function
fix_fp8_params_lose_precision_when_loading_dist_ckpt
When "--fp8-param-gather" and "--use-dist-ckpt" are both enabled, the state dict read from dist-checkpoint loses precision (the weights read
megatron/training/checkpointing.py:1134
↓ 1 callers
Function
flan_format
(system, context, dialogue_turn, template_id=0)
tools/retro/sft/dataset_conv.py:317
↓ 1 callers
Function
flatten_products
Flattens a nested dict of products
tests/test_utils/python_scripts/common.py:24
↓ 1 callers
Function
flatten_state_dict
Flattens state dict into a single level dict. It's a copy of torch.distributed.checkpoint._nested_dict.flatten_state_dict which also accepts
megatron/core/dist_checkpointing/strategies/torch.py:100
↓ 1 callers
Function
flatten_workload
Flattens a workload with products into a list of workloads that don't have products.
tests/test_utils/python_scripts/common.py:37
↓ 1 callers
Function
float16_to_fp32
Convert fp16/bf16 `val` to fp32
megatron/legacy/model/module.py:150
↓ 1 callers
Function
float16_to_fp32
(val)
megatron/core/transformer/module.py:125
↓ 1 callers
Function
format_answer
(answer)
tools/retro/sft/dataset_conv.py:177
↓ 1 callers
Function
format_multichoice
(multichoice_options)
tools/retro/sft/dataset_conv.py:167
↓ 1 callers
Function
format_multichoice_question
(question, multichoice_options)
tools/retro/sft/dataset_conv.py:173
↓ 1 callers
Method
forward
Forward of RowParallelLinear Args: input_: 3D tensor whose order of dimension is [sequence, batch, hidden] Returns:
megatron/core/tensor_parallel/layers.py:1139
↓ 1 callers
Method
forward_all_selfattention
(self, x)
megatron/legacy/model/vision/esvit_swin_backbone.py:653
↓ 1 callers
Method
forward_features
(self, x)
megatron/legacy/model/vision/mit_backbone.py:296
↓ 1 callers
Method
forward_fused_softmax
(self, input, mask)
megatron/legacy/model/fused_softmax.py:192
↓ 1 callers
Method
forward_fused_softmax
(self, input, mask)
megatron/core/fusions/fused_softmax.py:172
↓ 1 callers
Method
forward_last_selfattention
(self, x)
megatron/legacy/model/vision/esvit_swin_backbone.py:644
↓ 1 callers
Method
forward_pass_with_pipeline_parallel_large_input_batch
Utility to carry out forward pass PP models. Runs the forward pass for models which are pipeline parallel. This is more complex than forward_
megatron/core/inference/model_inference_wrappers/abstract_model_inference_wrapper.py:143
↓ 1 callers
Method
forward_pass_with_pipeline_parallel_small_input_batch
Utility to carry out forward pass for PP models with very small inputs If a model is pipeline parallel, yet, the input global batch is very s
megatron/core/inference/model_inference_wrappers/abstract_model_inference_wrapper.py:106
↓ 1 callers
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/abstract_model_inference_wrapper.py:79
↓ 1 callers
Function
forward_step
Forward step.
tools/retro/sft/sft_retro.py:162
↓ 1 callers
Function
forward_step
Forward step.
tasks/zeroshot_gpt/evaluate.py:71
↓ 1 callers
Function
forward_step_wrapper
(gpt2_tiktoken_tokenizer)
tests/unit_tests/test_inference.py:21
↓ 1 callers
Method
forward_torch_softmax
(self, input, mask)
megatron/legacy/model/fused_softmax.py:210
↓ 1 callers
Method
forward_torch_softmax
(self, input, mask)
megatron/core/fusions/fused_softmax.py:190
↓ 1 callers
Method
forward_with_features
(self, x)
megatron/legacy/model/vision/esvit_swin_backbone.py:436
↓ 1 callers
Function
fp32_to_float16
Convert fp32 `val` to fp16/bf16
megatron/legacy/model/module.py:138
↓ 1 callers
Function
fp32_to_float16
(val, float16_convertor)
megatron/core/transformer/module.py:113
↓ 1 callers
Method
freeze
Freezes the async request, disallowing adding new finalization functions. Returns: AsyncRequest: new async request with all same
megatron/core/dist_checkpointing/strategies/async_utils.py:59
↓ 1 callers
Method
freeze
Freeze model modules. Make specific modules non-trainable by setting requires_grad to False. Args: freeze_language_model
megatron/core/models/multimodal/llava_model.py:255
↓ 1 callers
Method
from_dir
Get list of block files, and create map. Args: dir (str): Path to directory containing saved block files. block_size
megatron/core/datasets/retro/utils.py:306
↓ 1 callers
Function
fused_apply_rotary_pos_emb
Apply rotary positional embedding to input tensor T in `sbhd` format.
megatron/core/extensions/transformer_engine.py:1237
↓ 1 callers
Function
fused_vocab_parallel_cross_entropy
Performs cross entropy loss when logits are split across tensor parallel ranks Args: vocab_parallel_logits: logits split across tens
megatron/core/fusions/fused_cross_entropy.py:132
↓ 1 callers
Method
gather_indices
Gather tensors and concatinate along the first dimension.
megatron/legacy/model/transformer.py:226
↓ 1 callers
Function
gather_split_1d_tensor
Opposite of split_tensor_into_1d_equal_chunks. Gather values from tensor model parallel ranks. Returns a new Tensor with the gathered data.
megatron/core/tensor_parallel/utils.py:72
↓ 1 callers
Method
gaussian
(self, w_size, sigma)
tasks/vision/segmentation/metrics.py:445
↓ 1 callers
Function
gelu_impl
OpenAI's gelu implementation.
megatron/legacy/model/utils.py:47
↓ 1 callers
Function
gelu_impl
OpenAI's gelu implementation.
megatron/core/transformer/utils.py:43
↓ 1 callers
Method
gen_mask
(self, image_size, mask_size, mask_type, patch_size)
megatron/legacy/data/vit_dataset.py:109
↓ 1 callers
Function
generate
Given prompts and input parameters, run inference. Args: data_parallel (bool): Enable data parallel text generation. Returns:
megatron/inference/text_generation/api.py:87
↓ 1 callers
Method
generate
The megatron core inference backend generate function This backend returns the output generations as a dictionary. It returns the pro
megatron/core/inference/engines/mcore_engine.py:40
↓ 1 callers
Function
generate_and_write_samples
(model)
tools/run_vlm_text_generation.py:160
← previous
next →
1,401–1,500 of 4,219, ranked by callers