Copyright (c) 2025-2025 Huawei Technologies Co., Ltd.
sysHAX-adapter is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
PURPOSE.
See the Mulan PSL v2 for more details.
Created: 2026-1-31
Desc: CPU inference model config
*/
#ifndef MODEL_CONFIG_H
#define MODEL_CONFIG_H
#include <cstring>
namespace cpu_inference {
struct Qwen3MoeConfig {
int32_t bos_token_id = 151643;
int32_t decoder_sparse_step = 1;
int32_t eos_token_id = 151645;
int32_t head_dim = 128;
std::string hidden_act = "silu";
int32_t hidden_size = 2048;
float initializer_range = 0.02f;
int32_t intermediate_size = 6144;
int32_t max_position_embeddings = 40960;
int32_t max_window_layers = 48;
std::vector<int> mlp_only_layers = {};
std::string model_type = "qwen3_moe";
int32_t moe_intermediate_size = 768;
bool norm_topk_prob = true;
int32_t num_attention_heads = 32;
int32_t num_experts = 128;
int32_t num_experts_per_tok = 8;
int32_t num_hidden_layers = 48;
int32_t num_key_value_heads = 4;
bool output_router_logits = false;
float rms_norm_eps = 1e-06f;
float rope_theta = 1000000.0f;
float router_aux_loss_coef = 0.001f;
bool tie_word_embeddings = false;
bool use_cache = true;
bool use_sliding_window = false;
int32_t vocab_size = 151936;
};
};
#endif