MCPcopy Create free account

hub / github.com/JinjieNi/MegaDLMs / functions

Functions4,219 in github.com/JinjieNi/MegaDLMs

↓ 1 callersMethod_select_layers_for_pipeline_parallel
(self, layer_type_list)
megatron/core/ssm/mamba_block.py:186
↓ 1 callersMethod_sequence_pointers
Build the sequence pointers per the sequence lengths and dtype size Args: sequence_lengths (List[int]): The length of each sequen
megatron/core/datasets/indexed_dataset.py:206
↓ 1 callersFunction_set_adlr_autoresume
Initialize ADLR autoresume.
megatron/training/global_vars.py:241
↓ 1 callersMethod_set_attention_backend
Set attention backend Transformer engine works based on optout. By default all three attention backend flags are set to 1. So if the user cho
megatron/core/models/common/language_module/language_module.py:30
↓ 1 callersFunction_set_capture_end
Set graph capture has ended.
megatron/core/transformer/cuda_graphs.py:47
↓ 1 callersFunction_set_capture_start
Set graph capture has started.
megatron/core/transformer/cuda_graphs.py:41
↓ 1 callersMethod_set_deep_tensor
(cls, obj, path, src)
tools/checkpoint/schema_base.py:43
↓ 1 callersFunction_set_global_memory_buffer
Initialize global buffer.
megatron/core/parallel_state.py:1739
↓ 1 callersFunction_set_one_logger
(args)
megatron/training/global_vars.py:217
↓ 1 callersFunction_set_rank_monitor_client
()
megatron/training/ft_integration.py:91
↓ 1 callersFunction_set_rerun_state_machine
Internal function to set the singleton instance of the rerun machine.
megatron/core/rerun_state_machine.py:1093
↓ 1 callersFunction_set_signal_handler
()
megatron/training/global_vars.py:69
↓ 1 callersFunction_set_tensorboard_writer
Set tensorboard writer.
megatron/training/global_vars.py:152
↓ 1 callersFunction_set_timers
Initialize timers.
megatron/training/global_vars.py:259
↓ 1 callersFunction_set_wandb_writer
(args)
megatron/training/global_vars.py:172
↓ 1 callersFunction_shard_size
Returns size in bytes of a given sharded tensor.
megatron/core/dist_checkpointing/exchange_utils.py:64
↓ 1 callersFunction_split_by_separation_hint
Splits buckets into those whose keys begin with the separation_hint and those whose keys do not Args: buckets (List[List[WriteItem]]
megatron/core/dist_checkpointing/strategies/filesystem_async.py:378
↓ 1 callersFunction_split_by_size_and_type
Splits write items according to item size into close to uniform bins. Same as torch.distributed.checkpoint.filesystem._split_by_size_and_typ
megatron/core/dist_checkpointing/strategies/filesystem_async.py:338
↓ 1 callersMethod_split_extra_state
(self, state)
megatron/core/extensions/transformer_engine.py:933
↓ 1 callersFunction_sut_act_transformer_forward
( self, hidden_states: Tensor, attention_mask: Tensor = None, key_value_states
megatron/core/transformer/custom_layers/ut_modules.py:843
↓ 1 callersMethod_tokenize_chinese_chars
Adds whitespace around any CJK character.
megatron/training/tokenizer/bert_tokenization.py:286
↓ 1 callersFunction_tokenize_prompts_and_batch
Given a set of prompts and number of tokens to generate: - tokenize prompts - set the sequence length to be the max of length of promp
tools/retro/text_generation/retro_api.py:53
↓ 1 callersFunction_tokenize_prompts_and_batch
Given a set of prompts and number of tokens to generate: - tokenize prompts - set the sequence length to be the max of length of promp
megatron/inference/text_generation/tokenization.py:93
↓ 1 callersFunction_train
Train the model.
tasks/finetune_utils.py:145
↓ 1 callersFunction_train
Train the model.
tasks/vision/finetune_utils.py:94
↓ 1 callersMethod_train
Train index (rank 0's method). Args: config (RetroPreprocessingConfig): Retro preprocessing config.
megatron/core/datasets/retro/index/indexes/faiss_base.py:35
↓ 1 callersFunction_train_index
Train index on DB chunks. Args: config (RetroPreprocessingConfig): Retro preprocessing config.
megatron/core/datasets/retro/index/build.py:183
↓ 1 callersFunction_transform
(img_h, img_w)
megatron/legacy/data/multimodal_dataset.py:19
↓ 1 callersMethod_unscale_main_grads_and_check_for_nan
(self)
megatron/core/optimizer/optimizer.py:379
↓ 1 callersFunction_unwrap_pyt_sharded_tensor
Unwrap tensor from PyT ShardedTensor instance. If `prepend_axis_num` was non-zero (which is specific to MCore ShardedTensor) then the tensor
megatron/core/dist_checkpointing/strategies/torch.py:373
↓ 1 callersMethod_update_causal_mask
( self, attention_mask: torch.Tensor, input_tensor: torch.Tensor, cache_positi
tools/weights_conversion/hf_configs/gptneox_1.7b_ar/modeling_ar.py:631
↓ 1 callersMethod_update_fp8_scale_inv_and_amax
If detect FP8 parameters, update their `_scale_inv` and do reduce-max for their `amax_history`.
megatron/core/optimizer/distrib_optimizer.py:1845
↓ 1 callersMethod_update_legacy_world_tensors
Reshard buckets (where each bucket is a tensor) to new target numels, where the total numel remains the same.
megatron/core/optimizer/distrib_optimizer.py:1272
↓ 1 callersFunction_update_min_and_max_lr_in_param_groups
Updates `max_lr` and `min_lr` values in each parameter group, and returns new list. By default, each group will use `lr` / `min_lr` as `max_l
megatron/core/optimizer/__init__.py:146
↓ 1 callersFunction_ut_act_transformer_forward
( self, hidden_states: Tensor, attention_mask: Tensor, context: Tensor = None,
megatron/core/transformer/custom_layers/ut_modules.py:428
↓ 1 callersFunction_validate_common_state_dict
Validate consistancy across ranks for the common state dict We save the common state dict only on rank 0. We validate to make sure that the commo
megatron/core/dist_checkpointing/validation.py:367
↓ 1 callersMethod_validate_global_shapes
(self, metadata, sharded_tensors)
megatron/core/dist_checkpointing/strategies/torch.py:525
↓ 1 callersFunction_validate_objects_for_key
Ensure uniqueness of saved objects.
megatron/core/dist_checkpointing/validation.py:504
↓ 1 callersFunction_validate_sharding_for_key
(rank_sharding: List[Tuple[int, ShardedTensor]])
megatron/core/dist_checkpointing/validation.py:432
↓ 1 callersFunction_version_no_greater_than
(version, version_limit)
megatron/core/ssm/triton_cache_manager.py:20
↓ 1 callersFunction_warmup_jit_function
Compilie JIT functions before the main training steps
megatron/training/initialize.py:395
↓ 1 callersMethod_with_pipelining_forward_step
No interleaving is supported.
megatron/inference/text_generation/forward_step.py:113
↓ 1 callersFunction_yarn_find_correction_range
( low_rot: float, high_rot: float, dim: int, rotary_base: float = 10000, max_position_embe
megatron/core/models/common/embeddings/yarn_rotary_pos_embedding.py:155
↓ 1 callersFunction_yarn_linear_ramp_mask
(min: float, max: float, dim: int)
megatron/core/models/common/embeddings/yarn_rotary_pos_embedding.py:167
↓ 1 callersFunctionaccimage_loader
(path: str)
megatron/legacy/data/image_folder.py:245
↓ 1 callersFunctionact_halt_function
(self, state)
megatron/core/transformer/custom_layers/ut_modules.py:374
↓ 1 callersFunctionact_sut_halt_function
(self, state)
megatron/core/transformer/custom_layers/ut_modules.py:799
↓ 1 callersMethodadd
Add to index. Args: config (RetroPreprocessingConfig): Retro preprocessing config. text_dataset (GPTToTextDataset): T
megatron/core/datasets/retro/index/indexes/faiss_base.py:131
↓ 1 callersMethodadd_additional_special_tokens
(self, tokens_list)
megatron/training/tokenizer/tokenizer.py:217
↓ 1 callersMethodadd_attributes
Utility to add more attributes to sampling params Use this method to pass in a custom dictionary to add more sampling parameter attributes.
megatron/core/inference/sampling_params.py:23
↓ 1 callersMethodadd_attributes
Utility to add more attributes to inference params Use this method to pass in a custom dictionary to add more configs to the instance created
megatron/core/inference/model_inference_wrappers/inference_wrapper_config.py:31
↓ 1 callersMethodadd_block_data
Add data for set of blocks :param row_id: 1D array of unique int ids for the blocks :param block_embeds: 2D array of embeddin
megatron/legacy/data/realm_index.py:62
↓ 1 callersMethodadd_codes
Read codes from disk, and add them to the index. Args: config (RetroPreprocessingConfig): Retro preprocessing config.
megatron/core/datasets/retro/index/indexes/faiss_par_add.py:133
↓ 1 callersFunctionadd_config_args
(parser, config_cls)
tools/retro/config_utils.py:526
↓ 1 callersMethodadd_document
Add an entire document to the dataset Args: tensor (torch.Tensor): The document to add lengths (List[int]): The leng
megatron/core/datasets/indexed_dataset.py:781
↓ 1 callersMethodadd_earliest_waiting_request_to_active_pool
Utility to add the waiting request to active pool This method will add the earliest request (FIFO) that is in the waiting request poo
megatron/core/inference/scheduler.py:85
↓ 1 callersMethodadd_embed_data
Add the embedding of each block to the underlying FAISS index
megatron/legacy/data/realm_index.py:187
↓ 1 callersFunctionadd_prefix_for_sharding
Prepend a given prefix to all ShardedBase objects in a given state dict *in-place*. Args: sharded_state_dict (ShardedStateDict): sharded
megatron/core/dist_checkpointing/utils.py:151
↓ 1 callersMethodadd_tokens
Add tokens to the tokenizer. No-op for this mock tokenizer.
tests/unit_tests/test_tokenizer.py:230
↓ 1 callersFunctionadjust_brightness
Adjust brightness of an Image. Args: img (PIL Image): PIL Image to be adjusted. brightness_factor (float): How much to adjust th
tasks/vision/segmentation/transforms.py:262
↓ 1 callersFunctionadjust_contrast
Adjust contrast of an Image. Args: img (PIL Image): PIL Image to be adjusted. contrast_factor (float): How much to adjust the con
tasks/vision/segmentation/transforms.py:282
↓ 1 callersFunctionadjust_hue
Adjust hue of an image. The image hue is adjusted by converting the image to HSV and cyclically shifting the intensities in the hue channel (
tasks/vision/segmentation/transforms.py:322
↓ 1 callersFunctionadjust_non_strict_load
Adjusts sharded state dict removing keys not existing in the checkpoint. Args: sharded_state_dict (ShardedStateDict): sharded state dict
megatron/core/dist_checkpointing/validation.py:254
↓ 1 callersFunctionadjust_saturation
Adjust color saturation of an image. Args: img (PIL Image): PIL Image to be adjusted. saturation_factor (float): How much to adj
tasks/vision/segmentation/transforms.py:302
↓ 1 callersMethodadvance
Method to drop all the buffered microbatches and jump to the next iteration.
megatron/core/rerun_state_machine.py:861
↓ 1 callersFunctionall_gather_item
(item, dtype, group=None, async_op=False, local_rank=None)
megatron/training/dist_signal_handler.py:29
↓ 1 callersMethodapply_input_jitter
Add noise to the input tensor. Refer to https://arxiv.org/abs/2101.03961. Args: input (Tensor): Input tensor. Re
megatron/core/transformer/moe/router.py:261
↓ 1 callersMethodapply_input_jitter
Add noise to the input tensor. Refer to https://arxiv.org/abs/2101.03961. Args: input (Tensor): Input tensor. Re
megatron/core/transformer/moe/router.py:417
↓ 1 callersMethodapply_load_balancing_loss
Calculate auxiliary loss, attach gradient function to activation and add to logging.
megatron/core/transformer/moe/router.py:370
↓ 1 callersMethodapply_loading_parallelization
Distributes the load across ranks by exchanging metadata. Exchanges metadata from the state dict and computes the uniform (as close a
megatron/core/dist_checkpointing/strategies/fully_parallel.py:305
↓ 1 callersFunctionapply_rotary_pos_emb
Applies Rotary Position Embedding to the query and key tensors. Args: q (`torch.Tensor`): The query tensor. k (`torch.Tensor`): T
tools/weights_conversion/hf_configs/gptneox_1.7b_dlm/modeling_dlm.py:92
↓ 1 callersFunctionapply_rotary_pos_emb
Applies Rotary Position Embedding to the query and key tensors. Args: q (`torch.Tensor`): The query tensor. k (`torch.Tensor`): T
tools/weights_conversion/hf_configs/gptneox_1.7b_ar/modeling_ar.py:86
↓ 1 callersFunctionapply_rotary_pos_emb
Applies Rotary Position Embedding to the query and key tensors. Args: q (`torch.Tensor`): The query tensor. k (`torch.Tensor`): T
tools/weights_conversion/hf_configs/gpt2_1b_dlm/modeling_dlm.py:92
↓ 1 callersMethodapply_sinkhorn_expert_choice_load_balancing
Apply sinkhorn-based expert choice to the logits tensor.
megatron/core/transformer/moe/router.py:468
↓ 1 callersMethodapply_softmax_expert_choice_load_balancing
Apply softmax-based expert choice to the logits tensor.
megatron/core/transformer/moe/router.py:438
↓ 1 callersMethodapply_z_loss
Encourages the router's logits to remain small to enhance stability. Please refer to the ST-MoE paper (https://arxiv.org/pdf/2202.08906.pdf) f
megatron/core/transformer/moe/router.py:239
↓ 1 callersMethodapply_z_loss
Encourages the router's logits to remain small to enhance stability. Please refer to the ST-MoE paper (https://arxiv.org/pdf/2202.08906.pdf) f
megatron/core/transformer/moe/router.py:395
↓ 1 callersMethodas_array
(self)
megatron/legacy/data/realm_dataset_utils.py:90
↓ 1 callersMethodas_tuple
(self)
megatron/legacy/data/realm_dataset_utils.py:93
↓ 1 callersFunctionassert_viewless_tensor
Assert that a tensor is not a view (i.e., its '._base' field is not set).
megatron/core/utils.py:239
↓ 1 callersFunctionattention_mask_func
(attention_scores, attention_mask)
megatron/legacy/model/utils.py:31
↓ 1 callersFunctionattn_mask_postprocess
(attn_mask)
megatron/legacy/model/t5_model.py:21
↓ 1 callersFunctionattn_mask_postprocess
(attn_mask)
megatron/core/models/T5/t5_model.py:427
↓ 1 callersMethodaux_loss_load_balancing
Apply loss-based load balancing to the logits tensor. Args: logits (torch.Tensor): the logits tensor after gating, shape: [num_to
megatron/core/transformer/moe/router.py:144
↓ 1 callersMethodbackward
Backward function.
megatron/core/tensor_parallel/mappings.py:452
↓ 1 callersFunctionbaseline_get_microbatch_id_in_model_chunk
Helper method to get the microbatch_id within model chunk given the iteration number.
tests/unit_tests/pipeline_parallel/test_helpers.py:13
↓ 1 callersFunctionbaseline_is_first_microbatch_for_model_chunk
Check if an iteration is the first for a model chunk.
tests/unit_tests/pipeline_parallel/test_helpers.py:22
↓ 1 callersFunctionbaseline_is_last_microbatch_for_model_chunk
Check if an iteration is the last for a model chunk.
tests/unit_tests/pipeline_parallel/test_helpers.py:32
↓ 1 callersFunctionbeam_search
(model, forward_step, prompts=None, tokens_to_generate=0, beam_size=0, add_BOS=False, stop_token=50256, num_re
megatron/inference/text_generation/api.py:206
↓ 1 callersFunctionbeam_search_and_return_on_first_stage
(model, forward_step, tokens, lengths, beam_size, stop_token, num_return_gen, length_penalty, prevent_newline_
megatron/inference/text_generation/generation.py:321
↓ 1 callersMethodbert_extended_attention_mask
Creates the extended attention mask Converts the attention mask of dimension [batch size, 1, seq len] to [batch size, 1, seq len, seq
megatron/core/models/bert/bert_model.py:229
↓ 1 callersMethodbert_position_ids
Position ids for bert model
megatron/core/models/bert/bert_model.py:261
↓ 1 callersFunctionbert_vocab
(odir)
tests/unit_tests/data/test_preprocess_data.py:207
↓ 1 callersFunctionbias_dropout_add_fused_train
( x_with_bias: Tuple[torch.Tensor, Optional[torch.Tensor]], residual: torch.Tensor, prob: float )
megatron/core/fusions/fused_bias_dropout.py:49
↓ 1 callersFunctionbias_dropout_add_unfused
(training)
megatron/core/fusions/fused_bias_dropout.py:41
↓ 1 callersFunctionbias_geglu
(bias, y)
megatron/core/fusions/fused_bias_geglu.py:23
↓ 1 callersFunctionbias_geglu_back
(g, y, bias)
megatron/core/fusions/fused_bias_geglu.py:43
↓ 1 callersFunctionbias_gelu
(bias, y)
megatron/core/fusions/fused_bias_gelu.py:17
↓ 1 callersFunctionbias_gelu_back
(g, bias, y)
megatron/legacy/model/fused_bias_gelu.py:24
↓ 1 callersFunctionbias_gelu_back
(g, bias, y)
megatron/core/fusions/fused_bias_gelu.py:26
← previousnext →1,201–1,300 of 4,219, ranked by callers