MCPcopy Create free account

hub / github.com/JinjieNi/MegaDLMs / functions

Functions4,219 in github.com/JinjieNi/MegaDLMs

Methodmodify_logits_for_top_p_filtering
Set the logits for none top-p values to -inf.
megatron/core/inference/text_generation_controllers/text_generation_controller.py:105
Functionmoe_freq_type
Frequency between MoE layers and Dense layers. Accepts either: - An integer N: Represents a 1:N ratio, meaning one expert layer for every N-1
megatron/training/arguments.py:161
Functionmulti_no_sync
()
megatron/core/pipeline_parallel/schedules.py:595
Methodmy_rank
Can be called to get configured rank of this instance Returns: int: Configured rank for this instance
megatron/core/utils.py:1328
Functionname_from_datapath
(datapath)
tasks/glue/finetune.py:64
Methodngrams
Returns a list of all ngrams from length 1 to n. Args: n: upper limit of ngram length uncased: lower cases text
tasks/orqa/unsupervised/tokenizers.py:91
Methodno_sync
Context manager that turns off gradient synchronization.
megatron/core/distributed/data_parallel_base.py:25
Methodno_sync
Context manager that turns off gradient synchronization.
megatron/core/distributed/distributed_data_parallel.py:391
Methodno_weight_decay
(self)
megatron/legacy/model/vision/esvit_swin_backbone.py:590
Methodno_weight_decay
(self)
megatron/legacy/model/vision/swin_backbone.py:562
Methodno_weight_decay_keywords
(self)
megatron/legacy/model/vision/esvit_swin_backbone.py:594
Methodno_weight_decay_keywords
(self)
megatron/legacy/model/vision/swin_backbone.py:566
Methodnull_method
Default method to initialize start/stop method ptrs
megatron/core/utils.py:1345
Methodnumel_low_level_dataset
(low_level_dataset: LowLevelDataset)
tools/retro/sft/dataset_conv.py:73
Methodnumel_low_level_dataset
Abstract method implementation Args: low_level_dataset (MockGPTLowLevelDataset): The underlying MockGPTLowLevelDataset R
megatron/core/datasets/gpt_dataset.py:798
Methodnumel_low_level_dataset
Abstract method implementation For GPT, the underlying IndexedDataset should be split by sequence, as opposed to, say, BERT, which sh
megatron/core/datasets/gpt_dataset.py:930
Methodnumel_low_level_dataset
Return the number of elements in the underlying low level dataset for the purpose of segregating the train/valid/test split indices I
megatron/core/datasets/megatron_dataset.py:71
Methodnumel_low_level_dataset
(low_level_dataset: IndexedDataset)
megatron/core/datasets/masked_dataset.py:116
Methodnumel_low_level_dataset
(low_level_dataset: LowLevelDataset)
tests/unit_tests/data/test_builder.py:80
Methodoffsets
Convert embedding ids to text offsets Args: ids (list[int]): The ids to convert text (str): The text to convert
megatron/core/datasets/megatron_tokenizer.py:60
Methodoffsets
(self, ids: list[int], text: str)
megatron/training/tokenizer/tokenizer.py:163
Methodoffsets
(self, ids: list[int], text: str)
megatron/training/tokenizer/tokenizer.py:484
Methodoffsets
(self, ids: list[int], text: str)
megatron/training/tokenizer/tokenizer.py:758
Methodold_round_impl
(after, multiple)
tests/unit_tests/test_training.py:46
Functionon_pretrain_start
Function to be called at the start of pretrain function to track E2E meta data
megatron/training/one_logger_utils.py:260
Functionon_save_checkpoint_end
Function to be called after checkpointing ends Args: save_checkpoint_duration (float): duration of current save checkpoint process
megatron/training/one_logger_utils.py:367
Functionon_train_start
Function will be called at the start of train function to prepare and track E2E metrics. Args: iteration (int): current iteration number
megatron/training/one_logger_utils.py:16
Functionopenai_gelu
(x)
megatron/legacy/model/utils.py:52
Functionopenai_gelu
(x)
megatron/core/transformer/utils.py:48
Methodpad
(self)
megatron/training/tokenizer/tokenizer.py:269
Methodpad
(self)
megatron/training/tokenizer/tokenizer.py:496
Methodpad
Pad token ID.
megatron/training/tokenizer/multimodal_tokenizer.py:252
Functionpad_and_convert_to_numpy
Pad sequences and convert them to numpy.
megatron/legacy/data/dataset_utils.py:378
Methodparam_groups
Get param_groups aggregated over underlying optimizers.
megatron/core/optimizer/optimizer.py:958
Methodparams
Return a list of information on function params.
tools/retro/config_utils.py:176
Functionpassthrough_collate_fn
A collate_fn that simply returns the batch of samples as a list, without trying to stack them into tensors.
megatron/legacy/data/data_samplers.py:13
Functionpermute_qkv_bias
(bias_qkv: torch.Tensor, dim: int, n_heads: int, n_heads_kv: int, revert: bool = False)
tools/weights_conversion/utils/permute_qkv.py:41
Methodpos
Returns a list of part-of-speech tags of each token. Returns None if this annotation was not included.
tasks/orqa/unsupervised/tokenizers.py:67
Methodpostprocess
(self, model_outputs)
tools/bert_embedding/huggingface.py:53
Methodprep_model_for_inference
A utility function for preparing model for inference The function gets called once before the auto regressive inference loop. It puts the mod
megatron/core/inference/model_inference_wrappers/abstract_model_inference_wrapper.py:51
Methodprep_model_for_inference
A utility function for preparing model for inference This function is called before the forward pass. It puts the model in eval mode, builds
megatron/core/inference/model_inference_wrappers/gpt/gpt_inference_wrapper.py:30
Methodprep_model_for_inference
Preparing batch for inference, using respective wrapper's prep_model_for_inference method Args: prompts_tokens (torch.Tensor): A
megatron/core/inference/text_generation_controllers/encoder_decoder_text_generation_controller.py:20
Methodprepare_grads
Pre-processing gradients before the optimizer step, returns whether inf/nan is found.
megatron/core/optimizer/optimizer.py:177
Functionpreprocess_common_state_dict
(common_state_dict)
megatron/training/training_nan_skipping.py:225
Functionpreprocess_common_state_dict
(common_state_dict)
megatron/training/training.py:221
Methodpreprocess_fn
(x)
tests/unit_tests/dist_checkpointing/test_serialization.py:111
Methodpreprocess_fn
(optim_common_dict)
tests/unit_tests/dist_checkpointing/test_optimizer.py:406
Functionpretrain
( train_valid_test_dataset_provider, model_provider, model_type, forward_step_func, proces
megatron/training/training_nan_skipping.py:440
Methodprint_neighbor_texts
(cls, sample_id: int, chunk_id: int, data_key: str="train")
tools/retro/cli/cli.py:193
Functionprint_params_min_max_norm
Print min, max, and norm of all parameters.
megatron/training/utils.py:202
Functionprintable_text
Returns text encoded in a way suitable for print or `tf.logging`.
megatron/training/tokenizer/bert_tokenization.py:101
Methodprocess_arg
(arg)
megatron/core/transformer/cuda_graphs.py:649
Functionprocess_doc
(json_line, args)
tools/openwebtext/cleanup_fix_dataset.py:23
Methodprocess_json_file
(self, file_name)
tools/preprocess_data.py:147
Methodprocess_samples_from_single_path
Implement abstract method.
tasks/orqa/supervised/data.py:249
Methodprocess_samples_from_single_path
Implement abstract method.
tasks/glue/mnli.py:21
Methodprocess_samples_from_single_path
Implement abstract method.
tasks/glue/qqp.py:21
Functionptb_detokenizer
(string)
tasks/zeroshot_gpt/detokenizer.py:8
Functionpytest_sessionfinish
(session, exitstatus)
tests/unit_tests/conftest.py:13
Functionpytest_sessionfinish
(session, exitstatus)
tests/unit_tests/dist_checkpointing/conftest.py:8
Functionpytest_sessionfinish
(session, exitstatus)
tests/unit_tests/transformer/moe/conftest.py:13
Functionquick_gelu
(x: torch.Tensor)
megatron/training/activations.py:14
Methodread
Read bytes into a numpy array. Args: dtype (Type[numpy.number]): Data-type of the returned array. count (int): Numbe
megatron/core/datasets/indexed_dataset.py:375
Methodread
Read bytes into a numpy array. Args: dtype (Type[numpy.number]): Data-type of the returned array. count (int): Numbe
megatron/core/datasets/indexed_dataset.py:407
Methodread
Read bytes into a numpy array. Let `size` be the `count` * `DType.size(dtype)`. If the requested span of bytes [`offset`, `offset` +
megatron/core/datasets/indexed_dataset.py:453
Functionrebuild_tokenizer
(args)
megatron/training/global_vars.py:146
Functionreconfigure_num_microbatches_calculator
Reconfigure number of microbatches calculator. Supporting backward compatibility. Args: rank (int): Rank of the GPU, only ran
megatron/core/num_microbatches_calculator.py:107
Functionrecv_backward
Receive tensor from next rank in pipeline (backward receive). See _communicate for argument details.
megatron/core/pipeline_parallel/p2p_communication.py:436
Functionreduce_scatter_last_dim_to_tensor_parallel_region
Wrapper for autograd function: forward: RS, backward AG: AG <last dim>
megatron/core/tensor_parallel/mappings.py:519
Functionregister_debug_hooks
Attach forward hooks to every submodule of `model` so that we can log input and output shapes (and a small slice of their data) to `logfi
tools/weights_conversion/utils/verify_correctness_dlm.py:50
Methodreload_model_params
Refreshes any internal state from the current model parameters. Call whenever the parameters are changed outside of the optimizer. For
megatron/core/optimizer/optimizer.py:239
Methodreload_model_params
(self)
megatron/core/optimizer/optimizer.py:376
Methodreload_model_params
(self)
megatron/core/optimizer/optimizer.py:983
Methodremove_extra_states_check
Remove _extra_state from unexpected keys. These keys are for dist ckpt compatibility with SequentialMLP.
megatron/core/transformer/moe/experts.py:198
Methodremove_sharded_tensors
Removes checkpoint files whose keys have the given prefix. Performs the following steps: 1. checks whether there are files that start
megatron/core/dist_checkpointing/strategies/torch.py:854
Methodreset
Reset timer.
megatron/core/timers.py:36
Methodreset
(self)
megatron/core/timers.py:58
Methodreset
Reset the internal RNG state.
megatron/core/extensions/transformer_engine.py:1142
Methodreset_drop_path
(self, drop_path_rate)
megatron/legacy/model/vision/mit_backbone.py:275
Methodreset_index
Delete existing index and create a new
megatron/legacy/data/realm_index.py:166
Methodreshape_inputs
(self, input_ids, position_ids, attention_mask, labels, target_l)
megatron/core/models/difflm/gpt_model.py:327
Functionresolve_cluster_config
(cluster: str)
tests/test_utils/python_scripts/common.py:12
Methodresolve_tensor
Override to add FP8 support. Narrowing the Float8Tensor can create incontiguous tensors and there are no `copy` kernels for such case
megatron/core/dist_checkpointing/strategies/torch.py:550
Methodrestore_custom_attrs
(module, custom_attrs)
megatron/core/distributed/torch_fully_sharded_data_parallel.py:76
Methodreturns
Return a single information on function return. Takes the first return information.
tools/retro/config_utils.py:190
Methodrotate_with_fill
Define rotation transformation with fill. The input image is first rotated, then it is blended together with a gray mask of t
megatron/legacy/data/autoaugment.py:211
Methodrouting
Routing function. Args: logits (torch.Tensor): Logits tensor. Returns: Tuple[torch.Tensor, torch.Tensor]: A
megatron/core/transformer/moe/router.py:70
Methodsave
Each async strategy can be trivially used as a sync strategy.
megatron/core/dist_checkpointing/strategies/base.py:220
Methodsave
(self, sharded_state_dict: ShardedStateDict, checkpoint_dir: Path)
megatron/core/dist_checkpointing/strategies/zarr.py:74
Functionsave_checkpoint
(queue, args)
tools/checkpoint/saver_core.py:39
Functionsave_checkpoint
(queue, args)
tools/checkpoint/saver_legacy.py:24
Methodsave_common
Save common part of the state dict.
megatron/core/dist_checkpointing/strategies/common.py:38
Methodsave_custom_attrs
(module)
megatron/core/distributed/torch_fully_sharded_data_parallel.py:69
Methodsave_parameter_state
Save the distributed parameter state on DP rank 0. Args: filename (str): path to save parameter state to.
megatron/core/optimizer/distrib_optimizer.py:930
Methodsave_sharded_objects
Save sharded objects from the state dict.
megatron/core/dist_checkpointing/strategies/common.py:43
Methodsave_vocabulary
Save the tokenizer vocabulary and merge files to a directory.
megatron/training/tokenizer/gpt2_tokenization.py:291
Methodscale
(self)
megatron/core/optimizer/grad_scaler.py:18
Methodscale_gradients
Scale the gradient data by `scaling_factor`.
megatron/core/distributed/param_and_grad_buffer.py:660
Methodscale_gradients
Scale all gradients inside the buffers by `scaling_factor`.
megatron/core/distributed/distributed_data_parallel.py:449
Methodscale_loss
Simple scaling.
megatron/core/optimizer/optimizer.py:234
← previousnext →3,401–3,500 of 4,219, ranked by callers