更新时间:2025-08-20 GMT+08:00
分享

W8A8量化替换配置文件 - config.json

权重量化替换相关配置文件。

该文件用于替换执行W8A8量化后权重里的config.json文件,详见W8A8权重量化

{
  "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,
  "pretraining_tp": 1,
  "q_lora_rank": 1536,
  "qk_nope_head_dim": 128,
  "qk_rope_head_dim": 64,
  "quantize": "w8a8_dynamic",
  "quantization_config": {
    "config_groups": {
      "group_0": {
        "input_activations": {
          "actorder": null,
          "block_structure": null,
          "dynamic": true,
          "group_size": null,
          "num_bits": 8,
          "observer": "memoryless",
          "observer_kwargs": {},
          "strategy": "token",
          "symmetric": true,
          "type": "int"
        },
        "output_activations": null,
        "targets": [
          "Linear"
        ],
        "weights": {
          "actorder": null,
          "block_structure": null,
          "dynamic": false,
          "group_size": null,
          "num_bits": 8,
          "observer": "minmax",
          "observer_kwargs": {},
          "strategy": "channel",
          "symmetric": true,
          "type": "int"
        }
      }
    },
    "format": "int-quantized",
    "global_compression_ratio": 1.5943962512751308,
    "ignore": [
      "model.layers.0.self_attn.kv_b_proj",
      "model.layers.1.self_attn.kv_b_proj",
      "model.layers.2.self_attn.kv_b_proj",
      "model.layers.3.self_attn.kv_b_proj",
      "model.layers.4.self_attn.kv_b_proj",
      "model.layers.5.self_attn.kv_b_proj",
      "model.layers.6.self_attn.kv_b_proj",
      "model.layers.7.self_attn.kv_b_proj",
      "model.layers.8.self_attn.kv_b_proj",
      "model.layers.9.self_attn.kv_b_proj",
      "model.layers.10.self_attn.kv_b_proj",
      "model.layers.11.self_attn.kv_b_proj",
      "model.layers.12.self_attn.kv_b_proj",
      "model.layers.13.self_attn.kv_b_proj",
      "model.layers.14.self_attn.kv_b_proj",
      "model.layers.15.self_attn.kv_b_proj",
      "model.layers.16.self_attn.kv_b_proj",
      "model.layers.17.self_attn.kv_b_proj",
      "model.layers.18.self_attn.kv_b_proj",
      "model.layers.19.self_attn.kv_b_proj",
      "model.layers.20.self_attn.kv_b_proj",
      "model.layers.21.self_attn.kv_b_proj",
      "model.layers.22.self_attn.kv_b_proj",
      "model.layers.23.self_attn.kv_b_proj",
      "model.layers.24.self_attn.kv_b_proj",
      "model.layers.25.self_attn.kv_b_proj",
      "model.layers.26.self_attn.kv_b_proj",
      "model.layers.27.self_attn.kv_b_proj",
      "model.layers.28.self_attn.kv_b_proj",
      "model.layers.29.self_attn.kv_b_proj",
      "model.layers.30.self_attn.kv_b_proj",
      "model.layers.31.self_attn.kv_b_proj",
      "model.layers.32.self_attn.kv_b_proj",
      "model.layers.33.self_attn.kv_b_proj",
      "model.layers.34.self_attn.kv_b_proj",
      "model.layers.35.self_attn.kv_b_proj",
      "model.layers.36.self_attn.kv_b_proj",
      "model.layers.37.self_attn.kv_b_proj",
      "model.layers.38.self_attn.kv_b_proj",
      "model.layers.39.self_attn.kv_b_proj",
      "model.layers.40.self_attn.kv_b_proj",
      "model.layers.41.self_attn.kv_b_proj",
      "model.layers.42.self_attn.kv_b_proj",
      "model.layers.43.self_attn.kv_b_proj",
      "model.layers.44.self_attn.kv_b_proj",
      "model.layers.45.self_attn.kv_b_proj",
      "model.layers.46.self_attn.kv_b_proj",
      "model.layers.47.self_attn.kv_b_proj",
      "model.layers.48.self_attn.kv_b_proj",
      "model.layers.49.self_attn.kv_b_proj",
      "model.layers.50.self_attn.kv_b_proj",
      "model.layers.51.self_attn.kv_b_proj",
      "model.layers.52.self_attn.kv_b_proj",
      "model.layers.53.self_attn.kv_b_proj",
      "model.layers.54.self_attn.kv_b_proj",
      "model.layers.55.self_attn.kv_b_proj",
      "model.layers.56.self_attn.kv_b_proj",
      "model.layers.57.self_attn.kv_b_proj",
      "model.layers.58.self_attn.kv_b_proj",
      "model.layers.59.self_attn.kv_b_proj",
      "model.layers.60.self_attn.kv_b_proj",
      "model.layers.61.self_attn.kv_b_proj",
      "lm_head"
    ],
    "kv_cache_scheme": null,
    "quant_method": "compressed-tensors",
    "quantization_status": "compressed"
  },
  "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.47.1",
  "use_cache": true,
  "v_head_dim": 128,
  "vocab_size": 129280
}

相关文档