MCPcopy Create free account

hub / github.com/JinjieNi/MegaDLMs / functions

Functions4,219 in github.com/JinjieNi/MegaDLMs

Methodget_output_embeddings
(self)
tools/weights_conversion/hf_configs/gpt2_1b_dlm/modeling_dlm.py:761
Functionget_pipeline_model_parallel_decoder_start
Return decoder start rank (if encoder pipeline parallelism is set).
megatron/core/parallel_state.py:1395
Functionget_pipeline_model_parallel_first_rank
Return the global rank of the first stage in the current rank's pipeline.
megatron/core/parallel_state.py:1456
Functionget_pipeline_model_parallel_last_rank
Return the global rank of the last stage in the current rank's pipeline.
megatron/core/parallel_state.py:1468
Functionget_pipeline_model_parallel_split_rank
Return pipeline-model-parallel split rank.
megatron/core/parallel_state.py:1270
Functionget_position_embedding_group
Get the position embedding group the caller rank belongs to.
megatron/core/parallel_state.py:1126
Methodget_pt_dataset
(cls, data_key: str)
tools/retro/cli/cli.py:168
Methodget_pt_num_chunks
Number of pretraining chunks (e.g., 32*n_samples).
tools/retro/cli/cli.py:163
Methodget_pt_num_samples
Number of pretraining samples.
tools/retro/cli/cli.py:158
Functionget_pyt_dist_save_sharded_strategy
()
tests/unit_tests/dist_checkpointing/conftest.py:15
Methodget_query_key_value_tensors
Derives `query`, `key` and `value` tensors from `hidden_states`.
megatron/core/transformer/attention.py:602
Methodget_query_key_value_tensors
Derives `query` tensor from `hidden_states`, and `key`/`value` tensors from `key_value_states`.
megatron/core/transformer/attention.py:707
Methodget_query_key_value_tensors
Derives `query`, `key` and `value` tensors from `hidden_states`.
megatron/core/transformer/attention.py:1173
Methodget_query_key_value_tensors
Derives `query`, `key` and `value` tensors from `hidden_states`.
megatron/core/transformer/attention.py:1574
Functionget_rank_monitor_client
(action=StateMachineActions.NONE)
megatron/training/ft_integration.py:98
Functionget_retro_datasets
Get train, valid, test retro datasets. Args: config (RetroConfig): Retro preprocessing config. gpt_datasets (dict): Mapping of da
megatron/core/datasets/retro/query/retro_dataset.py:146
Functionget_retro_decoder_layer_local_spec
Retro decoder local spec (uses Megatron-Core components). A Retro decoder layer uses custom attention and bias-dropout-add operators to perfo
megatron/core/models/retro/decoder_spec.py:89
Functionget_retro_decoder_layer_te_spec
Retro decoder TE spec (uses Transformer Engine components). A Retro decoder layer uses custom attention and bias-dropout-add operators to per
megatron/core/models/retro/decoder_spec.py:55
Functionget_retro_encoder_layer_local_spec
Retro encoder local spec (uses Megatron-Core components). A Retro encoder layer uses custom attention, bias-dropout-add, and layernorm operat
megatron/core/models/retro/encoder_spec.py:83
Functionget_retro_encoder_layer_te_spec
Retro encoder TE spec (uses Transformer Engine components). A Retro encoder layer uses custom attention, bias-dropout-add, and layernorm oper
megatron/core/models/retro/encoder_spec.py:51
Methodget_rotary_seq_len
Function to get the rotary sequence length. Args: inference_params : Used during Inference time transformer (Transfor
megatron/core/models/common/embeddings/rotary_pos_embedding.py:300
Functionget_samples_mapping
Get a list that maps a sample index to a starting sentence index, end sentence index, and length
megatron/legacy/data/dataset_utils.py:641
Methodget_sharded_state_dict
(base=0)
tests/unit_tests/dist_checkpointing/test_serialization.py:344
Methodget_special_tokens
Get special tokens.
megatron/training/tokenizer/multimodal_tokenizer.py:247
Methodget_state_dict
()
tests/unit_tests/dist_checkpointing/test_mapping.py:150
Methodget_state_dict
(fill_val=1)
tests/unit_tests/dist_checkpointing/test_fp8.py:64
Functionget_swin
(drop_path_rate=0.3, output_avg=False)
megatron/legacy/model/vision/swin_backbone.py:605
Functionget_t5_decoder_with_local_block_spec
T5 decoder block spec for local (uses Megatron-Core components) Args: num_layers (int): number of decoder layers
megatron/core/models/T5/t5_spec.py:239
Functionget_t5_encoder_with_local_block_spec
T5 encoder block spec for local (uses Megatron-Core components) Args: num_layers (int): number of encoder layers
megatron/core/models/T5/t5_spec.py:227
Functionget_tasks_args
Provide extra arguments required for tasks.
tasks/main.py:14
Functionget_tasks_args
Provide extra arguments required for tasks.
tasks/msdp/main.py:13
Functionget_tasks_args
Provide extra arguments required for tasks.
tasks/vision/main.py:19
Methodget_ten
(dtype: str = 'fp8')
tests/unit_tests/dist_checkpointing/test_fp8.py:26
Functionget_tensor_and_context_parallel_rank
Return caller's rank in the joint tensor-model-parallel and context-parallel group.
megatron/core/parallel_state.py:1573
Functionget_tensor_and_context_parallel_world_size
Return world size for the tensor and context-parallel group.
megatron/core/parallel_state.py:1565
Functionget_tensor_and_data_parallel_group
Get the tensor- and data-parallel group the caller rank belongs to.
megatron/core/parallel_state.py:1158
Methodget_ts_shape_dtype
(path)
megatron/core/dist_checkpointing/strategies/two_stage.py:250
Methodget_ts_shape_dtype
(path)
megatron/core/dist_checkpointing/strategies/tensorstore.py:50
Functionget_vit_layer_with_local_spec
Returns ViT layer spec with Mcore local layers
megatron/core/models/vision/vit_layer_specs.py:60
Methodget_zarr_shape_dtype
(path)
megatron/core/dist_checkpointing/strategies/zarr.py:185
Functionglobal_step
(all_local_plans)
megatron/core/dist_checkpointing/strategies/state_dict_saver.py:96
Methodglu
(x)
megatron/core/transformer/mlp.py:119
Methodglu
(x)
megatron/core/transformer/moe/shared_experts.py:165
Methodglu
(x)
megatron/core/transformer/moe/experts.py:108
Methodglu
(x)
megatron/core/transformer/moe/experts.py:696
Functiongpt2_tiktok_vocab
(tmp_path_factory)
tests/unit_tests/test_tokenizer.py:77
Functiongpt2_tiktoken_tokenizer
(gpt2_tiktok_vocab)
tests/unit_tests/test_inference.py:17
Functionhalf_conversion
(val)
megatron/legacy/model/module.py:140
Functionhalf_conversion
(val)
megatron/core/transformer/module.py:114
Methodhandler
(signum, frame)
megatron/training/dist_signal_handler.py:66
Methodhead_object
(self, Bucket: str, Key: str)
tests/unit_tests/data/test_bin_reader.py:53
Functionhf_forward
(model, batch)
tools/weights_conversion/utils/verify_correctness_dlm.py:124
Methodhook
(module, *unused)
megatron/core/distributed/distributed_data_parallel.py:332
Functionhook_fn
(module: torch.nn.Module, module_input, module_output)
tools/weights_conversion/utils/verify_correctness_dlm.py:60
Functioninit_
(tensor)
megatron/legacy/model/utils.py:15
Functioninit_
(tensor)
megatron/core/utils.py:272
Methodinit_state_dict_from_bert
Initialize the state from a pretrained BERT model on iteration zero of ICT pretraining
megatron/legacy/model/biencoder_model.py:180
Functioninit_state_fn
(opt, config=None)
megatron/core/optimizer/__init__.py:292
Methodinit_weights
(self, pretrained='', pretrained_layers=[], verbose=True)
megatron/legacy/model/vision/esvit_swin_backbone.py:716
Functioninitialize_bert_model
( seed, layer_spec_fn=bert_layer_with_transformer_engine_spec, vocab_size=128, **config_kwargs )
tests/unit_tests/dist_checkpointing/models/test_bert_model.py:26
Functioninitialize_gpt_model
( pre_process=True, post_process=True, seed=0, use_glu=True, **config_kwargs )
tests/unit_tests/dist_checkpointing/utils.py:23
Functioninitialize_gpt_model
(seed, layer_spec_fn=gpt_te_spec, vocab_size=128, **config_kwargs)
tests/unit_tests/dist_checkpointing/models/test_gpt_model.py:23
Functioninitialize_model_parallel
Initialize model data parallel groups. Args: tensor_model_parallel_size (int, default = 1): The number of GPUs to split indiv
megatron/core/parallel_state.py:390
Functioninitialize_moe_model
( pre_process=True, post_process=True, seed=0, use_glu=True, use_sp=False, use_te=Fals
tests/unit_tests/dist_checkpointing/utils.py:53
Functioninitialize_small_model
(pre_process=True, post_process=True, seed=0, **config_kwargs)
tests/unit_tests/dist_checkpointing/test_optimizer.py:148
Methodinitializer
(self)
tools/preprocess_mmdata.py:48
Methodinitializer
(self)
tools/preprocess_data_nmt.py:22
Functioninspect_types
Helper to print types of (nested) dict values.
megatron/core/dist_checkpointing/dict_utils.py:130
Methodinv_scale
(self)
megatron/core/optimizer/grad_scaler.py:22
Methodinv_vocab
Dictionary from vocab id token to text token
megatron/core/datasets/megatron_tokenizer.py:83
Methodinv_vocab
Dictionary from vocab id token to text token.
megatron/training/tokenizer/tokenizer.py:149
Methodinv_vocab
(self)
megatron/training/tokenizer/tokenizer.py:231
Methodinv_vocab
(self)
megatron/training/tokenizer/tokenizer.py:336
Methodinv_vocab
(self)
megatron/training/tokenizer/tokenizer.py:432
Methodinv_vocab
(self)
megatron/training/tokenizer/tokenizer.py:743
Methodinv_vocab
(self)
megatron/training/tokenizer/tokenizer.py:803
Methodinv_vocab
Inverse vocab.
megatron/training/tokenizer/multimodal_tokenizer.py:267
Functionis_dataset_built_on_rank
()
pretrain_difflm.py:357
Functionis_image_file
Checks if a file is an allowed image extension. Args: filename (string): path to a file Returns: bool: True if the filename en
megatron/legacy/data/image_folder.py:54
Functionis_inside_decoder
Return True if pipeline stage executes decoder block for a model with both encoder and decoder.
megatron/core/parallel_state.py:1380
Functionis_inside_encoder
Return True if pipeline stage executes encoder block. This function implicitly assumes we have a model with both encoder and decoder.
megatron/core/parallel_state.py:1357
Functionis_pipeline_stage_at_split
Return true if pipeline stage executes decoder block and next stage executes encoder block for a model with both encoder and decoder.
megatron/core/parallel_state.py:1401
Functionis_rank_in_embedding_group
Return true if current rank is in embedding group, False otherwise.
megatron/core/parallel_state.py:1302
Functionis_rank_in_position_embedding_group
Return true if current rank is in position embedding group, False otherwise.
megatron/core/parallel_state.py:1320
Methodis_spiky_loss
Helper method to estimate whether a loss is spiky. Args: loss_tensor: a zero-dim tensor containing the current loss.
megatron/core/rerun_state_machine.py:583
Functionis_unexpected_key
(x: ShardedBase)
megatron/core/dist_checkpointing/validation.py:267
Functionis_unitialized
Check if parallel state has been initialized Deprecated. Use is_initialized instead.
megatron/core/parallel_state.py:1009
Methoditeration_timing_node
(self)
tests/functional_tests/python_test_utils/test_fp8_ci_pipeline.py:105
Functionjoin_str_list
Join a list of strings, handling spaces appropriately
megatron/legacy/data/realm_dataset_utils.py:65
Functionjoin_str_list
Join a list of strings, handling spaces appropriately
megatron/legacy/data/biencoder_dataset_utils.py:75
Functionknn_predict
(feature, feature_bank, feature_labels, classes, knn_k, knn_t)
megatron/legacy/model/vision/knn_monitor.py:105
Functionlambada_detokenizer
(string)
tasks/zeroshot_gpt/detokenizer.py:53
Methodlemmas
Returns a list of the lemmatized text of each token. Returns None if this annotation was not included.
tasks/orqa/unsupervised/tokenizers.py:75
Functionlinear_with_grad_accumulation_and_async_allreduce
Linear layer execution with asynchronous communication and gradient accumulation fusion in backprop. This has the option to accumulate the re
megatron/core/tensor_parallel/layers.py:560
Methodload
(self, sharded_state_dict: ShardedStateDict, checkpoint_dir: Path)
megatron/core/dist_checkpointing/strategies/two_stage.py:103
Methodload
Translates MCore ShardedTensors to PyT ShardedTensors & loads from PyT Distributed fmt. Args: sharded_state_dict (ShardedStateDic
megatron/core/dist_checkpointing/strategies/torch.py:753
Methodload
(self, sharded_state_dict: ShardedStateDict, checkpoint_dir: Path)
megatron/core/dist_checkpointing/strategies/tensorstore.py:36
Methodload
(self, sharded_state_dict: ShardedStateDict, checkpoint_dir: Path)
megatron/core/dist_checkpointing/strategies/zarr.py:178
Functionload_and_upcycle_model
Load a dense model checkpoint and convert it to a MoE model. This function loads a checkpoint for a dense model and converts it to the MoE m
megatron/core/transformer/moe/upcycling_utils.py:166
Functionload_checkpoint
(queue, args)
tools/checkpoint/loader_core.py:457
← previousnext →3,201–3,300 of 4,219, ranked by callers