(module)
| 154 | class Loading(): |
| 155 | |
| 156 | def is_load_module(module): |
| 157 | load_layers = [nn.Linear, nn.Embedding, nn.LayerNorm] |
| 158 | load_layer_names = [ |
| 159 | "LPLayerNorm", "SharedEmbedding", "OPTLearnedPositionalEmbedding", "LlamaRMSNorm", "FalconLinear", |
| 160 | "MistralRMSNorm", "T5LayerNorm", "MixtralRMSNorm", "Phi3RotaryEmbedding", "Phi3SuScaledRotaryEmbedding", |
| 161 | "Phi3RMSNorm", "YuanRMSNorm", "YuanRotaryEmbedding", "Phi3LongRoPEScaledRotaryEmbedding", "Qwen2RMSNorm", |
| 162 | "Qwen3RMSNorm", "Qwen3MoeRMSNorm", "Qwen3_5RMSNorm", "Qwen3_5RMSNormGated", "Qwen3_5MoeRMSNorm", |
| 163 | "Qwen3_5MoeRMSNormGated", "DeepseekV2RMSNorm", "DeepseekV3RMSNorm", "DeepseekV2YarnRotaryEmbedding", |
| 164 | "DeepseekV3YarnRotaryEmbedding", "MoEGate" |
| 165 | ] |
| 166 | return module.__class__ in load_layers or module._get_name() in load_layer_names |
| 167 | |
| 168 | def load_buffer(module, state_dict, prefix): |
| 169 | for name in module._buffers.keys(): |
no outgoing calls
no test coverage detected