MCPcopy Create free account

hub / github.com/JieShibo/MoLE / functions

Functions2,110 in github.com/JieShibo/MoLE

↓ 1 callersFunction_communicate_shapes
Communicate tensor shapes between stages. Used to communicate tensor shapes before the actual tensor communication happens. This is required w
pretrain/megatron/core/pipeline_parallel/p2p_communication.py:22
↓ 1 callersFunction_compile_dependencies
()
pretrain/megatron/training/initialize.py:103
↓ 1 callersFunction_compute_shards_access
(rank_sharding)
pretrain/megatron/core/dist_checkpointing/serialization.py:435
↓ 1 callersMethod_copy_main_params_to_model_params
(self)
pretrain/megatron/core/optimizer/optimizer.py:515
↓ 1 callersMethod_copy_model_grads_to_main_grads
(self)
pretrain/megatron/core/optimizer/optimizer.py:495
↓ 1 callersMethod_copy_model_params_to_main_params
(self)
pretrain/megatron/core/optimizer/optimizer.py:522
↓ 1 callersFunction_create_build_dir
(buildpath)
pretrain/megatron/legacy/fused_kernels/__init__.py:70
↓ 1 callersFunction_create_or_open_zarr_arrays
Returns list of zarr arrays corresponding to given tensors. For a sharded tensors that: a) is main replica and represents the first chunk (a
pretrain/megatron/core/dist_checkpointing/strategies/zarr.py:63
↓ 1 callersFunction_create_zarr_array
(sharded_tensor: ShardedTensor, checkpoint_dir: Path)
pretrain/megatron/core/dist_checkpointing/strategies/zarr.py:129
↓ 1 callersMethod_distribute_data_to_state_dict
( self, ten_meta: _ShardedTensorMetadata, loaded_ten: torch.Tensor, sharded_st
pretrain/megatron/core/dist_checkpointing/strategies/two_stage.py:229
↓ 1 callersMethod_exchange_loaded_tensors
( self, ten_metas: List[_ShardedTensorMetadata], sharded_state_dict, checkpoint_dir )
pretrain/megatron/core/dist_checkpointing/strategies/two_stage.py:194
↓ 1 callersFunction_extract_and_save_sharded_objects
( state_dict: StateDict, checkpoint_dir: Path, validate_consistency: bool = False )
pretrain/megatron/core/dist_checkpointing/serialization.py:348
↓ 1 callersMethod_finalize
Build the dataset and assert any subclass-specific conditions
pretrain/megatron/core/datasets/megatron_dataset.py:70
↓ 1 callersMethod_finalize_save
Perform save finalization. Breakdown into `save` and `save_finalize` cn be useful for async saving.
pretrain/megatron/core/dist_checkpointing/strategies/torch.py:432
↓ 1 callersMethod_find_classes
Finds the class folders in a dataset. Args: dir (string): Root directory path. Returns: tuple: (class
pretrain/megatron/legacy/data/image_folder.py:191
↓ 1 callersMethod_flash_attention_forward
( self, query_states, key_states, value_states, attention_mask, query_length, dropout=0.0, softmax_sca
modeling_mole.py:443
↓ 1 callersMethod_flash_attention_forward
( self, query_states, key_states, value_states, attention_mask, query_length, dropout=0.0, softmax_sca
modeling_dense.py:441
↓ 1 callersMethod_flash_attention_forward
( self, query_states, key_states, value_states, attention_mask, query_length, dropout=0.0, softmax_sca
modeling_moe.py:443
↓ 1 callersMethod_flash_attention_forward
( self, query_states, key_states, value_states, attention_mask, query_length, dropout=0.0, softmax_sca
modeling_mole_rep.py:444
↓ 1 callersFunction_gather_along_first_dim_expert_parallel
Gather tensors and concatenate along the first dimension.
pretrain/megatron/core/tensor_parallel/mappings.py:181
↓ 1 callersMethod_get_all_ranks_time_string
Report times across all ranks.
pretrain/megatron/core/timers.py:283
↓ 1 callersFunction_get_block_submodules
( config: TransformerConfig, spec: Union[TransformerBlockSubmodules, ModuleSpec], )
pretrain/megatron/core/transformer/transformer_block.py:68
↓ 1 callersFunction_get_cuda_bare_metal_version
(cuda_dir)
pretrain/megatron/legacy/fused_kernels/__init__.py:57
↓ 1 callersFunction_get_extra_state_offsets
Turns ShardedTensor offsets into offsets suitable for ShardedObject.
pretrain/megatron/core/transformer/utils.py:138
↓ 1 callersMethod_get_global_min_max_time_string
Report strings for max/minmax times across all ranks.
pretrain/megatron/core/timers.py:264
↓ 1 callersMethod_get_layer
(self, layer_number: int)
pretrain/megatron/core/transformer/transformer_block.py:179
↓ 1 callersFunction_get_layer_type
(model_type, default_layer_type, retro_layer_numbers, layer_number)
pretrain/megatron/legacy/model/transformer.py:1363
↓ 1 callersMethod_get_model_param_buffer_dp_views
Get shard views of each of the param buffers. In this nested list, the top level is grouped by the virtual model index and t
pretrain/megatron/core/optimizer/distrib_optimizer.py:1177
↓ 1 callersMethod_get_num_epochs
Calculate the number of epochs Args: num_tokens_per_epoch (int): The number of tokens in a single epoch Returns:
pretrain/megatron/core/datasets/gpt_dataset.py:561
↓ 1 callersFunction_get_num_layers
Compute the number of transformer layers resident on the current rank.
pretrain/megatron/legacy/model/transformer.py:1308
↓ 1 callersMethod_get_num_tokens_per_epoch
Calculate the number of tokens in a single epoch Returns: int: The number of tokens in a single epoch
pretrain/megatron/core/datasets/gpt_dataset.py:553
↓ 1 callersFunction_get_param_groups
Create parameter groups for optimizer. Creates parameter groups based on weight decay condition (regularized vs non regularized), learning ra
pretrain/megatron/core/optimizer/__init__.py:26
↓ 1 callersFunction_get_recv_buffer_dtype
Receive happens between the layers.
pretrain/megatron/inference/text_generation/forward_step.py:64
↓ 1 callersMethod_get_token_mask
(self, numpy_random_state: numpy.random.RandomState)
pretrain/megatron/core/datasets/masked_dataset.py:418
↓ 1 callersFunction_get_unpad_data
(attention_mask)
modeling_mole.py:42
↓ 1 callersFunction_get_unpad_data
(attention_mask)
modeling_dense.py:42
↓ 1 callersFunction_get_unpad_data
(attention_mask)
modeling_moe.py:42
↓ 1 callersFunction_get_unpad_data
(attention_mask)
modeling_mole_rep.py:42
↓ 1 callersMethod_getitem_file
Return from the dataset by using file pointer Args: idx (Union[int, numpy.integer, slice]): The index or index slice into the dat
pretrain/megatron/core/datasets/indexed_dataset.py:461
↓ 1 callersMethod_getitem_mmap
Return from the dataset by mmap-ing .bin file Args: idx (Union[int, numpy.integer, slice]): The index or index slice into the dat
pretrain/megatron/core/datasets/indexed_dataset.py:416
↓ 1 callersFunction_init_autoresume
Set autoresume start time.
pretrain/megatron/training/initialize.py:271
↓ 1 callersMethod_init_rope
(self)
modeling_mole.py:237
↓ 1 callersMethod_init_rope
(self)
modeling_dense.py:235
↓ 1 callersMethod_init_rope
(self)
modeling_moe.py:237
↓ 1 callersMethod_init_rope
(self)
modeling_mole_rep.py:239
↓ 1 callersMethod_initalize
(self, vocab_extra_ids)
pretrain/megatron/training/tokenizer/tokenizer.py:365
↓ 1 callersFunction_initialize_distributed
Initialize torch.distributed and core model parallel.
pretrain/megatron/training/initialize.py:206
↓ 1 callersFunction_initialize_tp_communicators
initializing the communicators with user buffers for high-performance tensor-model-parallel communication overlap
pretrain/megatron/training/initialize.py:175
↓ 1 callersMethod_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
pretrain/megatron/training/tokenizer/bert_tokenization.py:296
↓ 1 callersFunction_is_control
Checks whether `chars` is a control character.
pretrain/megatron/training/tokenizer/bert_tokenization.py:406
↓ 1 callersFunction_is_punctuation
Checks whether `chars` is a punctuation character.
pretrain/megatron/training/tokenizer/bert_tokenization.py:418
↓ 1 callersFunction_is_whitespace
Checks whether `chars` is a whitespace character.
pretrain/megatron/training/tokenizer/bert_tokenization.py:394
↓ 1 callersFunction_item_size
Calculates size (in bytes) of a single write item. Same as torch.distributed.checkpoint.filesystem._item_size, but fixes computing chunk
pretrain/megatron/core/dist_checkpointing/strategies/filesystem_async.py:258
↓ 1 callersMethod_key_config_attributes
Return all config attributes which contribute to uniquely identifying the dataset. These attributes will be used to build a uniquely identify
pretrain/megatron/core/datasets/megatron_dataset.py:114
↓ 1 callersFunction_load_from_array
(sharded_tensor: ShardedTensor, checkpoint_dir: Path)
pretrain/megatron/core/dist_checkpointing/strategies/zarr.py:175
↓ 1 callersFunction_load_regular_chunk
(sharded_tensor: ShardedTensor, checkpoint_dir: Path)
pretrain/megatron/core/dist_checkpointing/strategies/tensorstore.py:89
↓ 1 callersMethod_make_forward_pre_hook
Create a forward pre-hook to wait on all-gather handles when necessary (i.e., when a module uses a parameter in a bucket with a still
pretrain/megatron/core/optimizer/distrib_optimizer.py:1248
↓ 1 callersMethod_make_history_mask
Return a 2-D history (lower-left-triangular) mask Args: block (numpy.ndarray): A 1-D array Returns: numpy.nd
pretrain/megatron/core/datasets/t5_dataset.py:210
↓ 1 callersMethod_make_param_hook
Creates the all-reduce / reduce-scatter hook for backprop.
pretrain/megatron/core/distributed/distributed_data_parallel.py:181
↓ 1 callersFunction_mcore_to_torch_sharded_object
Build io.BytesIO from given sharded objects data.
pretrain/megatron/core/dist_checkpointing/strategies/torch.py:230
↓ 1 callersFunction_mcore_to_torch_sharded_tensor
Build a PyT ShardedTensor from given shards. During loading: - if data is None, initialize it with an empty tensor (will be used to c
pretrain/megatron/core/dist_checkpointing/strategies/torch.py:203
↓ 1 callersFunction_no_pipelining_forward_step
If recv_buffer is none, we will allocate one on the fly.
pretrain/megatron/inference/text_generation/forward_step.py:108
↓ 1 callersMethod_norm
(self, x)
pretrain/megatron/legacy/model/rms_norm.py:26
↓ 1 callersFunction_print_args
Print arguments.
pretrain/megatron/training/arguments.py:519
↓ 1 callersFunction_print_args
Print arguments.
pretrain/megatron/training/yaml_arguments.py:375
↓ 1 callersFunction_replace_sharded_keys_with_state_dict_keys
Inverse of _replace_state_dict_keys_with_sharded_keys.
pretrain/megatron/core/dist_checkpointing/strategies/torch.py:282
↓ 1 callersFunction_restore_dict_types
Recursively update `x` keys, based on `keys_template`.
pretrain/megatron/core/dist_checkpointing/strategies/torch.py:297
↓ 1 callersFunction_rotate_half
Change sign so the last dimension becomes [-odd, +even] Args: x (Tensor): Input tensor Returns: Tensor: Tensor rotated half
pretrain/megatron/core/models/common/embeddings/rotary_pos_embedding.py:154
↓ 1 callersMethod_run_split_on_punc
Splits punctuation on a piece of text.
pretrain/megatron/training/tokenizer/bert_tokenization.py:263
↓ 1 callersMethod_run_strip_accents
Strips accents from a piece of text.
pretrain/megatron/training/tokenizer/bert_tokenization.py:252
↓ 1 callersFunction_save_common_dict
( state_dict: StateDict, checkpoint_dir: Path, validate_consistency: bool = False )
pretrain/megatron/core/dist_checkpointing/serialization.py:334
↓ 1 callersFunction_save_to_existing_array
(sharded_tensor: ShardedTensor, arr: Optional[zarr.Array])
pretrain/megatron/core/dist_checkpointing/strategies/zarr.py:109
↓ 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
pretrain/megatron/core/datasets/indexed_dataset.py:195
↓ 1 callersFunction_set_adlr_autoresume
Initialize ADLR autoresume.
pretrain/megatron/training/global_vars.py:204
↓ 1 callersFunction_set_global_memory_buffer
Initialize global buffer
pretrain/megatron/core/parallel_state.py:1011
↓ 1 callersFunction_set_one_logger
(args)
pretrain/megatron/training/global_vars.py:184
↓ 1 callersFunction_set_random_seed
Set random seed for reproducability.
pretrain/megatron/training/initialize.py:280
↓ 1 callersFunction_set_signal_handler
()
pretrain/megatron/training/global_vars.py:83
↓ 1 callersFunction_set_tensorboard_writer
Set tensorboard writer.
pretrain/megatron/training/global_vars.py:140
↓ 1 callersFunction_set_timers
Initialize timers.
pretrain/megatron/training/global_vars.py:222
↓ 1 callersFunction_set_wandb_writer
(args)
pretrain/megatron/training/global_vars.py:160
↓ 1 callersMethod_sharded_state_dict_for_glu
( self, module_name: str, module: torch.nn.Module, prefix: str, sharde
pretrain/megatron/core/transformer/mlp.py:165
↓ 1 callersMethod_sharded_state_dict_for_glu
( self, module_name: str, module: torch.nn.Module, prefix: str, sharde
pretrain/megatron/core/transformer/vanillamlp.py:142
↓ 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
pretrain/megatron/core/dist_checkpointing/strategies/filesystem_async.py:220
↓ 1 callersMethod_tokenize_chinese_chars
Adds whitespace around any CJK character.
pretrain/megatron/training/tokenizer/bert_tokenization.py:283
↓ 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
pretrain/megatron/inference/text_generation/tokenization.py:89
↓ 1 callersMethod_train
Train index (rank 0's method). Args: config (RetroPreprocessingConfig): Retro preprocessing config.
pretrain/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.
pretrain/megatron/core/datasets/retro/index/build.py:183
↓ 1 callersFunction_transform
(img_h, img_w)
pretrain/megatron/legacy/data/multimodal_dataset.py:19
↓ 1 callersMethod_unscale_main_grads_and_check_for_nan
(self)
pretrain/megatron/core/optimizer/optimizer.py:276
↓ 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
pretrain/megatron/core/dist_checkpointing/strategies/torch.py:248
↓ 1 callersMethod_upad_input
(self, query_layer, key_layer, value_layer, attention_mask, query_length)
modeling_mole.py:483
↓ 1 callersMethod_upad_input
(self, query_layer, key_layer, value_layer, attention_mask, query_length)
modeling_dense.py:481
↓ 1 callersMethod_upad_input
(self, query_layer, key_layer, value_layer, attention_mask, query_length)
modeling_moe.py:483
↓ 1 callersMethod_upad_input
(self, query_layer, key_layer, value_layer, attention_mask, query_length)
modeling_mole_rep.py:484
↓ 1 callersMethod_update_causal_mask
(self, attention_mask, input_tensor)
modeling_mole.py:867
↓ 1 callersMethod_update_causal_mask
(self, attention_mask, input_tensor)
modeling_dense.py:849
↓ 1 callersMethod_update_causal_mask
(self, attention_mask, input_tensor)
modeling_moe.py:875
↓ 1 callersMethod_update_causal_mask
(self, attention_mask, input_tensor)
modeling_mole_rep.py:863
↓ 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
pretrain/megatron/core/optimizer/__init__.py:112
← previousnext →501–600 of 2,110, ranked by callers