MCPcopy Create free account

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

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

Methodforward
Forward function of the GPT Model This function passes the input tensors through the embedding layer, and then the decoeder and finally into t
linear_moe/model/mixtral/hybrid/hybrid_model.py:160
Methodforward
( self, hidden_states, attention_mask, key_value_states=None, inferenc
linear_moe/model/mixtral/transformer/attention.py:249
Methodforward
(self, hidden_states)
linear_moe/model/mixtral/transformer/mlp.py:119
Methodforward
Preserve the aux_loss by storing it in the context to avoid garbage collection. Args: output (torch.Tensor): The output t
linear_moe/model/mixtral/moe/moe_utils.py:83
Methodforward
Forward pass for the GroupedMLP module. Args: permuted_local_hidden_states (torch.Tensor): The input hidden states with
linear_moe/model/mixtral/moe/experts.py:143
Methodforward
Forward pass for the SequentialMLP module. It processes the input hidden states using a sequence of MLP experts. Each expert operates
linear_moe/model/mixtral/moe/experts.py:186
Methodforward
(self, hidden_states)
linear_moe/model/mixtral/moe/moe_layer.py:51
Methodforward
Forward pass for the MoE layer. The method routes input tokens to the appropriate expert networks, processes the tokens with
linear_moe/model/mixtral/moe/moe_layer.py:77
Methodforward
Forward pass of the router. Args: input (torch.Tensor): Input tensor. Returns: Tuple[torch.Tensor,
linear_moe/model/mixtral/moe/router.py:80
Methodforward
( self, hidden_states, attention_mask, context=None, context_mask=None
linear_moe/model/qwen2/transformer_layer.py:179
Methodforward
(self, hidden_states)
linear_moe/model/qwen2/rms_norm.py:13
Methodforward
( self, hidden_states: Tensor, attention_mask: Tensor, context: Tensor = None,
linear_moe/model/qwen2/transformer_block.py:322
Methodforward
Forward function of the GPT Model This function passes the input tensors through the embedding layer, and then the decoeder and finally into t
linear_moe/model/qwen2/model.py:159
Methodforward
( self, hidden_states: Tensor, attention_mask: Tensor, context: Tensor = None,
linear_moe/model/qwen2/hybrid/hybrid_transformer_block.py:314
Methodforward
Forward function of the GPT Model This function passes the input tensors through the embedding layer, and then the decoeder and finally into t
linear_moe/model/qwen2/hybrid/hybrid_model.py:160
Methodforward
( self, hidden_states, attention_mask, key_value_states=None, inferenc
linear_moe/model/qwen2/transformer/attention.py:249
Methodforward
(self, hidden_states)
linear_moe/model/qwen2/transformer/mlp.py:119
Methodforward
(self, permuted_local_hidden_states, tokens_per_expert)
linear_moe/model/qwen2/moe/experts.py:156
Methodforward
(self, permuted_local_hidden_states, tokens_per_expert)
linear_moe/model/qwen2/moe/experts.py:206
Methodforward
(self, x, expert_weights, top_experts)
linear_moe/model/qwen2/moe/experts.py:277
Methodforward
(self, x, expert_weights, top_experts)
linear_moe/model/qwen2/moe/experts.py:288
Methodforward
(self, hidden_states)
linear_moe/model/qwen2/moe/moe_layer.py:70
Methodforward
(self, hidden_states: torch.Tensor)
linear_moe/model/qwen2/moe/moe_layer.py:145
Methodforward
Forward pass of the router. Args: input (torch.Tensor): Input tensor.
linear_moe/model/qwen2/moe/router.py:166
Methodforward
Forward pass of the router. Args: input (torch.Tensor): Input tensor.
linear_moe/model/qwen2/moe/router.py:364
Methodforward
(self, x, seq_len=None)
linear_moe/model/deepseek_v2/yarn_rotary_pos_embedding.py:51
Methodforward
( self, hidden_states, position_ids, attention_mask, context=None,
linear_moe/model/deepseek_v2/transformer_layer.py:180
Methodforward
(self, hidden_states)
linear_moe/model/deepseek_v2/rms_norm.py:13
Methodforward
( self, hidden_states: Tensor, position_ids: Tensor, attention_mask: Tensor,
linear_moe/model/deepseek_v2/transformer_block.py:309
Methodforward
Forward function of the GPT Model This function passes the input tensors through the embedding layer, and then the decoeder and finally into t
linear_moe/model/deepseek_v2/model.py:153
Methodforward
( self, hidden_states: Tensor, position_ids: Tensor, attention_mask: Tensor,
linear_moe/model/deepseek_v2/hybrid/hybrid_transformer_block.py:296
Methodforward
Forward function of the GPT Model This function passes the input tensors through the embedding layer, and then the decoeder and finally into t
linear_moe/model/deepseek_v2/hybrid/hybrid_model.py:149
Methodforward
( self, hidden_states, attention_mask, key_value_states=None, inferenc
linear_moe/model/deepseek_v2/transformer/attention.py:177
Methodforward
(self, hidden_states)
linear_moe/model/deepseek_v2/transformer/mlp.py:111
Methodforward
Forward pass of the router. Args: input (torch.Tensor): Input tensor.
linear_moe/model/deepseek_v2/moe/router_old.py:91
Methodforward
Forward pass of the router. Args: input (torch.Tensor): Input tensor. Returns: Tuple[torch.Tensor,
linear_moe/model/deepseek_v2/moe/router_old.py:272
Methodforward
(self, permuted_local_hidden_states, tokens_per_expert)
linear_moe/model/deepseek_v2/moe/experts.py:145
Methodforward
(self, permuted_local_hidden_states, tokens_per_expert)
linear_moe/model/deepseek_v2/moe/experts.py:194
Methodforward
(self, hidden_states)
linear_moe/model/deepseek_v2/moe/moe_layer.py:58
Methodforward
(self, hidden_states: torch.Tensor)
linear_moe/model/deepseek_v2/moe/moe_layer.py:101
Methodforward
Forward pass of the router. Args: input (torch.Tensor): Input tensor.
linear_moe/model/deepseek_v2/moe/router.py:166
Methodforward
Forward pass of the router. Args: input (torch.Tensor): Input tensor.
linear_moe/model/deepseek_v2/moe/router.py:364
Methodforward
( self, hidden_states, attention_mask, context=None, context_mask=None
linear_moe/model/llama3/transformer_layer.py:179
Methodforward
(self, hidden_states)
linear_moe/model/llama3/rms_norm.py:13
Methodforward
(self, input_ids, position_ids, attention_mask, retriever_input_ids=None, retr
linear_moe/model/llama3/gpt_model.py:88
Methodforward
(self, hidden_states, sequence_index=0)
linear_moe/model/llama3/language_model.py:102
Methodforward
(self, input_ids, position_ids, tokentype_ids=None)
linear_moe/model/llama3/language_model.py:212
Methodforward
(self, enc_input_ids, enc_position_ids, enc_attn_mask, dec_input_ids=None, dec_position_ids=No
linear_moe/model/llama3/language_model.py:455
Methodforward
(self, hidden_state)
linear_moe/model/llama3/transformer_legacy.py:80
Methodforward
(self, hidden_states)
linear_moe/model/llama3/transformer_legacy.py:156
Methodforward
(self, hidden_states)
linear_moe/model/llama3/transformer_legacy.py:239
Methodforward
(self, query_layer, key_layer, value_layer, attention_mask)
linear_moe/model/llama3/transformer_legacy.py:357
Methodforward
Implements the multihead softmax attention. Arguments --------- q, k, v: The tensor containing the query, key, and value.
linear_moe/model/llama3/transformer_legacy.py:466
Methodforward
(self, hidden_states, attention_mask, encoder_output=None, inference_params=None,
linear_moe/model/llama3/transformer_legacy.py:648
Methodforward
(self, hidden_states, attention_mask, encoder_output=None, enc_dec_attn_mask=None,
linear_moe/model/llama3/transformer_legacy.py:1152
Methodforward
(self, hidden_states, attention_mask, encoder_output=None, enc_dec_attn_mask=None,
linear_moe/model/llama3/transformer_legacy.py:1314
Methodforward
(self, hidden_states, attention_mask, encoder_output=None, enc_dec_attn_mask=None,
linear_moe/model/llama3/transformer_legacy.py:1700
Methodforward
Forward function of the GPT Model This function passes the input tensors through the embedding layer, and then the decoeder and finally into t
linear_moe/model/llama3/model.py:163
Methodforward
( self, hidden_states: Tensor, attention_mask: Tensor, context: Tensor = None,
linear_moe/model/llama3/hybrid/hybrid_transformer_block.py:314
Methodforward
Forward function of the GPT Model This function passes the input tensors through the embedding layer, and then the decoeder and finally into t
linear_moe/model/llama3/hybrid/hybrid_model.py:160
Methodforward
( self, hidden_states, attention_mask, key_value_states=None, inferenc
linear_moe/model/llama3/transformer/attention.py:253
Methodforward
(self, hidden_states)
linear_moe/model/llama3/transformer/mlp.py:104
Methodforward
( ctx, x, weight, bias, residual=None, eps=1e-6, preno
linear_moe/model/common_modules/layernorm.py:387
Methodforward
(self, x, residual=None, prenorm=False, residual_in_fp32=False)
linear_moe/model/common_modules/layernorm.py:566
Methodforward
(self, x, residual=None, prenorm=False, residual_in_fp32=False)
linear_moe/model/common_modules/layernorm.py:613
Methodforward
(self, x, residual=None, prenorm=False, residual_in_fp32=False)
linear_moe/model/common_modules/layernorm.py:656
Methodforward
( ctx, x, norm_weight, norm_bias, linear_weight, linear_bias,
linear_moe/model/common_modules/layernorm.py:672
Methodforward
(self, x, weight, bias, residual=None, prenorm=False, residual_in_fp32=False)
linear_moe/model/common_modules/layernorm.py:832
Methodforward
(self, x, weight, bias, residual=None, prenorm=False, residual_in_fp32=False)
linear_moe/model/common_modules/layernorm.py:882
Methodforward
(self, x, weight, bias, residual=None, prenorm=False, residual_in_fp32=False)
linear_moe/model/common_modules/layernorm.py:928
Methodforward
( ctx, x, eps=1e-6, )
linear_moe/model/common_modules/l2norm.py:175
Methodforward
(ctx, x)
linear_moe/model/common_modules/activations.py:31
Methodforward
(ctx, x)
linear_moe/model/common_modules/activations.py:135
Methodforward
(ctx, x)
linear_moe/model/common_modules/activations.py:174
Methodforward
(ctx, input, bias)
linear_moe/model/common_modules/activations.py:220
Methodforward
(ctx, input)
linear_moe/model/common_modules/activations.py:258
Methodforward
(ctx, input)
linear_moe/model/common_modules/activations.py:291
Methodforward
(ctx, x, y)
linear_moe/model/common_modules/activations.py:341
Methodforward
(ctx, x, y, weight, bias)
linear_moe/model/common_modules/activations.py:362
Methodforward
( ctx, x, cos, sin, interleaved=False, inplace=False,
linear_moe/model/common_modules/rotary.py:42
Methodforward
qkv: (batch, seqlen, 3, nheads, headdim) if kv is none, else it's just q of shape (batch, seqlen, nheads, headdim) kv: (
linear_moe/model/common_modules/rotary.py:256
Methodforward
(self, x: torch.Tensor)
linear_moe/model/common_modules/feature_map.py:61
Methodforward
(self, x: torch.Tensor)
linear_moe/model/common_modules/feature_map.py:93
Methodforward
(self, x: torch.Tensor)
linear_moe/model/common_modules/feature_map.py:112
Methodforward
(self, x: torch.Tensor)
linear_moe/model/common_modules/feature_map.py:129
Methodforward
(self, x: torch.Tensor)
linear_moe/model/common_modules/feature_map.py:145
Methodforward
(self, x: torch.Tensor)
linear_moe/model/common_modules/feature_map.py:178
Methodforward
(self, x: torch.Tensor)
linear_moe/model/common_modules/feature_map.py:201
Methodforward
(self, x: torch.Tensor, flatten: Optional[bool] = True)
linear_moe/model/common_modules/feature_map.py:229
Methodforward
(self, x: torch.Tensor)
linear_moe/model/common_modules/feature_map.py:255
Methodforward
(self, x: torch.Tensor)
linear_moe/model/common_modules/feature_map.py:266
Methodforward
(self, x: torch.Tensor)
linear_moe/model/common_modules/feature_map.py:277
Methodforward
(self, x: torch.Tensor)
linear_moe/model/common_modules/feature_map.py:288
Methodforward
(self, x: torch.Tensor)
linear_moe/model/common_modules/feature_map.py:299
Functionforward_step
Forward step.
examples/linear_moe_mixtral/pretrain_mcore_mistral.py:229
Functionforward_step
Forward training step. Args: data_iterator : Input data iterator model (GPTModel): The GPT Model
examples/linear_moe_deepseek_v2/pretrain_deepseek.py:224
Functionforward_step
Forward training step. Args: data_iterator : Input data iterator model (GPTModel): The GPT Model
examples/linear_moe_qwen2/pretrain_qwen.py:215
Methodfrom_list_format
(self, list_format: List[Dict])
linear_moe/tokenizer/tokenization_qwen_vl.py:367
Methodgenerate
Generate results given a list of inputs.
eval/models/qwen2_linear_moe.py:90
Functionget_based_linear_moe_layer_local_spec
Generates a specification for a GPT transformer layer using only the core modules from Megatron. Args: num_experts: Optional; the nu
linear_moe/model/mixtral/layer_specs.py:1152
← previousnext →1,101–1,200 of 1,498, ranked by callers