{
  "schema_version": "1.0",
  "id": "T-2804520d5d9d",
  "url": "https://gpuatlas.top/articles/T-2804520d5d9d/",
  "title": "首字出来慢和后面出字慢，应该分别查什么？",
  "summary": "首字与持续生成需分别定位，三类输入输出对照可区分加载、预填充、状态和客户端显示等待。",
  "language": "zh-Hans",
  "category": {
    "id": "c-02",
    "name": "推理与上下文",
    "url": "https://gpuatlas.top/categories/c-02/"
  },
  "topics": [],
  "body_text": "首字慢与后续出字慢是不同指标。首字从请求到第一个生成token，持续生成描述之后的输出，客户端实际显示还可能受网络和缓冲影响，不能只报一个tokens/s。\n\n首字先查排队、模型是否常驻、编译预热和实际输入历史。第一次慢、后续快时核对加载与缓存，长输入才慢时看预填充，不能只按界面问题字数估工作。\n\n后续生成慢，查看真实GPU驻留、缓存长度、量化内核、活动请求和多卡通信。CPU参与时加入主存及完整等待，权重装下不代表所有计算都在GPU，显存高也不自动等于泄漏。\n\n准备短输入短输出、长输入短输出、短输入长输出，固定文件、模板、模式和采样，记录实际token。前两组看输入增长，第三组看生成，冷暖与前缀命中分开，失败和截断单列。\n\n若服务端已经产出文字，页面仍然空白，就沿流式响应、代理和客户端解析逐段检查；若服务端也尚未生成，则继续查首字前的工作。改完后重跑那组长输入短输出和短输入长输出请求，连同峰值与完整答案一起看，确认改善发生在哪个阶段。",
  "published_at": null,
  "modified_at": "2026-11-26T15:17:38.690397+00:00",
  "evidence": {
    "type": "documentation_and_conditional_estimates",
    "hardware_tested": false,
    "note": "资料解释与条件估算，非硬件实测。"
  },
  "sources": [
    {
      "id": "llamacpp-server",
      "url": "https://raw.githubusercontent.com/ggml-org/llama.cpp/master/tools/server/README.md",
      "retrieved_at": "2026-11-25T09:52:45.997121+00:00"
    },
    {
      "id": "vllm-troubleshooting",
      "url": "https://raw.githubusercontent.com/vllm-project/vllm/main/docs/usage/troubleshooting.md",
      "retrieved_at": "2026-11-25T09:52:45.997121+00:00"
    },
    {
      "id": "transformers-kv-cache",
      "url": "https://raw.githubusercontent.com/huggingface/transformers/main/docs/source/en/kv_cache.md",
      "retrieved_at": "2026-11-25T10:07:29.175278+00:00"
    }
  ],
  "revision_note": "完善阅读结构；非硬件实测。",
  "representations": {
    "html": "https://gpuatlas.top/articles/T-2804520d5d9d/",
    "json": "https://gpuatlas.top/data/articles/T-2804520d5d9d.json",
    "markdown": "https://gpuatlas.top/data/articles/T-2804520d5d9d.md"
  }
}
