MCPcopy Create free account

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

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

Methodhead_dim
(self)
toolkits/model_checkpoints_convertor/falcon/configuration_RW.py:129
Methodinitializer
(self)
toolkits/pretrain_data_preprocessing/preprocess_data_megatron.py:36
Methodinv_vocab
(self)
linear_moe/tokenizer/jiebabpe_tokenizer.py:47
Methodinv_vocab
(self)
linear_moe/tokenizer/__init__.py:199
Methodinv_vocab
(self)
linear_moe/tokenizer/__init__.py:260
Methodinv_vocab
(self)
linear_moe/tokenizer/__init__.py:352
Methodinv_vocab
(self)
linear_moe/tokenizer/__init__.py:425
Methodinv_vocab
Dictionary from vocab id token to text token.
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:46
Methodinv_vocab
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:337
Functionis_dataset_built_on_rank
()
examples/linear_moe_mixtral/pretrain_mcore_mistral.py:249
Functionis_dataset_built_on_rank
()
examples/linear_moe_deepseek_v2/pretrain_deepseek.py:245
Functionis_dataset_built_on_rank
()
examples/linear_moe_qwen2/pretrain_qwen.py:236
Functionis_dataset_built_on_rank
()
examples/linear_llama3/pretrain_llama.py:239
Methodjload
Load a .json file into a dictionary. Args: f: The file object or string representing the file path. mode: The
linear_moe/data/llama.py:103
Functionlayer_norm_ref
(x, weight, bias, residual=None, eps=1e-6, prenorm=False, upcast=False)
linear_moe/model/common_modules/layernorm.py:23
Methodlengths
(self)
linear_moe/data/llava/mm_pretrain_dataset.py:198
Functionload_image_from_base64
(image)
linear_moe/data/llava/mm_utils.py:23
Methodload_state_dict
Customized load.
linear_moe/model/llama3/language_model.py:567
Methodload_state_dict
Customize load.
linear_moe/model/llama3/transformer_legacy.py:1812
Methodloglikelihood_rolling
(self, requests: List[Instance])
linear_moe/lm_evaluate.py:118
Functionlogsigmoid_bwd_kernel
( x, dx, dy, T: tl.constexpr, D: tl.constexpr, BT: tl.constexpr )
linear_moe/model/common_modules/activations.py:108
Functionlogsigmoid_fwd_kernel
( x, y, T: tl.constexpr, D: tl.constexpr, BT: tl.constexpr )
linear_moe/model/common_modules/activations.py:65
Functionloss_func
Loss function. Args: loss_mask (Tensor): Used to mask out some portions of the loss output_tensor (Tensor): The tensor with the l
examples/linear_moe_mixtral/pretrain_mcore_mistral.py:197
Functionloss_func
Loss function. Args: loss_mask (torch.Tensor): Used to mask out some portions of the loss output_tensor (torch.Tensor): The tenso
examples/linear_moe_deepseek_v2/pretrain_deepseek.py:192
Functionloss_func
Loss function. Args: loss_mask (torch.Tensor): Used to mask out some portions of the loss output_tensor (torch.Tensor): The tenso
examples/linear_moe_qwen2/pretrain_qwen.py:183
Functionmain
( data_dir: str, tokenizer_name_or_path: str, sequence_length: int = 2048, cac
toolkits/pretrain_data_preprocessing/qwen_hf_preprocess_datasets.py:68
Methodmask
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:79
Functionmegatron_to_transformers_fix_query_key_value_ordering
Permutes layout of param tensor to [num_splits * num_heads * hidden_size, :] for compatibility with later versions of NVIDIA Megatron-LM. The
toolkits/model_checkpoints_convertor/glm/checkpoint_reshaping_and_interoperability.py:155
Functionmegatron_to_transformers_fix_query_key_value_ordering
Permutes layout of param tensor to [num_splits * num_heads * hidden_size, :] for compatibility with later versions of NVIDIA Megatron-LM. The
toolkits/model_checkpoints_convertor/glm130b/checkpoint_reshaping_and_interoperability.py:155
Functionmegatron_to_transformers_fix_query_key_value_ordering
Permutes layout of param tensor to [num_splits * num_heads * hidden_size, :] for compatibility with later versions of NVIDIA Megatron-LM. The
toolkits/model_checkpoints_convertor/starcoder/checkpoint_reshaping_and_interoperability.py:206
Functionmegatron_to_transformers_fix_query_key_value_ordering
Permutes layout of param tensor to [num_splits * num_heads * hidden_size, :] for compatibility with later versions of NVIDIA Megatron-LM. The
toolkits/model_checkpoints_convertor/chatglm/checkpoint_reshaping_and_interoperability.py:183
Functionmegatron_to_transformers_fix_query_key_value_ordering
Permutes layout of param tensor to [num_splits * num_heads * hidden_size, :] for compatibility with later versions of NVIDIA Megatron-LM. The
toolkits/model_checkpoints_convertor/yi/checkpoint_reshaping_and_interoperability.py:198
Functionmegatron_to_transformers_fix_query_key_value_ordering
Permutes layout of param tensor to [num_splits * num_heads * hidden_size, :] for compatibility with later versions of NVIDIA Megatron-LM. The
toolkits/model_checkpoints_convertor/galactica/checkpoint_reshaping_and_interoperability.py:200
Functionmegatron_to_transformers_fix_query_key_value_ordering
Permutes layout of param tensor to [num_splits * num_heads * hidden_size, :] for compatibility with later versions of NVIDIA Megatron-LM. The
toolkits/model_checkpoints_convertor/bloom/checkpoint_reshaping_and_interoperability.py:184
Functionmegatron_to_transformers_fix_query_key_value_ordering
Permutes layout of param tensor to [num_splits * num_heads * hidden_size, :] for compatibility with later versions of NVIDIA Megatron-LM. The
toolkits/model_checkpoints_convertor/bloom/reward_model_to_megatron.py:184
Functionmerge_transformers_sharded_states_13b
Merge sharded checkpoints from transformers into a single checkpoint. Args: path (str): the path to the sharded checkpoints n
toolkits/model_checkpoints_convertor/mistral/hf2megatron.py:298
Functionmerge_transformers_sharded_states_13b
Merge sharded checkpoints from transformers into a single checkpoint. Args: path (str): the path to the sharded checkpoints n
toolkits/model_checkpoints_convertor/yi/checkpoint_reshaping_and_interoperability.py:279
Functionmerge_transformers_sharded_states_13b
Merge sharded checkpoints from transformers into a single checkpoint. Args: path (str): the path to the sharded checkpoints n
toolkits/model_checkpoints_convertor/galactica/checkpoint_reshaping_and_interoperability.py:281
Functionmerge_transformers_sharded_states_13b
Merge sharded checkpoints from transformers into a single checkpoint. Args: path (str): the path to the sharded checkpoints n
toolkits/model_checkpoints_convertor/qwen/hf2megatron_qwen1.5.py:327
Functionmerge_transformers_sharded_states_14b
Merge sharded checkpoints from transformers into a single checkpoint. Args: path (str): the path to the sharded checkpoints n
toolkits/model_checkpoints_convertor/qwen/hf2megatron_qwen1.0.py:303
Functionmerge_transformers_sharded_states_7b
Merge sharded checkpoints from transformers into a single checkpoint. Args: path (str): the path to the sharded checkpoints n
toolkits/model_checkpoints_convertor/baichuan/hf2te.py:165
Functionmerge_transformers_sharded_states_7b
Merge sharded checkpoints from transformers into a single checkpoint. Args: path (str): the path to the sharded checkpoints n
toolkits/model_checkpoints_convertor/baichuan/checkpoint_reshaping_and_interoperability.py:277
Functionmerge_transformers_sharded_states_7b
Merge sharded checkpoints from transformers into a single checkpoint. Args: path (str): the path to the sharded checkpoints n
toolkits/model_checkpoints_convertor/qwen/hf2megatron_qwen1.0.py:288
Functionmerge_transformers_sharded_states_7b
Merge sharded checkpoints from transformers into a single checkpoint. Args: path (str): the path to the sharded checkpoints n
toolkits/model_checkpoints_convertor/qwen/hf2megatron_qwen1.5.py:312
Methodmodality_lengths
(self)
linear_moe/data/llava/mm_pretrain_dataset.py:206
Functionmodel_provider
(pre_process=True, post_process=True)
examples/linear_moe_qwen2/evaluate_huggingface_qwen.py:41
Functionmodel_provider
(pre_process=True, post_process=True)
examples/linear_moe_qwen2/evaluate_mcore_qwen.py:50
Methodnum_image_tokens
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:175
Methodnum_text_tokens
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:179
Methodnum_tokens
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:185
Methodpad_to
(text, max_len, pad_id)
linear_moe/data/glm.py:199
Methodpad_token_id
(self)
linear_moe/tokenizer/__init__.py:223
Methodpad_token_id
(self)
linear_moe/tokenizer/__init__.py:278
Methodpad_token_id
(self)
linear_moe/tokenizer/__init__.py:370
Methodpad_token_id
(self)
linear_moe/tokenizer/__init__.py:443
Methodpredict
Run predict process
linear_moe/generation/gpt_predictor.py:32
Methodpreprocess
Preprocess the data by tokenizing. Args: sources (List[str]): a list of source strings targets (List[str]): a
linear_moe/data/llama.py:124
Functionprint_input_hook
(module, args, kwargs, layer_idx, mode)
toolkits/model_checkpoints_convertor/deepseek/hf2mcore_deepseek_v2_moe.py:438
Functionprint_input_hook
(module, args, kwargs, layer_idx, mode)
toolkits/model_checkpoints_convertor/llama/hf2mcore.py:603
Functionprint_input_hook
(module, args, kwargs, layer_idx, mode)
toolkits/model_checkpoints_convertor/qwen/hf2mcore_qwen1.5_moe.py:412
Functionprint_input_hook
(module, args, kwargs, layer_idx, mode)
toolkits/model_checkpoints_convertor/qwen/hf2mcore_qwen2_dense_and_moe_gqa.py:773
Functionprint_output_hook
(module, args, kwargs, output, layer_idx, mode)
toolkits/model_checkpoints_convertor/deepseek/hf2mcore_deepseek_v2_moe.py:447
Functionprint_output_hook
(module, args, kwargs, output, layer_idx, mode)
toolkits/model_checkpoints_convertor/llama/hf2mcore.py:612
Functionprint_output_hook
(module, args, kwargs, output, layer_idx, mode)
toolkits/model_checkpoints_convertor/qwen/hf2mcore_qwen1.5_moe.py:421
Functionprint_output_hook
(module, args, kwargs, output, layer_idx, mode)
toolkits/model_checkpoints_convertor/qwen/hf2mcore_qwen2_dense_and_moe_gqa.py:782
Functionprocess_images
(images, image_processor, model_cfg)
linear_moe/data/llava/mm_utils.py:41
Methodprocess_json_file
(self, file_name)
toolkits/pretrain_data_preprocessing/preprocess_data_megatron.py:132
Functionrecursive_print
Recursively print the structure of a checkpoint. This function is taken from `convert_megatron_gpt2_checkpoint.py` Args: name (str):
toolkits/model_checkpoints_convertor/qwen/hf2mcore_qwen1.5_dense_gqa.py:216
Functionrelu_bwd
(g, x)
linear_moe/model/common_modules/activations.py:273
Functionrms_norm_ref
(x, weight, bias, residual=None, eps=1e-6, prenorm=False, upcast=False)
linear_moe/model/common_modules/layernorm.py:39
Methodrotary
(self)
toolkits/model_checkpoints_convertor/falcon40b/configuration_RW.py:74
Methodrotary
(self)
toolkits/model_checkpoints_convertor/falcon/configuration_RW.py:78
Methodrotary
(self)
toolkits/model_checkpoints_convertor/falcon/configuration_RW.py:133
Methodrouting
Top-k routing function Args: logits (torch.Tensor): Logits tensor. Returns: Tuple[torch.Tensor, torch.Tensor
linear_moe/model/mixtral/moe/router.py:225
Methodrouting
Routing function. Args: logits (torch.Tensor): Logits tensor. Returns: Tuple[torch.Tensor, torch.Tensor]: Tu
linear_moe/model/qwen2/moe/router.py:154
Methodrouting
Routing function. Args: logits (torch.Tensor): Logits tensor. Returns: Tuple[torch.Tensor, torch.Tensor]: Tu
linear_moe/model/deepseek_v2/moe/router_old.py:79
Methodrouting
Routing function. Args: logits (torch.Tensor): Logits tensor. Returns: Tuple[torch.Tensor, torch.Tensor]: Tu
linear_moe/model/deepseek_v2/moe/router.py:154
Functionrun_preprocess
(jsonl_path, encoded_path, tokenizer, sequence_length, cache_dir)
toolkits/pretrain_data_preprocessing/qwen_hf_preprocess_datasets.py:59
Functionrun_preprocess
(input_fp, output_fp, target_key)
toolkits/pretrain_data_preprocessing/preprocess_wudao2.py:27
Functionrun_preprocess
(input_fp, output_fp)
toolkits/pretrain_data_preprocessing/clean_raw_text.py:28
Methodsave_vocabulary
Save only the vocabulary of the tokenizer (vocabulary). Args: save_directory (str): The directory where the vocabulary file
linear_moe/tokenizer/tokenization_qwen_vl.py:201
Methodsave_vocabulary
Save the vocabulary and special tokens file to a directory. Args: save_directory (`str`): The directory
linear_moe/tokenizer/tokenization_baichuan.py:125
Methodsave_vocabulary
Save the vocabulary and special tokens file to a directory. Args: save_directory (`str`): The directory
linear_moe/tokenizer/tokenization_yi.py:138
Methodsep
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:64
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/sequence_modeling/ssm.py:199
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/sequence_modeling/mamba2/mamba_block.py:177
Methodset_input_tensor
Sets input tensor to the model. See megatron.model.transformer.set_input_tensor() Args: input_tensor (Tensor): Sets the
linear_moe/sequence_modeling/mamba2/mamba_model.py:125
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/mixtral/transformer_block.py:312
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/mixtral/model.py:143
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/mixtral/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/mixtral/hybrid/hybrid_model.py:144
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/qwen2/transformer_block.py:312
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/qwen2/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/qwen2/hybrid/hybrid_model.py:144
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/deepseek_v2/transformer_block.py:299
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/deepseek_v2/model.py:137
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/deepseek_v2/hybrid/hybrid_transformer_block.py:286
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/deepseek_v2/hybrid/hybrid_model.py:133
Methodset_input_tensor
See megatron.legacy.model.transformer.set_input_tensor()
linear_moe/model/llama3/gpt_model.py:84
Methodset_input_tensor
See megatron.legacy.model.transformer.set_input_tensor()
linear_moe/model/llama3/language_model.py:427
← previousnext →1,301–1,400 of 1,498, ranked by callers