LesenForschungRadarAnlageframework
Anmelden / Registrieren
← Zurück zur Lektüre
ThemaDisconfirmAI RedaktionAktualisiert 2026-11-02 09:11

vLLM多实例显存竞态

5 Schritte1 Beiträge4 Quellen

vLLM在同一GPU上并发启动多个推理实例时存在显存分配竞态:每个实例将其他进程正在加载的模型权重误判为自身的非Torch开销,导致KV缓存被严重压缩甚至计算为负值而启动失败。Cisco DevNet平台工程团队在NVIDIA A10G上部署三个vLLM实例时复现了该问题,指出仅设置--kv-cache-memory固定缓存大小不足以规避,必须同时降低--gpu-memory-utilization目标值,否则后续实例仍会因启动检查失败而无法上线。GitHub issue #55827确认根因在于Worker.determine_available_memory使用整卡空闲内存差值推算非Torch占用,任何在初始快照与性能分析之间由其他进程完成的分配都会被错误计入本实例;#35920补充了统一内存架构(Jetson、DGX Spark等)下OS页缓存进一步放大误判的情形。目前官方尚未合并修复PR,用户需依赖显式字节预算或串行启动作为临时手段。

Wie es dazu kam

  1. 2024-11-25

    GitHub用户brokenlander在issue #10643中首次公开报告:在NVIDIA GH200上以Docker容器并行运行两个vLLM实例(Llama-3.1-8B与Qwen2.5-7B,各设gpu-memory-utilization 0.3),第二个实例的non_torch_memory被高估至28.43 GiB,kv_cache_size算出−15.61 GiB并报错"No available memory for the cache blocks"。该issue次日被关闭为not planned。

    github.com ↗
  2. 2025-05-04

    用户wehos在#10643评论中定位到vllm/v1/worker/gpu_worker.py第202–211行:total_allocated_bytes取自torch.cuda.mem_get_info()的全卡已用量减去当前torch分配量,因此包含了同卡其他vLLM实例的权重占用,导致available_kv_cache_memory异常偏低或为负。

    github.com ↗
  3. 2026-03-03

    EmilHaase提交issue #35920,描述统一内存架构(Jetson Orin、DGX Spark等共享系统RAM与VRAM的设备)上的变体:Linux内核将.safetensors文件缓存进系统RAM造成全局可用内存骤降,vLLM将其误归为非Torch开销;并发启动三个<10B模型时互相蚕食快照,KV缓存可算出负字节或直接AssertionError崩溃。该issue于2026-07-28被标记stale后关闭为not planned。

    github.com ↗
  4. 2026-09-08

    twu3202提交issue #55827,在RTX 5090 32 GB(driver 595.80, vLLM main @144e79c / 0.28.1rc1.dev452)及RTX 6000 Ada 48 GB上复现:顺序启动Qwen3-ASR-1.7B(util 0.35)与Qwen3-ForcedAligner-0.6B(util 0.20)分别获得4.72 GiB和2.82 GiB KV缓存;同时启动则ASR降至1.84 GiB、aligner算出−3.21 GiB并报ValueError。提出改用torch.cuda.memory_reserved()加NVML per-process usedGpuMemory替代全卡差值的修复建议,状态Open。

Anmelden / Registrieren
LesenForschungRadarAnlageframework
github.com ↗
  • 2026-11-01

    Cisco DevNet平台工程团队发布博客,说明其Antares GPU学习实验室在AWS g5.2xlarge(单张NVIDIA A10G约23 GiB VRAM)上通过时间片切分承载多个vLLM推理实例时遭遇同一竞态,并给出实践结论:仅用--kv-cache-memory固定缓存大小不够,还必须同步下调--gpu-memory-utilization,否则后续实例启动检查失败无法上线。

    blogs.cisco.com ↗
  • Was noch ungeklärt ist

    • vLLM维护者是否接受#55827提出的NVML per-process + torch.cuda.memory_reserved()混合测量方案,还是继续要求用户显式指定--kv-cache-memory-bytes?
    • #35920(UMA页缓存误归因)与#55827(离散GPU全卡差值误归因)是否会合并为一个统一修复,还是各自独立处理?
    • Cisco DevNet博客所述'两个标志缺一不可'的具体参数组合(--kv-cache-memory数值与--gpu-memory-utilization阈值)是否在公开文档中有可复制的配置示例?

    Quellen

    • blogs.cisco.comCisco Blogs – Antares GPU Learning Labs (DevNet)↗
    • github.comGitHub vllm-project/vllm Issue #55827↗
    • github.comGitHub vllm-project/vllm Issue #35920↗
    • github.comGitHub vllm-project/vllm Issue #10643↗

    Abdeckung in diesem Thema

    • Startup Memory Race Condition in vLLM Multi-Instance GPU Sharing: Cisco DevNet Engineers Explain Why Two Flags Are Indispensable2026-11-01News

      The Cisco DevNet platform engineering team encountered a concurrent startup memory race condition when deploying three vLLM inference instances on a single NVIDIA A10G GPU. They explain how vLLM's default mechanism of allocating KV cache based on visible free memory at startup leads to overselling among multiple instances, and why using only the --kv-cache-memory flag to fix the cache size is insufficient—lowering the --gpu-memory-utilization target is also required, otherwise subsequent instances will fail to come online due to startup check failures.