Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/OpenSparseLLMs/Linear-MoE
/ functions
Functions
1,498 in github.com/OpenSparseLLMs/Linear-MoE
⨍
Functions
1,498
◇
Types & classes
227
Method
set_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
Method
set_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
Method
set_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
Method
set_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
Method
set_layer_number
(self, layer_number: int)
linear_moe/model/qwen2/moe/moe_layer.py:73
Method
set_layer_number
Set the layer number for the router.
linear_moe/model/deepseek_v2/moe/router_old.py:100
Method
set_layer_number
(self, layer_number: int)
linear_moe/model/deepseek_v2/moe/moe_layer.py:61
Method
set_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
Method
sh_ten_build_fn
(key: str, t: torch.Tensor, replica_id: ReplicaId)
linear_moe/model/mixtral/transformer/mlp.py:195
Method
sh_ten_build_fn
(key: str, t: torch.Tensor, replica_id: ReplicaId)
linear_moe/model/qwen2/transformer/mlp.py:195
Method
sh_ten_build_fn
(key: str, t: torch.Tensor, replica_id: ReplicaId)
linear_moe/model/deepseek_v2/transformer/mlp.py:183
Method
sh_ten_build_fn
(key: str, t: torch.Tensor, replica_id: ReplicaId)
linear_moe/model/llama3/transformer/mlp.py:176
Method
sh_ten_merge_fn
(sub_state_dict)
linear_moe/model/mixtral/transformer/mlp.py:219
Method
sh_ten_merge_fn
(sub_state_dict)
linear_moe/model/qwen2/transformer/mlp.py:219
Method
sh_ten_merge_fn
(sub_state_dict)
linear_moe/model/deepseek_v2/transformer/mlp.py:207
Method
sh_ten_merge_fn
(sub_state_dict)
linear_moe/model/llama3/transformer/mlp.py:200
Method
sharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: Optional[dict] = None )
linear_moe/model/mixtral/transformer_layer.py:275
Method
sharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: dict = None )
linear_moe/model/mixtral/transformer_block.py:442
Method
sharded_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
Method
sharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: dict = None )
linear_moe/model/mixtral/hybrid/hybrid_transformer_block.py:434
Method
sharded_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
Method
sharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: Optional[dict] = None )
linear_moe/model/qwen2/transformer_layer.py:275
Method
sharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: dict = None )
linear_moe/model/qwen2/transformer_block.py:442
Method
sharded_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
Method
sharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: dict = None )
linear_moe/model/qwen2/hybrid/hybrid_transformer_block.py:434
Method
sharded_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
Method
sharded_state_dict
Maps local expert to global experts.
linear_moe/model/qwen2/moe/experts.py:230
Method
sharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: Optional[dict] = None )
linear_moe/model/deepseek_v2/transformer_layer.py:277
Method
sharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: dict = None )
linear_moe/model/deepseek_v2/transformer_block.py:418
Method
sharded_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
Method
sharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: dict = None )
linear_moe/model/deepseek_v2/hybrid/hybrid_transformer_block.py:404
Method
sharded_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
Method
sharded_state_dict
Maps local expert to global experts.
linear_moe/model/deepseek_v2/moe/experts.py:218
Method
sharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: Optional[dict] = None )
linear_moe/model/llama3/transformer_layer.py:275
Method
sharded_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
Method
sharded_state_dict
( self, prefix: str = '', sharded_offsets: tuple = (), metadata: dict = None )
linear_moe/model/llama3/hybrid/hybrid_transformer_block.py:434
Method
sharded_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
Function
simple_norm
(x)
linear_moe/sequence_modeling/gated_deltanet/gated_deltanet.py:13
Function
simple_norm
(x)
linear_moe/sequence_modeling/deltanet/deltanet.py:14
Method
special_text_tokenizer
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:171
Method
split_sentences
(self, file_name)
toolkits/pretrain_data_preprocessing/preprocess_data_megatron.py:111
Function
squared_relu
(x)
linear_moe/arguments.py:49
Method
squared_relu
(x)
linear_moe/model/llama3/transformer_legacy.py:137
Method
state_dict_for_save_checkpoint
For easy load.
linear_moe/model/llama3/language_model.py:539
Method
swiglu
(x)
linear_moe/model/llama3/transformer_legacy.py:132
Method
text_tokenizer
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:167
Method
tie_weights
(self)
linear_moe/lm_evaluate.py:77
Method
to_cvcuda_tensor
(image)
linear_moe/data/llava/cvcuda_image_processing_clip.py:337
Method
to_gradio_chatbot
(self)
linear_moe/data/llava/conversation.py:173
Method
token_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
Method
token_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
Method
token_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
Method
token_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
Method
token_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
Method
token_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
Method
token_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
Method
token_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
Method
token_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
Method
token_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
Method
tokenize
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
Method
tokenize
(self, text, is_code=False, only_cut=False)
linear_moe/tokenizer/jiebabpe_tokenizer.py:54
Method
tokenize
(self, text)
linear_moe/tokenizer/__init__.py:202
Method
tokenize
(self, text)
linear_moe/tokenizer/__init__.py:263
Method
tokenize
(self, text)
linear_moe/tokenizer/__init__.py:355
Method
tokenize
(self, text)
linear_moe/tokenizer/__init__.py:428
Method
tokenize
(self, text)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:51
Method
tokenize
(self, text: str, linebreak=True, whitespaces=True,
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:228
Function
train_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
Function
train_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
Function
train_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
Function
train_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
Function
transformers_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
Function
transformers_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
Function
transformers_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
Function
transformers_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
Function
transformers_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
Function
transformers_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
Function
transformers_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
Function
transformers_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
Method
vocab
(self)
linear_moe/tokenizer/jiebabpe_tokenizer.py:43
Method
vocab
(self)
linear_moe/tokenizer/__init__.py:195
Method
vocab
(self)
linear_moe/tokenizer/__init__.py:256
Method
vocab
(self)
linear_moe/tokenizer/__init__.py:348
Method
vocab
(self)
linear_moe/tokenizer/__init__.py:421
Method
vocab
Dictionary from vocab text token to id token.
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:40
Method
vocab
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:332
Method
vocab_size
(self)
linear_moe/tokenizer/tokenization_qwen_vl.py:287
Method
vocab_size
Returns vocab size
linear_moe/tokenizer/tokenization_baichuan.py:83
Method
vocab_size
(self)
linear_moe/tokenizer/jiebabpe_tokenizer.py:39
Method
vocab_size
(self)
linear_moe/tokenizer/__init__.py:191
Method
vocab_size
(self)
linear_moe/tokenizer/__init__.py:252
Method
vocab_size
(self)
linear_moe/tokenizer/__init__.py:344
Method
vocab_size
(self)
linear_moe/tokenizer/__init__.py:417
Method
vocab_size
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:35
Method
vocab_size
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:328
Method
vocab_size
Returns vocab size
linear_moe/tokenizer/tokenization_yi.py:96
Function
wrapper
(ctx, *args, **kwargs)
linear_moe/utils.py:10
Method
zero_parameters
Zero out all parameters in embedding.
linear_moe/model/llama3/language_model.py:184
← previous
1,401–1,498 of 1,498, ranked by callers