{
  "modelType": "transformer",
  "output": {
    "baseDir": "models/local",
    "modelBaseId": "minicpm4-0-5b-f16-af32",
    "textOnly": true,
    "fast": false
  },
  "quantization": {
    "weights": "f16",
    "embeddings": "f16",
    "lmHead": "f16",
    "computePrecision": "f32"
  },
  "manifest": {
    "hashAlgorithm": "sha256",
    "artifactIdentity": {
      "sourceCheckpointId": "openbmb/MiniCPM4-0.5B",
      "artifactCompleteness": "complete"
    },
    "eosTokenId": 73440
  },
  "inference": {
    "attention": {
      "queryPreAttnScalar": 64,
      "attnLogitSoftcapping": null,
      "slidingWindow": null,
      "queryKeyNorm": false,
      "valueNorm": false,
      "causal": true,
      "attentionBias": false,
      "attentionOutputGate": false
    },
    "normalization": {
      "rmsNormEps": 0.00001,
      "rmsNormWeightOffset": false,
      "postAttentionNorm": true,
      "preFeedforwardNorm": false,
      "postFeedforwardNorm": false
    },
    "ffn": {
      "activation": "silu",
      "gatedActivation": true,
      "branchMode": "dense",
      "useDoubleWideMlp": false,
      "swigluLimit": null
    },
    "rope": {
      "ropeTheta": 10000,
      "ropeLocalTheta": null,
      "mropeInterleaved": false,
      "mropeSection": null,
      "partialRotaryFactor": null,
      "ropeLocalPartialRotaryFactor": null,
      "ropeFrequencyBaseDim": null,
      "ropeLocalFrequencyBaseDim": null,
      "ropeScalingType": "longrope",
      "ropeScalingFactor": 1,
      "ropeLocalScalingType": null,
      "ropeLocalScalingFactor": 1,
      "yarnBetaFast": null,
      "yarnBetaSlow": null,
      "yarnOriginalMaxPos": null,
      "longropeShortFactor": [
        1.0004360675811768,
        1.0668443441390991,
        1.1631425619125366,
        1.3025742769241333,
        1.5040205717086792,
        1.7941505908966064,
        2.2101221084594727,
        2.802666664123535,
        3.6389970779418945,
        4.804192543029785,
        6.39855432510376,
        8.527148246765137,
        11.277542114257812,
        14.684998512268066,
        18.69317054748535,
        23.13019371032715,
        27.72362518310547,
        32.1606559753418,
        36.168827056884766,
        39.57627868652344,
        42.32667541503906,
        44.45526885986328,
        46.04962921142578,
        47.21482849121094,
        48.05115509033203,
        48.64370346069336,
        49.05967712402344,
        49.34980392456055,
        49.551246643066406,
        49.69068145751953,
        49.78697967529297,
        49.85338592529297
      ],
      "longropeLongFactor": [
        1.0004360675811768,
        1.0668443441390991,
        1.1631425619125366,
        1.3025742769241333,
        1.5040205717086792,
        1.7941505908966064,
        2.2101221084594727,
        2.802666664123535,
        3.6389970779418945,
        4.804192543029785,
        6.39855432510376,
        8.527148246765137,
        11.277542114257812,
        14.684998512268066,
        18.69317054748535,
        23.13019371032715,
        27.72362518310547,
        32.1606559753418,
        36.168827056884766,
        39.57627868652344,
        42.32667541503906,
        44.45526885986328,
        46.04962921142578,
        47.21482849121094,
        48.05115509033203,
        48.64370346069336,
        49.05967712402344,
        49.34980392456055,
        49.551246643066406,
        49.69068145751953,
        49.78697967529297,
        49.85338592529297
      ],
      "longropeOriginalMaxPos": 32768,
      "ropeLocalYarnBetaFast": null,
      "ropeLocalYarnBetaSlow": null,
      "ropeLocalYarnOriginalMaxPos": null
    },
    "output": {
      "finalLogitSoftcapping": null,
      "tieWordEmbeddings": true,
      "scaleEmbeddings": false,
      "embeddingTranspose": false,
      "embeddingVocabSize": null,
      "embeddingPostprocessor": null,
      "embeddingScale": 12,
      "logitInputScale": 0.25
    },
    "layerPattern": {
      "type": "uniform",
      "globalPattern": null,
      "period": null,
      "offset": null,
      "layerTypes": null,
      "residualBranchScale": 0.28577380332470415
    },
    "chatTemplate": {
      "type": "chatml",
      "enabled": true
    }
  },
  "session": {
    "compute": {
      "defaults": {
        "activationDtype": "f32",
        "mathDtype": "f32",
        "accumDtype": "f32",
        "outputDtype": "f32"
      }
    },
    "kvcache": {
      "kvDtype": "f16",
      "layout": "contiguous",
      "maxSeqLen": 8192,
      "pageSize": 256,
      "tiering": {
        "mode": "off",
        "hotWindow": 1024,
        "coldPageSize": 256,
        "coldDtype": "f16",
        "compression": {
          "mode": "none",
          "blockSize": 1,
          "bitWidth": 4,
          "prodMode": false
        },
        "gating": {
          "mode": "auto",
          "minAluBwRatio": 0
        }
      },
      "quantization": {
        "mode": "none",
        "bitWidth": 4,
        "prodMode": false
      }
    },
    "decodeLoop": {
      "batchSize": 4,
      "stopCheckMode": "batch",
      "readbackInterval": 1,
      "readbackMode": "sequential",
      "submitLatencyThresholdMs": null,
      "ringTokens": 1,
      "ringStop": 1,
      "ringStaging": 1,
      "disableCommandBatching": false
    },
    "perLayerInputs": {
      "materialization": "auto",
      "rowCache": {
        "mode": "lru",
        "maxRows": 256,
        "maxBytes": 134217728,
        "decodedDtype": "f32"
      },
      "prefetch": {
        "mode": "next_token",
        "rowsAhead": 1
      },
      "gpuUpload": {
        "mode": "per_step_slices",
        "stagingRows": 2
      },
      "hotCache": {
        "mode": "prepared_tokens",
        "maxTokens": 1024,
        "maxBytes": 134217728,
        "outputDtype": "f32"
      }
    },
    "prefillChunkSubmitMode": "sync",
    "useFlashPrefillAttention": false,
    "useWideTileQ4KPrefill": false,
    "retainQ4KMaterialization": false
  },
  "largeWeights": {
    "gpuResidentOverrides": null
  },
  "execution": {
    "inlineKernelPath": true,
    "policies": {
      "unsupportedPrecision": "error",
      "dtypeTransition": "require_cast_step",
      "unresolvedKernel": "error"
    },
    "kernels": {
      "embed": {
        "kernel": "gather_f16.wgsl",
        "entry": "main",
        "digest": "sha256:a2c318bc362d676769d8cb751d61a4d7777e1068be0456eff634e0821d783c10"
      },
      "rmsnorm": {
        "kernel": "rmsnorm.wgsl",
        "entry": "main",
        "digest": "sha256:4f4d144735bdff86b8567346ba7ea7b82fe68a2ac9656ba1577106158af9bc7c"
      },
      "tiled": {
        "kernel": "matmul_f16w_f32a.wgsl",
        "entry": "main",
        "digest": "sha256:027a8f1cd9713cbe0b0ada160bd175e0542bb90896ad85441b023522d9a1befc"
      },
      "lm_head_gemv": {
        "kernel": "matmul_gemv_subgroup.wgsl",
        "entry": "main_multicol",
        "digest": "sha256:e41f94574d5ac54dd2710036da5d5acc643a483b79b2d74b86825efdaaa7438f",
        "constants": {
          "MULTICOL_COLS_PER_WG": 8,
          "MULTICOL_THREADS_PER_COL": 32
        }
      },
      "rope": {
        "kernel": "rope.wgsl",
        "entry": "main",
        "digest": "sha256:923f9a96c941aee94119ecf04fa5b1508c77b7d927a7e6044ce6588b2d51a416"
      },
      "attn_decode": {
        "kernel": "attention_decode_online_f16kv.wgsl",
        "entry": "main",
        "digest": "sha256:c6d9f8c614a2a088cb533958007896391efb3e348377dc8095c409944c562912",
        "precision": {
          "kvDtype": "f16"
        }
      },
      "attn_stream": {
        "kernel": "attention_streaming_f16kv.wgsl",
        "entry": "main",
        "digest": "sha256:c3ec920699a81ee6df04a64eb0ea2477bec168ebb809af29f2d4b0924a4bdf8f",
        "precision": {
          "kvDtype": "f16"
        }
      },
      "residual": {
        "kernel": "residual.wgsl",
        "entry": "main",
        "digest": "sha256:4dbfb0a9ca0fb6047a01618f0374b445c243774d039407acdf41b0711ea8eaf4"
      },
      "silu": {
        "kernel": "silu.wgsl",
        "entry": "main",
        "digest": "sha256:712787a59b032453b09f147be0d0c073266c47a7a12c3b746984aaf28075bedb"
      },
      "sample": {
        "kernel": "sample.wgsl",
        "entry": "sample_single_pass",
        "digest": "sha256:f2377b2a58c2eeb695a6f6f7ad877630bdba5e74d5dc1a8d919cd73b360d4870"
      },
      "gemv": {
        "kernel": "matmul_gemv_subgroup.wgsl",
        "entry": "main_vec4",
        "digest": "sha256:2ea9aea659367210fbf61d922c0d4ee17cdac68ffb506b3bc5516e498071e011"
      }
    },
    "preLayer": [
      [
        "embed",
        "embed",
        "embed_tokens"
      ]
    ],
    "decode": [
      [
        "input_norm",
        "rmsnorm"
      ],
      [
        "q_proj",
        "gemv",
        "layer.{L}.self_attn.q_proj"
      ],
      [
        "k_proj",
        "gemv",
        "layer.{L}.self_attn.k_proj"
      ],
      [
        "v_proj",
        "gemv",
        "layer.{L}.self_attn.v_proj"
      ],
      [
        "rope_q",
        "rope"
      ],
      [
        "rope_k",
        "rope"
      ],
      [
        "attention",
        "attn_decode"
      ],
      [
        "o_proj",
        "gemv",
        "layer.{L}.self_attn.o_proj"
      ],
      [
        "attn_residual",
        "residual"
      ],
      [
        "post_attn_norm",
        "rmsnorm"
      ],
      [
        "gate_proj",
        "gemv",
        "layer.{L}.mlp.gate_proj"
      ],
      [
        "up_proj",
        "gemv",
        "layer.{L}.mlp.up_proj"
      ],
      [
        "activation",
        "silu"
      ],
      [
        "down_proj",
        "gemv",
        "layer.{L}.mlp.down_proj"
      ],
      [
        "ffn_residual",
        "residual"
      ]
    ],
    "prefill": [
      [
        "input_norm",
        "rmsnorm"
      ],
      [
        "q_proj",
        "tiled",
        "layer.{L}.self_attn.q_proj"
      ],
      [
        "k_proj",
        "tiled",
        "layer.{L}.self_attn.k_proj"
      ],
      [
        "v_proj",
        "tiled",
        "layer.{L}.self_attn.v_proj"
      ],
      [
        "rope_q",
        "rope"
      ],
      [
        "rope_k",
        "rope"
      ],
      [
        "attention",
        "attn_stream"
      ],
      [
        "o_proj",
        "tiled",
        "layer.{L}.self_attn.o_proj"
      ],
      [
        "attn_residual",
        "residual"
      ],
      [
        "post_attn_norm",
        "rmsnorm"
      ],
      [
        "gate_proj",
        "tiled",
        "layer.{L}.mlp.gate_proj"
      ],
      [
        "up_proj",
        "tiled",
        "layer.{L}.mlp.up_proj"
      ],
      [
        "activation",
        "silu"
      ],
      [
        "down_proj",
        "tiled",
        "layer.{L}.mlp.down_proj"
      ],
      [
        "ffn_residual",
        "residual"
      ]
    ],
    "postLayer": [
      [
        "final_norm",
        "rmsnorm"
      ],
      [
        "lm_head",
        "lm_head_gemv",
        "lm_head"
      ],
      [
        "lm_head_prefill",
        "tiled",
        "lm_head"
      ],
      [
        "sample",
        "sample"
      ]
    ],
    "sampling": null
  }
}
