apiversion: modelslim_v1
metadata:
  config_id: deepseek_v4_pro_w4a8
  score: 90
  verified_model_types:
    - DeepSeek-V4-Pro
  verified_tags:
    DeepSeek-V4-Pro:
      - - vLLM-Ascend
        - Atlas_A3_Inference
  label:
    w_bit: 4
    a_bit: 8
    is_sparse: False
    kv_cache: False

default_w4a8_dynamic: &default_w4a8_dynamic
  act:
    scope: "per_token"
    dtype: "int8"
    symmetric: True
    method: "minmax"
  weight:
    scope: "per_channel"
    dtype: "int4"
    symmetric: True
    method: "ssz"

default_w8a8_dynamic: &default_w8a8_dynamic
  act:
    scope: "per_token"
    dtype: "int8"
    symmetric: True
    method: "minmax"
  weight:
    scope: "per_channel"
    dtype: "int8"
    symmetric: True
    method: "minmax"

spec:
  process:
    - type: "quarot"
      block_size: 32
    - type: "flex_awq_ssz"
      qconfig:
        act:
          scope: "per_token"
          dtype: "int8"
          symmetric: True
          method: "minmax"
        weight:
          scope: "per_channel"
          dtype: "int4"
          symmetric: True
          method: "ssz"
          ext:
            step: 10
      enable_subgraph_type:
        - 'up-down'
      include:
        - "*"
      exclude:
        - "*.ffn.shared_experts.*"
    - type: "flex_smooth_quant"
      enable_subgraph_type:
        - 'norm-linear'
      include:
        - "*"
      exclude:
        - "*ffn_norm*"
    - type: "linear_quant"
      qconfig: *default_w8a8_dynamic
      include:
        - "*attn*"
      exclude:
        - "*wo_a"
        - "*wo_b"
        - "*compressor.wgate"
        - "*compressor.wkv"
        - "*indexer.weights_proj"
        - "*indexer.compressor.wgate"
        - "*indexer.compressor.wkv"
    - type: "linear_quant"
      qconfig: *default_w4a8_dynamic
      include:
        - "*ffn*"
      exclude:
        - "*gate"
        - "*shared_experts*"
    - type: "linear_quant"
      qconfig: *default_w8a8_dynamic
      include:
        - "*ffn.shared_experts*"
  dataset: mix_calib.jsonl
  save:
    - type: "ascendv1_saver"
      part_file_size: 4