moe+asq (#1)
Browse files- upload asq moe quantized model (c01fcbe0d7e2c0d3b6db2d4d326600190b2fab63)
This view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- config.jsonAdded+454
- configuration_deepseek.pyAdded+210
- generation_config.jsonAdded+9
- model-00001-of-00076.safetensorsAdded+3
- model-00002-of-00076.safetensorsAdded+3
- model-00003-of-00076.safetensorsAdded+3
- model-00004-of-00076.safetensorsAdded+3
- model-00005-of-00076.safetensorsAdded+3
- model-00006-of-00076.safetensorsAdded+3
- model-00007-of-00076.safetensorsAdded+3
- model-00008-of-00076.safetensorsAdded+3
- model-00009-of-00076.safetensorsAdded+3
- model-00010-of-00076.safetensorsAdded+3
- model-00011-of-00076.safetensorsAdded+3
- model-00012-of-00076.safetensorsAdded+3
- model-00013-of-00076.safetensorsAdded+3
- model-00014-of-00076.safetensorsAdded+3
- model-00015-of-00076.safetensorsAdded+3
- model-00016-of-00076.safetensorsAdded+3
- model-00017-of-00076.safetensorsAdded+3
- model-00018-of-00076.safetensorsAdded+3
- model-00019-of-00076.safetensorsAdded+3
- model-00020-of-00076.safetensorsAdded+3
- model-00021-of-00076.safetensorsAdded+3
- model-00022-of-00076.safetensorsAdded+3
- model-00023-of-00076.safetensorsAdded+3
- model-00024-of-00076.safetensorsAdded+3
- model-00025-of-00076.safetensorsAdded+3
- model-00026-of-00076.safetensorsAdded+3
- model-00027-of-00076.safetensorsAdded+3
- model-00028-of-00076.safetensorsAdded+3
- model-00029-of-00076.safetensorsAdded+3
- model-00030-of-00076.safetensorsAdded+3
- model-00031-of-00076.safetensorsAdded+3
- model-00032-of-00076.safetensorsAdded+3
- model-00033-of-00076.safetensorsAdded+3
- model-00034-of-00076.safetensorsAdded+3
- model-00035-of-00076.safetensorsAdded+3
- model-00036-of-00076.safetensorsAdded+3
- model-00037-of-00076.safetensorsAdded+3
- model-00038-of-00076.safetensorsAdded+3
- model-00039-of-00076.safetensorsAdded+3
- model-00040-of-00076.safetensorsAdded+3
- model-00041-of-00076.safetensorsAdded+3
- model-00042-of-00076.safetensorsAdded+3
- model-00043-of-00076.safetensorsAdded+3
- model-00044-of-00076.safetensorsAdded+3
- model-00045-of-00076.safetensorsAdded+3
- model-00046-of-00076.safetensorsAdded+3
- model-00047-of-00076.safetensorsAdded+3
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454{ "architectures": [ "DeepseekV3ForCausalLM" ], "attention_bias": false, "attention_dropout": 0.0, "auto_map": { "AutoConfig": "configuration_deepseek.DeepseekV3Config", "AutoModel": "modeling_deepseek.DeepseekV3Model", "AutoModelForCausalLM": "modeling_deepseek.DeepseekV3ForCausalLM" }, "aux_loss_alpha": 0.001, "bos_token_id": 0, "eos_token_id": 1, "ep_size": 1, "first_k_dense_replace": 3, "hidden_act": "silu", "hidden_size": 7168, "initializer_range": 0.02, "intermediate_size": 18432, "kv_lora_rank": 512, "max_position_embeddings": 163840, "model_type": "deepseek_v3", "moe_intermediate_size": 2048, "moe_layer_freq": 1, "n_group": 8, "n_routed_experts": 256, "n_shared_experts": 1, "norm_topk_prob": true, "num_attention_heads": 128, "num_experts_per_tok": 8, "num_hidden_layers": 61, "num_key_value_heads": 128, "num_nextn_predict_layers": 1, "pad_token_id": 128815, "pretraining_tp": 1, "q_lora_rank": 1536, "qk_nope_head_dim": 128, "qk_rope_head_dim": 64, "quantization_config": { "algo_config": { "compute_scale_loss": "MAE", "model_decoder_layers": "model.layers", "name": "autosmoothquant", "num_attention_heads": -1, "num_key_value_heads": -1, "scaling_layers": [ { "inp": "mlp.gate_proj", "layers": [ "mlp.gate_proj", "mlp.up_proj" ], "module2inspect": "mlp", "prev_op": "post_attention_layernorm" }, { "inp": "mlp.down_proj", "layers": [ "mlp.down_proj" ], "prev_op": "mlp.up_proj" }, { "inp": "down_proj", "layers": [ "down_proj" ], "prev_op": "up_proj" } ] }, "exclude": [ "model.layers.0.self_attn.q_a_proj", "model.layers.0.self_attn.q_b_proj", "model.layers.0.self_attn.kv_a_proj_with_mqa", "model.layers.0.self_attn.kv_b_proj", "model.layers.0.self_attn.o_proj", "model.layers.1.self_attn.q_a_proj", "model.layers.1.self_attn.q_b_proj", "model.layers.1.self_attn.kv_a_proj_with_mqa", "model.layers.1.self_attn.kv_b_proj", "model.layers.1.self_attn.o_proj", "model.layers.2.self_attn.q_a_proj", "model.layers.2.self_attn.q_b_proj", "model.layers.2.self_attn.kv_a_proj_with_mqa", "model.layers.2.self_attn.kv_b_proj", "model.layers.2.self_attn.o_proj", "model.layers.3.self_attn.q_a_proj", "model.layers.3.self_attn.q_b_proj", "model.layers.3.self_attn.kv_a_proj_with_mqa", "model.layers.3.self_attn.kv_b_proj", "model.layers.3.self_attn.o_proj", "model.layers.4.self_attn.q_a_proj", "model.layers.4.self_attn.q_b_proj", "model.layers.4.self_attn.kv_a_proj_with_mqa", "model.layers.4.self_attn.kv_b_proj", "model.layers.4.self_attn.o_proj", "model.layers.5.self_attn.q_a_proj", "model.layers.5.self_attn.q_b_proj", "model.layers.5.self_attn.kv_a_proj_with_mqa", "model.layers.5.self_attn.kv_b_proj", "model.layers.5.self_attn.o_proj", "model.layers.6.self_attn.q_a_proj", "model.layers.6.self_attn.q_b_proj", "model.layers.6.self_attn.kv_a_proj_with_mqa", "model.layers.6.self_attn.kv_b_proj", "model.layers.6.self_attn.o_proj", "model.layers.7.self_attn.q_a_proj", "model.layers.7.self_attn.q_b_proj", "model.layers.7.self_attn.kv_a_proj_with_mqa", "model.layers.7.self_attn.kv_b_proj", "model.layers.7.self_attn.o_proj", "model.layers.8.self_attn.q_a_proj", "model.layers.8.self_attn.q_b_proj", "model.layers.8.self_attn.kv_a_proj_with_mqa", "model.layers.8.self_attn.kv_b_proj", "model.layers.8.self_attn.o_proj", "model.layers.9.self_attn.q_a_proj", "model.layers.9.self_attn.q_b_proj", "model.layers.9.self_attn.kv_a_proj_with_mqa", "model.layers.9.self_attn.kv_b_proj", "model.layers.9.self_attn.o_proj", "model.layers.10.self_attn.q_a_proj", "model.layers.10.self_attn.q_b_proj", "model.layers.10.self_attn.kv_a_proj_with_mqa", "model.layers.10.self_attn.kv_b_proj", "model.layers.10.self_attn.o_proj", "model.layers.11.self_attn.q_a_proj", "model.layers.11.self_attn.q_b_proj", "model.layers.11.self_attn.kv_a_proj_with_mqa", "model.layers.11.self_attn.kv_b_proj", "model.layers.11.self_attn.o_proj", "model.layers.12.self_attn.q_a_proj", "model.layers.12.self_attn.q_b_proj", "model.layers.12.self_attn.kv_a_proj_with_mqa", "model.layers.12.self_attn.kv_b_proj", "model.layers.12.self_attn.o_proj", "model.layers.13.self_attn.q_a_proj", "model.layers.13.self_attn.q_b_proj", "model.layers.13.self_attn.kv_a_proj_with_mqa", "model.layers.13.self_attn.kv_b_proj", "model.layers.13.self_attn.o_proj", "model.layers.14.self_attn.q_a_proj", "model.layers.14.self_attn.q_b_proj", "model.layers.14.self_attn.kv_a_proj_with_mqa", "model.layers.14.self_attn.kv_b_proj", "model.layers.14.self_attn.o_proj", "model.layers.15.self_attn.q_a_proj", "model.layers.15.self_attn.q_b_proj", "model.layers.15.self_attn.kv_a_proj_with_mqa", "model.layers.15.self_attn.kv_b_proj", "model.layers.15.self_attn.o_proj", "model.layers.16.self_attn.q_a_proj", "model.layers.16.self_attn.q_b_proj", "model.layers.16.self_attn.kv_a_proj_with_mqa", "model.layers.16.self_attn.kv_b_proj", "model.layers.16.self_attn.o_proj", "model.layers.17.self_attn.q_a_proj", "model.layers.17.self_attn.q_b_proj", "model.layers.17.self_attn.kv_a_proj_with_mqa", "model.layers.17.self_attn.kv_b_proj", "model.layers.17.self_attn.o_proj", "model.layers.18.self_attn.q_a_proj", "model.layers.18.self_attn.q_b_proj", "model.layers.18.self_attn.kv_a_proj_with_mqa", "model.layers.18.self_attn.kv_b_proj", "model.layers.18.self_attn.o_proj", "model.layers.19.self_attn.q_a_proj", "model.layers.19.self_attn.q_b_proj", "model.layers.19.self_attn.kv_a_proj_with_mqa", "model.layers.19.self_attn.kv_b_proj", "model.layers.19.self_attn.o_proj", "model.layers.20.self_attn.q_a_proj", "model.layers.20.self_attn.q_b_proj", "model.layers.20.self_attn.kv_a_proj_with_mqa", "model.layers.20.self_attn.kv_b_proj", "model.layers.20.self_attn.o_proj", "model.layers.21.self_attn.q_a_proj", "model.layers.21.self_attn.q_b_proj", "model.layers.21.self_attn.kv_a_proj_with_mqa", "model.layers.21.self_attn.kv_b_proj", "model.layers.21.self_attn.o_proj", "model.layers.22.self_attn.q_a_proj", "model.layers.22.self_attn.q_b_proj", "model.layers.22.self_attn.kv_a_proj_with_mqa", "model.layers.22.self_attn.kv_b_proj", "model.layers.22.self_attn.o_proj", "model.layers.23.self_attn.q_a_proj", "model.layers.23.self_attn.q_b_proj", "model.layers.23.self_attn.kv_a_proj_with_mqa", "model.layers.23.self_attn.kv_b_proj", "model.layers.23.self_attn.o_proj", "model.layers.24.self_attn.q_a_proj", "model.layers.24.self_attn.q_b_proj", "model.layers.24.self_attn.kv_a_proj_with_mqa", "model.layers.24.self_attn.kv_b_proj", "model.layers.24.self_attn.o_proj", "model.layers.25.self_attn.q_a_proj", "model.layers.25.self_attn.q_b_proj", "model.layers.25.self_attn.kv_a_proj_with_mqa", "model.layers.25.self_attn.kv_b_proj", "model.layers.25.self_attn.o_proj", "model.layers.26.self_attn.q_a_proj", "model.layers.26.self_attn.q_b_proj", "model.layers.26.self_attn.kv_a_proj_with_mqa", "model.layers.26.self_attn.kv_b_proj", "model.layers.26.self_attn.o_proj", "model.layers.27.self_attn.q_a_proj", "model.layers.27.self_attn.q_b_proj", "model.layers.27.self_attn.kv_a_proj_with_mqa", "model.layers.27.self_attn.kv_b_proj", "model.layers.27.self_attn.o_proj", "model.layers.28.self_attn.q_a_proj", "model.layers.28.self_attn.q_b_proj", "model.layers.28.self_attn.kv_a_proj_with_mqa", "model.layers.28.self_attn.kv_b_proj", "model.layers.28.self_attn.o_proj", "model.layers.29.self_attn.q_a_proj", "model.layers.29.self_attn.q_b_proj", "model.layers.29.self_attn.kv_a_proj_with_mqa", "model.layers.29.self_attn.kv_b_proj", "model.layers.29.self_attn.o_proj", "model.layers.30.self_attn.q_a_proj", "model.layers.30.self_attn.q_b_proj", "model.layers.30.self_attn.kv_a_proj_with_mqa", "model.layers.30.self_attn.kv_b_proj", "model.layers.30.self_attn.o_proj", "model.layers.31.self_attn.q_a_proj", "model.layers.31.self_attn.q_b_proj", "model.layers.31.self_attn.kv_a_proj_with_mqa", "model.layers.31.self_attn.kv_b_proj", "model.layers.31.self_attn.o_proj", "model.layers.32.self_attn.q_a_proj", "model.layers.32.self_attn.q_b_proj", "model.layers.32.self_attn.kv_a_proj_with_mqa", "model.layers.32.self_attn.kv_b_proj", "model.layers.32.self_attn.o_proj", "model.layers.33.self_attn.q_a_proj", "model.layers.33.self_attn.q_b_proj", "model.layers.33.self_attn.kv_a_proj_with_mqa", "model.layers.33.self_attn.kv_b_proj", "model.layers.33.self_attn.o_proj", "model.layers.34.self_attn.q_a_proj", "model.layers.34.self_attn.q_b_proj", "model.layers.34.self_attn.kv_a_proj_with_mqa", "model.layers.34.self_attn.kv_b_proj", "model.layers.34.self_attn.o_proj", "model.layers.35.self_attn.q_a_proj", "model.layers.35.self_attn.q_b_proj", "model.layers.35.self_attn.kv_a_proj_with_mqa", "model.layers.35.self_attn.kv_b_proj", "model.layers.35.self_attn.o_proj", "model.layers.36.self_attn.q_a_proj", "model.layers.36.self_attn.q_b_proj", "model.layers.36.self_attn.kv_a_proj_with_mqa", "model.layers.36.self_attn.kv_b_proj", "model.layers.36.self_attn.o_proj", "model.layers.37.self_attn.q_a_proj", "model.layers.37.self_attn.q_b_proj", "model.layers.37.self_attn.kv_a_proj_with_mqa", "model.layers.37.self_attn.kv_b_proj", "model.layers.37.self_attn.o_proj", "model.layers.38.self_attn.q_a_proj", "model.layers.38.self_attn.q_b_proj", "model.layers.38.self_attn.kv_a_proj_with_mqa", "model.layers.38.self_attn.kv_b_proj", "model.layers.38.self_attn.o_proj", "model.layers.39.self_attn.q_a_proj", "model.layers.39.self_attn.q_b_proj", "model.layers.39.self_attn.kv_a_proj_with_mqa", "model.layers.39.self_attn.kv_b_proj", "model.layers.39.self_attn.o_proj", "model.layers.40.self_attn.q_a_proj", "model.layers.40.self_attn.q_b_proj", "model.layers.40.self_attn.kv_a_proj_with_mqa", "model.layers.40.self_attn.kv_b_proj", "model.layers.40.self_attn.o_proj", "model.layers.41.self_attn.q_a_proj", "model.layers.41.self_attn.q_b_proj", "model.layers.41.self_attn.kv_a_proj_with_mqa", "model.layers.41.self_attn.kv_b_proj", "model.layers.41.self_attn.o_proj", "model.layers.42.self_attn.q_a_proj", "model.layers.42.self_attn.q_b_proj", "model.layers.42.self_attn.kv_a_proj_with_mqa", "model.layers.42.self_attn.kv_b_proj", "model.layers.42.self_attn.o_proj", "model.layers.43.self_attn.q_a_proj", "model.layers.43.self_attn.q_b_proj", "model.layers.43.self_attn.kv_a_proj_with_mqa", "model.layers.43.self_attn.kv_b_proj", "model.layers.43.self_attn.o_proj", "model.layers.44.self_attn.q_a_proj", "model.layers.44.self_attn.q_b_proj", "model.layers.44.self_attn.kv_a_proj_with_mqa", "model.layers.44.self_attn.kv_b_proj", "model.layers.44.self_attn.o_proj", "model.layers.45.self_attn.q_a_proj", "model.layers.45.self_attn.q_b_proj", "model.layers.45.self_attn.kv_a_proj_with_mqa", "model.layers.45.self_attn.kv_b_proj", "model.layers.45.self_attn.o_proj", "model.layers.46.self_attn.q_a_proj", "model.layers.46.self_attn.q_b_proj", "model.layers.46.self_attn.kv_a_proj_with_mqa", "model.layers.46.self_attn.kv_b_proj", "model.layers.46.self_attn.o_proj", "model.layers.47.self_attn.q_a_proj", "model.layers.47.self_attn.q_b_proj", "model.layers.47.self_attn.kv_a_proj_with_mqa", "model.layers.47.self_attn.kv_b_proj", "model.layers.47.self_attn.o_proj", "model.layers.48.self_attn.q_a_proj", "model.layers.48.self_attn.q_b_proj", "model.layers.48.self_attn.kv_a_proj_with_mqa", "model.layers.48.self_attn.kv_b_proj", "model.layers.48.self_attn.o_proj", "model.layers.49.self_attn.q_a_proj", "model.layers.49.self_attn.q_b_proj", "model.layers.49.self_attn.kv_a_proj_with_mqa", "model.layers.49.self_attn.kv_b_proj", "model.layers.49.self_attn.o_proj", "model.layers.50.self_attn.q_a_proj", "model.layers.50.self_attn.q_b_proj", "model.layers.50.self_attn.kv_a_proj_with_mqa", "model.layers.50.self_attn.kv_b_proj", "model.layers.50.self_attn.o_proj", "model.layers.51.self_attn.q_a_proj", "model.layers.51.self_attn.q_b_proj", "model.layers.51.self_attn.kv_a_proj_with_mqa", "model.layers.51.self_attn.kv_b_proj", "model.layers.51.self_attn.o_proj", "model.layers.52.self_attn.q_a_proj", "model.layers.52.self_attn.q_b_proj", "model.layers.52.self_attn.kv_a_proj_with_mqa", "model.layers.52.self_attn.kv_b_proj", "model.layers.52.self_attn.o_proj", "model.layers.53.self_attn.q_a_proj", "model.layers.53.self_attn.q_b_proj", "model.layers.53.self_attn.kv_a_proj_with_mqa", "model.layers.53.self_attn.kv_b_proj", "model.layers.53.self_attn.o_proj", "model.layers.54.self_attn.q_a_proj", "model.layers.54.self_attn.q_b_proj", "model.layers.54.self_attn.kv_a_proj_with_mqa", "model.layers.54.self_attn.kv_b_proj", "model.layers.54.self_attn.o_proj", "model.layers.55.self_attn.q_a_proj", "model.layers.55.self_attn.q_b_proj", "model.layers.55.self_attn.kv_a_proj_with_mqa", "model.layers.55.self_attn.kv_b_proj", "model.layers.55.self_attn.o_proj", "model.layers.56.self_attn.q_a_proj", "model.layers.56.self_attn.q_b_proj", "model.layers.56.self_attn.kv_a_proj_with_mqa", "model.layers.56.self_attn.kv_b_proj", "model.layers.56.self_attn.o_proj", "model.layers.57.self_attn.q_a_proj", "model.layers.57.self_attn.q_b_proj", "model.layers.57.self_attn.kv_a_proj_with_mqa", "model.layers.57.self_attn.kv_b_proj", "model.layers.57.self_attn.o_proj", "model.layers.58.self_attn.q_a_proj", "model.layers.58.self_attn.q_b_proj", "model.layers.58.self_attn.kv_a_proj_with_mqa", "model.layers.58.self_attn.kv_b_proj", "model.layers.58.self_attn.o_proj", "model.layers.59.self_attn.q_a_proj", "model.layers.59.self_attn.q_b_proj", "model.layers.59.self_attn.kv_a_proj_with_mqa", "model.layers.59.self_attn.kv_b_proj", "model.layers.59.self_attn.o_proj", "model.layers.60.self_attn.q_a_proj", "model.layers.60.self_attn.q_b_proj", "model.layers.60.self_attn.kv_a_proj_with_mqa", "model.layers.60.self_attn.kv_b_proj", "model.layers.60.self_attn.o_proj", "lm_head" ], "export": { "kv_cache_group": [], "min_kv_scale": 0.0, "pack_method": "reorder", "weight_format": "real_quantized", "weight_merge_groups": null }, "global_quant_config": { "bias": null, "input_tensors": { "ch_axis": -1, "dtype": "fp4", "group_size": 32, "is_dynamic": true, "is_mx_scale_constraint": false, "is_scale_quant": false, "mx_element_dtype": null, "observer_cls": "PerBlockMXObserver", "qscheme": "per_group", "round_method": "half_even", "scale_calculation_mode": "even", "scale_format": "e8m0", "scale_type": "float", "symmetric": null }, "output_tensors": null, "target_device": null, "weight": { "ch_axis": -1, "dtype": "fp4", "group_size": 32, "is_dynamic": false, "is_mx_scale_constraint": false, "is_scale_quant": false, "mx_element_dtype": null, "observer_cls": "PerBlockMXObserver", "qscheme": "per_group", "round_method": "half_even", "scale_calculation_mode": "even", "scale_format": "e8m0", "scale_type": "float", "symmetric": null } }, "layer_quant_config": {}, "layer_type_quant_config": {}, "quant_method": "quark", "quant_mode": "eager_mode", "softmax_quant_spec": null }, "rms_norm_eps": 1e-06, "rope_scaling": { "beta_fast": 32, "beta_slow": 1, "factor": 40, "mscale": 1.0, "mscale_all_dim": 1.0, "original_max_position_embeddings": 4096, "type": "yarn" }, "rope_theta": 10000, "routed_scaling_factor": 2.5, "scoring_func": "sigmoid", "seq_aux": true, "tie_word_embeddings": false, "topk_group": 4, "topk_method": "noaux_tc", "torch_dtype": "bfloat16", "transformers_version": "4.51.3", "unsloth_fixed": true, "use_cache": true, "v_head_dim": 128, "vocab_size": 129280}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210from transformers.configuration_utils import PretrainedConfigfrom transformers.utils import logging
logger = logging.get_logger(__name__)
DEEPSEEK_PRETRAINED_CONFIG_ARCHIVE_MAP = {}class DeepseekV3Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`DeepseekV3Model`]. It is used to instantiate an DeepSeek model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of the DeepSeek-V3.
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the documentation from [`PretrainedConfig`] for more information.
Args: vocab_size (`int`, *optional*, defaults to 129280): Vocabulary size of the Deep model. Defines the number of different tokens that can be represented by the `inputs_ids` passed when calling [`DeepseekV3Model`] hidden_size (`int`, *optional*, defaults to 4096): Dimension of the hidden representations. intermediate_size (`int`, *optional*, defaults to 11008): Dimension of the MLP representations. moe_intermediate_size (`int`, *optional*, defaults to 1407): Dimension of the MoE representations. num_hidden_layers (`int`, *optional*, defaults to 32): Number of hidden layers in the Transformer decoder. num_nextn_predict_layers (`int`, *optional*, defaults to 1): Number of nextn predict layers in the DeepSeekV3 Model. num_attention_heads (`int`, *optional*, defaults to 32): Number of attention heads for each attention layer in the Transformer decoder. n_shared_experts (`int`, *optional*, defaults to None): Number of shared experts, None means dense model. n_routed_experts (`int`, *optional*, defaults to None): Number of routed experts, None means dense model. routed_scaling_factor (`float`, *optional*, defaults to 1.0): Scaling factor or routed experts. topk_method (`str`, *optional*, defaults to `gready`): Topk method used in routed gate. n_group (`int`, *optional*, defaults to None): Number of groups for routed experts. topk_group (`int`, *optional*, defaults to None): Number of selected groups for each token(for each token, ensuring the selected experts is only within `topk_group` groups). num_experts_per_tok (`int`, *optional*, defaults to None): Number of selected experts, None means dense model. moe_layer_freq (`int`, *optional*, defaults to 1): The frequency of the MoE layer: one expert layer for every `moe_layer_freq - 1` dense layers. first_k_dense_replace (`int`, *optional*, defaults to 0): Number of dense layers in shallow layers(embed->dense->dense->...->dense->moe->moe...->lm_head). \--k dense layers--/ norm_topk_prob (`bool`, *optional*, defaults to False): Whether to normalize the weights of the routed experts. scoring_func (`str`, *optional*, defaults to 'softmax'): Method of computing expert weights. aux_loss_alpha (`float`, *optional*, defaults to 0.001): Auxiliary loss weight coefficient. seq_aux = (`bool`, *optional*, defaults to True): Whether to compute the auxiliary loss for each individual sample. num_key_value_heads (`int`, *optional*): This is the number of key_value heads that should be used to implement Grouped Query Attention. If `num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if `num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed by meanpooling all the original heads within that group. For more details checkout [this paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to `num_attention_heads`. hidden_act (`str` or `function`, *optional*, defaults to `"silu"`): The non-linear activation function (function or string) in the decoder. max_position_embeddings (`int`, *optional*, defaults to 2048): The maximum sequence length that this model might ever be used with. initializer_range (`float`, *optional*, defaults to 0.02): The standard deviation of the truncated_normal_initializer for initializing all weight matrices. rms_norm_eps (`float`, *optional*, defaults to 1e-06): The epsilon used by the rms normalization layers. use_cache (`bool`, *optional*, defaults to `True`): Whether or not the model should return the last key/values attentions (not used by all models). Only relevant if `config.is_decoder=True`. pad_token_id (`int`, *optional*): Padding token id. bos_token_id (`int`, *optional*, defaults to 1): Beginning of stream token id. eos_token_id (`int`, *optional*, defaults to 2): End of stream token id. pretraining_tp (`int`, *optional*, defaults to 1): Experimental feature. Tensor parallelism rank used during pretraining. Please refer to [this document](https://huggingface.co/docs/transformers/parallelism) to understand more about it. This value is necessary to ensure exact reproducibility of the pretraining results. Please refer to [this issue](https://github.com/pytorch/pytorch/issues/76232). tie_word_embeddings (`bool`, *optional*, defaults to `False`): Whether to tie weight embeddings rope_theta (`float`, *optional*, defaults to 10000.0): The base period of the RoPE embeddings. rope_scaling (`Dict`, *optional*): Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is `{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update `max_position_embeddings` to the expected new maximum. attention_bias (`bool`, defaults to `False`, *optional*, defaults to `False`): Whether to use a bias in the query, key, value and output projection layers during self-attention. attention_dropout (`float`, *optional*, defaults to 0.0): The dropout ratio for the attention probabilities.
```python >>> from transformers import DeepseekV3Model, DeepseekV3Config
>>> # Initializing a Deepseek-V3 style configuration >>> configuration = DeepseekV3Config()
>>> # Accessing the model configuration >>> configuration = model.config ```"""
model_type = "deepseek_v3" keys_to_ignore_at_inference = ["past_key_values"]
def __init__( self, vocab_size=129280, hidden_size=7168, intermediate_size=18432, moe_intermediate_size = 2048, num_hidden_layers=61, num_nextn_predict_layers=1, num_attention_heads=128, num_key_value_heads=128, n_shared_experts = 1, n_routed_experts = 256, ep_size = 1, routed_scaling_factor = 2.5, kv_lora_rank = 512, q_lora_rank = 1536, qk_rope_head_dim = 64, v_head_dim = 128, qk_nope_head_dim = 128, topk_method = 'noaux_tc', n_group = 8, topk_group = 4, num_experts_per_tok = 8, moe_layer_freq = 1, first_k_dense_replace = 3, norm_topk_prob = True, scoring_func = 'sigmoid', aux_loss_alpha = 0.001, seq_aux = True, hidden_act="silu", max_position_embeddings=4096, initializer_range=0.02, rms_norm_eps=1e-6, use_cache=True, pad_token_id=None, bos_token_id=0, eos_token_id=1, pretraining_tp=1, tie_word_embeddings=False, rope_theta=10000.0, rope_scaling=None, attention_bias=False, attention_dropout=0.0, **kwargs, ): self.vocab_size = vocab_size self.max_position_embeddings = max_position_embeddings self.hidden_size = hidden_size self.intermediate_size = intermediate_size self.moe_intermediate_size = moe_intermediate_size self.num_hidden_layers = num_hidden_layers self.num_nextn_predict_layers = num_nextn_predict_layers self.num_attention_heads = num_attention_heads self.n_shared_experts = n_shared_experts self.n_routed_experts = n_routed_experts self.ep_size = ep_size self.routed_scaling_factor = routed_scaling_factor self.kv_lora_rank = kv_lora_rank self.q_lora_rank = q_lora_rank self.qk_rope_head_dim = qk_rope_head_dim self.v_head_dim = v_head_dim self.qk_nope_head_dim = qk_nope_head_dim self.topk_method = topk_method self.n_group = n_group self.topk_group = topk_group self.num_experts_per_tok = num_experts_per_tok self.moe_layer_freq = moe_layer_freq self.first_k_dense_replace = first_k_dense_replace self.norm_topk_prob = norm_topk_prob self.scoring_func = scoring_func self.aux_loss_alpha = aux_loss_alpha self.seq_aux = seq_aux # for backward compatibility if num_key_value_heads is None: num_key_value_heads = num_attention_heads
self.num_key_value_heads = num_key_value_heads self.hidden_act = hidden_act self.initializer_range = initializer_range self.rms_norm_eps = rms_norm_eps self.pretraining_tp = pretraining_tp self.use_cache = use_cache self.rope_theta = rope_theta self.rope_scaling = rope_scaling self.attention_bias = attention_bias self.attention_dropout = attention_dropout
super().__init__( pad_token_id=pad_token_id, bos_token_id=bos_token_id, eos_token_id=eos_token_id, tie_word_embeddings=tie_word_embeddings, **kwargs, )123456789{ "_from_model_config": true, "bos_token_id": 0, "do_sample": true, "eos_token_id": 1, "temperature": 0.6, "top_p": 0.95, "transformers_version": "4.51.3"}123version https://git-lfs.github.com/spec/v1oid sha256:63ca4d560e0faef0df165cbe23501a40af48b3e6e0af1ef71e9c0e681ff46d40size 4995884768123version https://git-lfs.github.com/spec/v1oid sha256:f4ca2ac91eadcb0941d6feb5d25100c5dccd0ad78a872e0173900adff2de0d36size 4995052496123version https://git-lfs.github.com/spec/v1oid sha256:48fe7856e8527ba5efd6c086aa0d15aefa7e0b4ac37785cedf72f6512db1da57size 4999071368123version https://git-lfs.github.com/spec/v1oid sha256:e201d7a764d220b10fabaf9f3af1a69b365222a7b2b426aa58ef0a4ec69815cfsize 4994943096123version https://git-lfs.github.com/spec/v1oid sha256:d95eecd8de3bd59a037d882568bd947b10159fc4ef23dec19cb0625af0a60ad5size 4994943232123version https://git-lfs.github.com/spec/v1oid sha256:bc68ae966c0d2f2cd737e24dddb2bf17bac5e8727295ca25f25989bd55123d2asize 4994943456123version https://git-lfs.github.com/spec/v1oid sha256:958675a01ba08cf5231a886ffa1b40d12105b13df6ebedebf58bcd62fb015963size 4999180624123version https://git-lfs.github.com/spec/v1oid sha256:1e679ba36e007c55aa86f671f3e5758357c17a84a5b04600eeb035daa12be832size 4994943096123version https://git-lfs.github.com/spec/v1oid sha256:6c5e2ba4d9c18572331e31e3f09f24aeebf806434db2a8ce890643248cf3a91fsize 4994943096123version https://git-lfs.github.com/spec/v1oid sha256:0fecc475b57c858f8be5a82e7055572f2fe1db646bb3b8bee892c0822e8f2ccasize 4994943720123version https://git-lfs.github.com/spec/v1oid sha256:2a9df0953d2a655283ac4321a52cff7ba8e6e7bfcce3fd4e49e071154baef4casize 4916044152123version https://git-lfs.github.com/spec/v1oid sha256:a0b324256e9900992b5718dbc016fac1c9df249cb68f5a46aec47d6d47ba805fsize 5000091936123version https://git-lfs.github.com/spec/v1oid sha256:da266c07535de2820652b58a52a2f556b9cfd00058572243044c7b6632726a89size 4994944296123version https://git-lfs.github.com/spec/v1oid sha256:751e8bed8d630c8c46d1fa7466c34b8703f93d57acab8ca76f32d33e447d6743size 4994944392123version https://git-lfs.github.com/spec/v1oid sha256:e20545f0a96cf537b1a222a8344c74f750ac1605efcfcc3aed39fc274d3d5d51size 4994944648123version https://git-lfs.github.com/spec/v1oid sha256:cc41909924a6d1866940342fe060909585c9d4e1d603d877ef45b3af9f6bfc70size 4999181952123version https://git-lfs.github.com/spec/v1oid sha256:df9d63f028e6c4980df72e791eaddf29f3e492fed579fab7c4cea37965a64895size 4994944288123version https://git-lfs.github.com/spec/v1oid sha256:8b4bd5df0ccf2a34f10b3a8b6e323eb3e84f3443f830ddbc4de58c04b72d9e02size 4994944296123version https://git-lfs.github.com/spec/v1oid sha256:918f36bdd51fdfb7545866ef568bb22f6806b7303fa4dea0b90b93e5020ab801size 4994944536123version https://git-lfs.github.com/spec/v1oid sha256:b4a9b5ce2f5051eb15612a0bee4d7af03cd3561112bee2b99f677c51b47dd84fsize 4767862480123version https://git-lfs.github.com/spec/v1oid sha256:f2539882f19a491fbb8d35430a97b56519de350ee32a8db415321ed8848e7255size 5000091936123version https://git-lfs.github.com/spec/v1oid sha256:332bd162e119c8d2976fb6f8d860e11b905bfcfdf269896e8866b57fba062769size 4994944296123version https://git-lfs.github.com/spec/v1oid sha256:1a84c3bf5b86d5d1ab112c5391293426f65ccdede9d81d89e94b752cb6bc7c36size 4994944392123version https://git-lfs.github.com/spec/v1oid sha256:ea4155bff895f55d944cc2932fe60bbe5d0063a07563bbacddb18c454fbfed6fsize 4994944648123version https://git-lfs.github.com/spec/v1oid sha256:494330e312c06cc83970f600dd614afb18c31bbea932defe0418a01dd9af3fcdsize 4999181952123version https://git-lfs.github.com/spec/v1oid sha256:08fef0bf35c5a07ba9be720f1a769c84e374877edf307883c27a164e9ec6127csize 4994944288123version https://git-lfs.github.com/spec/v1oid sha256:434d8f6357828f5b90c50b39e61f66e71664217151f17bce8d72330635c384bdsize 4994944296123version https://git-lfs.github.com/spec/v1oid sha256:ab90d0ee909ea8ae7764c2a4dd35d707c9ec1e00e017fc3f393f90d7c2328b31size 4994944536123version https://git-lfs.github.com/spec/v1oid sha256:7103c2ec83a55fda632765a375cd5c6c0a92891b6b4d47f45f5573e61a7d5380size 4767862480123version https://git-lfs.github.com/spec/v1oid sha256:583998027f5955b5b9fd4f056e59940fd63e67fb9f8fb11f60234e6e012a4a2dsize 5000091936123version https://git-lfs.github.com/spec/v1oid sha256:0e2ce43497a1405b8292442d123a6bc889127cd89d1932975796b9de2582cdefsize 4994944296123version https://git-lfs.github.com/spec/v1oid sha256:7c6d7badd691827eb515b22ad8eb16fe3935f63baae82b18c8d749bfa6768a29size 4994944392123version https://git-lfs.github.com/spec/v1oid sha256:da32ce9859d1d8bb82b060a775578f1ade1efdc12b293391e90d9787037e56b6size 4994944648123version https://git-lfs.github.com/spec/v1oid sha256:49150c80ca6d531a51bbb6c0053e932cfb51c2a4a14d1e2b375eadd71d9f82e3size 4999181952123version https://git-lfs.github.com/spec/v1oid sha256:5152ae536963a9eb5c270becfd78c8c8157b5cc703a9fa1410af230243a9e328size 4994944288123version https://git-lfs.github.com/spec/v1oid sha256:78c64237fecda8e591c2fc01c082dd92dc64d2bda7c5f5d3eea270322a875ba2size 4994944296123version https://git-lfs.github.com/spec/v1oid sha256:a3853e835dc9a6493a5c9a01f06d2a926afb38cc923b4f140de6d01c264f0728size 4994944536123version https://git-lfs.github.com/spec/v1oid sha256:98264e9c269c579ba6ab5839327942158eb4cd1f6417db3093e5238e92a20c99size 4767862480123version https://git-lfs.github.com/spec/v1oid sha256:9f9739f520fb31bf6f7f3474495e1bdca2bb27571206c49fe40837ac86ecbc12size 5000091936123version https://git-lfs.github.com/spec/v1oid sha256:7a63745e6393554891a5ddcecf73814fb785b4baff30c270224cbc3b083a423csize 4994944296123version https://git-lfs.github.com/spec/v1oid sha256:4c437acf47efd1616a4685feaafba61d9eeb0afa539967db98f497ca42e7620csize 4994944392123version https://git-lfs.github.com/spec/v1oid sha256:dca3b4c55b4b85f9ca7370c8b678d72a0eacb320d3656af13f56a40b3b44b9cdsize 4994944648123version https://git-lfs.github.com/spec/v1oid sha256:ec53416f5c28567f50acba9ec99ecdc9c36efa67bdc47f66450b52e61e2570aesize 4999181952123version https://git-lfs.github.com/spec/v1oid sha256:042dbfb110634ef17aacad948f22fac2da1d9b6028e2a26e9228114629053156size 4994944288123version https://git-lfs.github.com/spec/v1oid sha256:4cbaa9c03aa658d42d25a2495756b78786fd789b41a3288d5a06a96bb02cc202size 4994944296123version https://git-lfs.github.com/spec/v1oid sha256:f60ba5a10e0ec88dbf62e0a27a1f0316939c655bb86718c958d65e229c7cced3size 4994944536123version https://git-lfs.github.com/spec/v1oid sha256:e7496e5a1f159705c405a5ddee082dbbbd99485138c0d44d3389d58455b28d32size 4767862480config.jsonAdded+454
configuration_deepseek.pyAdded+210
generation_config.jsonAdded+9
model-00001-of-00076.safetensorsAdded+3
model-00002-of-00076.safetensorsAdded+3
model-00003-of-00076.safetensorsAdded+3
model-00004-of-00076.safetensorsAdded+3
model-00005-of-00076.safetensorsAdded+3
model-00006-of-00076.safetensorsAdded+3
model-00007-of-00076.safetensorsAdded+3
model-00008-of-00076.safetensorsAdded+3
model-00009-of-00076.safetensorsAdded+3
model-00010-of-00076.safetensorsAdded+3
model-00011-of-00076.safetensorsAdded+3
model-00012-of-00076.safetensorsAdded+3
model-00013-of-00076.safetensorsAdded+3
model-00014-of-00076.safetensorsAdded+3
model-00015-of-00076.safetensorsAdded+3
model-00016-of-00076.safetensorsAdded+3
model-00017-of-00076.safetensorsAdded+3
model-00018-of-00076.safetensorsAdded+3
model-00019-of-00076.safetensorsAdded+3
model-00020-of-00076.safetensorsAdded+3
model-00021-of-00076.safetensorsAdded+3
model-00022-of-00076.safetensorsAdded+3
model-00023-of-00076.safetensorsAdded+3
model-00024-of-00076.safetensorsAdded+3
model-00025-of-00076.safetensorsAdded+3
model-00026-of-00076.safetensorsAdded+3
model-00027-of-00076.safetensorsAdded+3
model-00028-of-00076.safetensorsAdded+3
model-00029-of-00076.safetensorsAdded+3
model-00030-of-00076.safetensorsAdded+3
model-00031-of-00076.safetensorsAdded+3
model-00032-of-00076.safetensorsAdded+3
model-00033-of-00076.safetensorsAdded+3
model-00034-of-00076.safetensorsAdded+3
model-00035-of-00076.safetensorsAdded+3
model-00036-of-00076.safetensorsAdded+3
model-00037-of-00076.safetensorsAdded+3
model-00038-of-00076.safetensorsAdded+3
model-00039-of-00076.safetensorsAdded+3
model-00040-of-00076.safetensorsAdded+3
model-00041-of-00076.safetensorsAdded+3
model-00042-of-00076.safetensorsAdded+3
model-00043-of-00076.safetensorsAdded+3
model-00044-of-00076.safetensorsAdded+3
model-00045-of-00076.safetensorsAdded+3
model-00046-of-00076.safetensorsAdded+3
model-00047-of-00076.safetensorsAdded+3