{
  "schema_version": "1.0",
  "id": "T-82e87f572bef",
  "url": "https://gpuatlas.top/articles/T-82e87f572bef/",
  "title": "24G 显存跑本地模型，怎么给长上下文留空间？",
  "summary": "24G长文需给量化元数据与执行留余量，Qwen3 32B条件算例显示32K缓存可能接近预算。",
  "language": "zh-Hans",
  "category": {
    "id": "c-11",
    "name": "按显存找方案",
    "url": "https://gpuatlas.top/categories/c-11/"
  },
  "topics": [],
  "body_text": "24G显存读长文，先按真实任务长度分开预算权重、缓存和缓冲。其他程序与框架预留也会占空间，文件大小不能直接等同GPU驻留，更不能从24这个标称值简单相减。\n\n以Qwen3 32B为条件例子，实际约32.8B参数，理想4bit原始数据约16.4GB，即约15.27GiB。64层结构下，常规单序列16bit KV在8192 token约2GiB、32768约8GiB，元数据和执行开销未计。\n\n假设可用预算恰为24GiB，仅理想权重与32K缓存就约23.27GiB。这个筛选算例说明加载成功不代表长文通过，不是硬件测量，也不能套给其他32B结构。真实低位文件还可能包含未量化部分。\n\n固定文件和单请求，从较短材料逐档增加，模板、历史、思考与答案一起统计。分别观察输入和生成峰值，需要调整时逐项比较受支持的权重或缓存策略，缩短输出不一定解决输入阶段压力。\n\n对这套Qwen3 32B方案，可让模型回答长材料前、中、后的已知事实并给出依据，检查遗漏和完整性，同时保存实际token与完整等待。若32K附近失败，就保留原材料与缓存设置，先查输入峰值和实际驻留；缩短后通过只说明新长度可用，不能代替原任务。",
  "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": "qwen3-32b",
      "url": "https://huggingface.co/Qwen/Qwen3-32B/raw/main/README.md",
      "retrieved_at": "2026-11-25T10:43:11.065868+00:00"
    },
    {
      "id": "qwen3-32b-config",
      "url": "https://huggingface.co/Qwen/Qwen3-32B/resolve/main/config.json",
      "retrieved_at": "2026-11-25T10:43:11.065868+00:00"
    },
    {
      "id": "vllm-memory",
      "url": "https://raw.githubusercontent.com/vllm-project/vllm/main/docs/configuration/conserving_memory.md",
      "retrieved_at": "2026-11-25T09:52:45.997121+00:00"
    }
  ],
  "revision_note": "完善阅读结构；非硬件实测。",
  "representations": {
    "html": "https://gpuatlas.top/articles/T-82e87f572bef/",
    "json": "https://gpuatlas.top/data/articles/T-82e87f572bef.json",
    "markdown": "https://gpuatlas.top/data/articles/T-82e87f572bef.md"
  }
}
