MCPcopy Create free account

hub / github.com/OpenSparseLLMs/Linear-MoE / functions

Functions1,498 in github.com/OpenSparseLLMs/Linear-MoE

Methodset_input_tensor
Set input tensor to be used instead of forward()'s input. When doing pipeline parallelism the input from the previous stage comes fro
linear_moe/model/llama3/transformer_legacy.py:1690
Methodset_input_tensor
Sets input tensor to the model. See megatron.model.transformer.set_input_tensor() Args: input_tensor (Tensor): Sets the
linear_moe/model/llama3/model.py:147
Methodset_input_tensor
Set input tensor to be used instead of forward()'s input. When doing pipeline parallelism the input from the previous stage comes fro
linear_moe/model/llama3/hybrid/hybrid_transformer_block.py:304
Methodset_input_tensor
Sets input tensor to the model. See megatron.model.transformer.set_input_tensor() Args: input_tensor (Tensor): Sets the
linear_moe/model/llama3/hybrid/hybrid_model.py:144
Methodset_layer_number
(self, layer_number: int)
linear_moe/model/qwen2/moe/moe_layer.py:73
Methodset_layer_number
Set the layer number for the router.
linear_moe/model/deepseek_v2/moe/router_old.py:100
Methodset_layer_number
(self, layer_number: int)
linear_moe/model/deepseek_v2/moe/moe_layer.py:61
Methodset_loss_scale
set the scale of the aux loss. Args: scale (int): The scale value to set. Please ensure that the scale passed in matches
linear_moe/model/mixtral/moe/moe_utils.py:112
Methodsh_ten_build_fn
(key: str, t: torch.Tensor, replica_id: ReplicaId)
linear_moe/model/mixtral/transformer/mlp.py:195
Methodsh_ten_build_fn
(key: str, t: torch.Tensor, replica_id: ReplicaId)
linear_moe/model/qwen2/transformer/mlp.py:195
Methodsh_ten_build_fn
(key: str, t: torch.Tensor, replica_id: ReplicaId)
linear_moe/model/deepseek_v2/transformer/mlp.py:183
Methodsh_ten_build_fn
(key: str, t: torch.Tensor, replica_id: ReplicaId)
linear_moe/model/llama3/transformer/mlp.py:176
Methodsh_ten_merge_fn
(sub_state_dict)
linear_moe/model/mixtral/transformer/mlp.py:219
Methodsh_ten_merge_fn
(sub_state_dict)
linear_moe/model/qwen2/transformer/mlp.py:219
Methodsh_ten_merge_fn
(sub_state_dict)
linear_moe/model/deepseek_v2/transformer/mlp.py:207
Methodsh_ten_merge_fn
(sub_state_dict)
linear_moe/model/llama3/transformer/mlp.py:200
Methodsharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: Optional[dict] = None )
linear_moe/model/mixtral/transformer_layer.py:275
Methodsharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: dict = None )
linear_moe/model/mixtral/transformer_block.py:442
Methodsharded_state_dict
Sharded state dict implementation for GPTModel backward-compatibility (removing extra state). Args: prefix (str): Module name pr
linear_moe/model/mixtral/model.py:224
Methodsharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: dict = None )
linear_moe/model/mixtral/hybrid/hybrid_transformer_block.py:434
Methodsharded_state_dict
Sharded state dict implementation for GPTModel backward-compatibility (removing extra state). Args: prefix (str): Module name pr
linear_moe/model/mixtral/hybrid/hybrid_model.py:225
Methodsharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: Optional[dict] = None )
linear_moe/model/qwen2/transformer_layer.py:275
Methodsharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: dict = None )
linear_moe/model/qwen2/transformer_block.py:442
Methodsharded_state_dict
Sharded state dict implementation for GPTModel backward-compatibility (removing extra state). Args: prefix (str): Module name pr
linear_moe/model/qwen2/model.py:224
Methodsharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: dict = None )
linear_moe/model/qwen2/hybrid/hybrid_transformer_block.py:434
Methodsharded_state_dict
Sharded state dict implementation for GPTModel backward-compatibility (removing extra state). Args: prefix (str): Module name pr
linear_moe/model/qwen2/hybrid/hybrid_model.py:225
Methodsharded_state_dict
Maps local expert to global experts.
linear_moe/model/qwen2/moe/experts.py:230
Methodsharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: Optional[dict] = None )
linear_moe/model/deepseek_v2/transformer_layer.py:277
Methodsharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: dict = None )
linear_moe/model/deepseek_v2/transformer_block.py:418
Methodsharded_state_dict
Sharded state dict implementation for GPTModel backward-compatibility (removing extra state). Args: prefix (str): Module name pr
linear_moe/model/deepseek_v2/model.py:219
Methodsharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: dict = None )
linear_moe/model/deepseek_v2/hybrid/hybrid_transformer_block.py:404
Methodsharded_state_dict
Sharded state dict implementation for GPTModel backward-compatibility (removing extra state). Args: prefix (str): Module name pr
linear_moe/model/deepseek_v2/hybrid/hybrid_model.py:215
Methodsharded_state_dict
Maps local expert to global experts.
linear_moe/model/deepseek_v2/moe/experts.py:218
Methodsharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: Optional[dict] = None )
linear_moe/model/llama3/transformer_layer.py:275
Methodsharded_state_dict
Sharded state dict implementation for GPTModel backward-compatibility (removing extra state). Args: prefix (str): Module name pr
linear_moe/model/llama3/model.py:228
Methodsharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: dict = None )
linear_moe/model/llama3/hybrid/hybrid_transformer_block.py:434
Methodsharded_state_dict
Sharded state dict implementation for GPTModel backward-compatibility (removing extra state). Args: prefix (str): Module name pr
linear_moe/model/llama3/hybrid/hybrid_model.py:225
Functionsimple_norm
(x)
linear_moe/sequence_modeling/gated_deltanet/gated_deltanet.py:13
Functionsimple_norm
(x)
linear_moe/sequence_modeling/deltanet/deltanet.py:14
Methodspecial_text_tokenizer
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:171
Methodsplit_sentences
(self, file_name)
toolkits/pretrain_data_preprocessing/preprocess_data_megatron.py:111
Functionsquared_relu
(x)
linear_moe/arguments.py:49
Methodsquared_relu
(x)
linear_moe/model/llama3/transformer_legacy.py:137
Methodstate_dict_for_save_checkpoint
For easy load.
linear_moe/model/llama3/language_model.py:539
Methodswiglu
(x)
linear_moe/model/llama3/transformer_legacy.py:132
Methodtext_tokenizer
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:167
Methodtie_weights
(self)
linear_moe/lm_evaluate.py:77
Methodto_cvcuda_tensor
(image)
linear_moe/data/llava/cvcuda_image_processing_clip.py:337
Methodto_gradio_chatbot
(self)
linear_moe/data/llava/conversation.py:173
Methodtoken_permutation
Dispatch tokens to local experts. It's composed of two stages: (1) Permute the tokens across the expert parallel devices. After this stage,
linear_moe/model/mixtral/moe/token_dispatcher.py:122
Methodtoken_permutation
Dispatch tokens to local experts. It's composed of two stages: (1) Permute the tokens across the expert parallel devices. After this stage,
linear_moe/model/qwen2/moe/token_dispatcher.py:97
Methodtoken_permutation
Dispatch tokens to local experts using AlltoAll communication. Args: hidden_states (torch.Tensor): Input token embedding
linear_moe/model/qwen2/moe/token_dispatcher.py:412
Methodtoken_permutation
Dispatch tokens to local experts. It's composed of two stages: (1) Permute the tokens across the expert parallel devices. After this stage,
linear_moe/model/deepseek_v2/moe/token_dispatcher.py:96
Methodtoken_permutation
Dispatch tokens to local experts using AlltoAll communication. Args: hidden_states (torch.Tensor): Input token embedding
linear_moe/model/deepseek_v2/moe/token_dispatcher.py:385
Methodtoken_unpermutation
Reverse process of `dispatch()` which permutes the ouput of local experts locallay and across expert parallel rank into the original
linear_moe/model/mixtral/moe/token_dispatcher.py:211
Methodtoken_unpermutation
Reverse process of `dispatch()` which permutes the ouput of local experts locallay and across expert parallel rank into the original
linear_moe/model/qwen2/moe/token_dispatcher.py:189
Methodtoken_unpermutation
Reverse the token permutation to restore the original order. Args: hidden_states (torch.Tensor): Output from local exper
linear_moe/model/qwen2/moe/token_dispatcher.py:483
Methodtoken_unpermutation
Reverse process of `dispatch()` which permutes the ouput of local experts locallay and across expert parallel rank into the original
linear_moe/model/deepseek_v2/moe/token_dispatcher.py:183
Methodtoken_unpermutation
Reverse the token permutation to restore the original order. Args: hidden_states (torch.Tensor): Output from local exper
linear_moe/model/deepseek_v2/moe/token_dispatcher.py:446
Methodtokenize
Converts a string in a sequence of tokens. Args: text (`str`):The sequence to be encoded. allowed_special (`
linear_moe/tokenizer/tokenization_qwen_vl.py:219
Methodtokenize
(self, text, is_code=False, only_cut=False)
linear_moe/tokenizer/jiebabpe_tokenizer.py:54
Methodtokenize
(self, text)
linear_moe/tokenizer/__init__.py:202
Methodtokenize
(self, text)
linear_moe/tokenizer/__init__.py:263
Methodtokenize
(self, text)
linear_moe/tokenizer/__init__.py:355
Methodtokenize
(self, text)
linear_moe/tokenizer/__init__.py:428
Methodtokenize
(self, text)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:51
Methodtokenize
(self, text: str, linebreak=True, whitespaces=True,
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:228
Functiontrain_valid_test_datasets_provider
Build the train test and validation datasets. Args: train_val_test_num_samples : A list containing the number of samples in train test an
examples/linear_moe_mixtral/pretrain_mcore_mistral.py:275
Functiontrain_valid_test_datasets_provider
Build the train test and validation datasets. Args: train_val_test_num_samples : A list containing the number of samples in train test an
examples/linear_moe_deepseek_v2/pretrain_deepseek.py:273
Functiontrain_valid_test_datasets_provider
Build the train test and validation datasets. Args: train_val_test_num_samples : A list containing the number of samples in train test an
examples/linear_moe_qwen2/pretrain_qwen.py:264
Functiontrain_valid_test_datasets_provider
Build the train test and validation datasets. Args: train_val_test_num_samples : A list containing the number of samples in train test an
examples/linear_llama3/pretrain_llama.py:267
Functiontransformers_to_megatron_fix_query_key_value_ordering
Permutes layout of param tensor to the one compatible with respective NVIDIA Megatron-LM chekpoint versions. Input is [num_splits * num_heads
toolkits/model_checkpoints_convertor/glm/checkpoint_reshaping_and_interoperability.py:187
Functiontransformers_to_megatron_fix_query_key_value_ordering
Permutes layout of param tensor to the one compatible with respective NVIDIA Megatron-LM chekpoint versions. Input is [num_splits * num_heads
toolkits/model_checkpoints_convertor/falcon/checkpoint_reshaping_and_interoperability.py:217
Functiontransformers_to_megatron_fix_query_key_value_ordering
Permutes layout of param tensor to the one compatible with respective NVIDIA Megatron-LM chekpoint versions. Input is [num_splits * num_heads
toolkits/model_checkpoints_convertor/glm130b/checkpoint_reshaping_and_interoperability.py:187
Functiontransformers_to_megatron_fix_query_key_value_ordering
Permutes layout of param tensor to the one compatible with respective NVIDIA Megatron-LM chekpoint versions. Input is [num_splits * num_heads
toolkits/model_checkpoints_convertor/starcoder/checkpoint_reshaping_and_interoperability.py:238
Functiontransformers_to_megatron_fix_query_key_value_ordering
Permutes layout of param tensor to the one compatible with respective NVIDIA Megatron-LM chekpoint versions. Input is [num_splits * num_heads
toolkits/model_checkpoints_convertor/chatglm/checkpoint_reshaping_and_interoperability.py:216
Functiontransformers_to_megatron_fix_query_key_value_ordering
Permutes layout of param tensor to the one compatible with respective NVIDIA Megatron-LM chekpoint versions. Input is [num_splits * num_heads
toolkits/model_checkpoints_convertor/qwen/hf2megablocks_qwen1.5.py:366
Functiontransformers_to_megatron_fix_query_key_value_ordering
Permutes layout of param tensor to the one compatible with respective NVIDIA Megatron-LM chekpoint versions. Input is [num_splits * num_heads
toolkits/model_checkpoints_convertor/bloom/checkpoint_reshaping_and_interoperability.py:216
Functiontransformers_to_megatron_fix_query_key_value_ordering
Permutes layout of param tensor to the one compatible with respective NVIDIA Megatron-LM chekpoint versions. Input is [num_splits * num_heads
toolkits/model_checkpoints_convertor/bloom/reward_model_to_megatron.py:216
Methodvocab
(self)
linear_moe/tokenizer/jiebabpe_tokenizer.py:43
Methodvocab
(self)
linear_moe/tokenizer/__init__.py:195
Methodvocab
(self)
linear_moe/tokenizer/__init__.py:256
Methodvocab
(self)
linear_moe/tokenizer/__init__.py:348
Methodvocab
(self)
linear_moe/tokenizer/__init__.py:421
Methodvocab
Dictionary from vocab text token to id token.
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:40
Methodvocab
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:332
Methodvocab_size
(self)
linear_moe/tokenizer/tokenization_qwen_vl.py:287
Methodvocab_size
Returns vocab size
linear_moe/tokenizer/tokenization_baichuan.py:83
Methodvocab_size
(self)
linear_moe/tokenizer/jiebabpe_tokenizer.py:39
Methodvocab_size
(self)
linear_moe/tokenizer/__init__.py:191
Methodvocab_size
(self)
linear_moe/tokenizer/__init__.py:252
Methodvocab_size
(self)
linear_moe/tokenizer/__init__.py:344
Methodvocab_size
(self)
linear_moe/tokenizer/__init__.py:417
Methodvocab_size
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:35
Methodvocab_size
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:328
Methodvocab_size
Returns vocab size
linear_moe/tokenizer/tokenization_yi.py:96
Functionwrapper
(ctx, *args, **kwargs)
linear_moe/utils.py:10
Methodzero_parameters
Zero out all parameters in embedding.
linear_moe/model/llama3/language_model.py:184
← previous1,401–1,498 of 1,498, ranked by callers