{"record":{"id":"267cced5dc7a4805","repo":"vllm-project/vllm","slug":"sleep-mode-allocator-is-not-available-on-platform","errorCode":null,"errorMessage":"Sleep mode allocator is not available on platform {type(current_platform).__name__} (device_type={current_platform.device_type}).","messagePattern":"Sleep mode allocator is not available on platform (.+?) \\(device_type=(.+?)\\)\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"vllm/device_allocator/__init__.py","lineNumber":46,"sourceCode":"    def sleep(self, offload_tags: tuple[str, ...] | str | None = None) -> None: ...\n\n    def wake_up(self, tags: list[str] | None = None) -> None: ...\n\n    def get_current_usage(self) -> int: ...\n\n\ndef get_mem_allocator_instance() -> MemAllocator:\n    if current_platform.is_cuda_alike():\n        from vllm.device_allocator.cumem import CuMemAllocator\n\n        return CuMemAllocator.get_instance()\n\n    if current_platform.is_xpu():\n        from vllm.device_allocator.xpumem import XpuMemAllocator\n\n        return XpuMemAllocator.get_instance()\n\n    raise RuntimeError(\n        \"Sleep mode allocator is not available on platform \"\n        f\"{type(current_platform).__name__} \"\n        f\"(device_type={current_platform.device_type}).\"\n    )\n","sourceCodeStart":28,"sourceCodeEnd":51,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/device_allocator/__init__.py#L28-L51","documentation":"Raised by vllm.device_allocator.get_mem_allocator_instance when sleep mode (--sleep-mode) requests a memory allocator on a platform that is neither CUDA-like nor XPU. The CuMemAllocator and XpuMemAllocator are the only implementations, so any other platform (CPU, ROCm without cuda-alike semantics, etc.) fails at allocator creation.","triggerScenarios":"Starting vLLM with sleep mode enabled (e.g. --sleep-mode flush_discard_kvs / level 1+) on a machine whose current_platform is not cuda-alike and not XPU.","commonSituations":"Testing sleep mode on a CPU-only dev box or an unsupported accelerator; running a container where the platform plugin resolved to something unexpected.","solutions":["Disable sleep mode (remove --sleep-mode) on this platform.","If you expect CUDA or XPU, verify the correct platform plugin/GPU stack is installed (drivers, torch build) so current_platform resolves properly.","Check whether a platform-specific allocator exists in your vLLM version before attempting sleep mode there."],"exampleFix":"# before\nvllm serve model --sleep-mode ...  # on a CPU-only host\n# after\nvllm serve model  # sleep mode unsupported here; omit it","handlingStrategy":"type-guard","validationCode":"from vllm.platforms import current_platform\n\nif not (current_platform.is_cuda_alike() or current_platform.is_xpu()):\n    if sleep_mode_enabled(args):\n        raise SystemExit(\"sleep mode requires CUDA-like or XPU platform\")","typeGuard":"def sleep_mode_supported() -> bool:\n    from vllm.platforms import current_platform\n    return current_platform.is_cuda_alike() or current_platform.is_xpu()","tryCatchPattern":"try:\n    allocator = get_mem_allocator_instance()\nexcept RuntimeError as e:\n    if \"Sleep mode allocator\" in str(e):\n        disable_sleep_mode_and_relaunch()\n    raise","preventionTips":["Gate --sleep-mode flags on a platform capability check in deployment templates.","Run smoke tests of sleep mode on the target image before rolling it out."],"tags":["vllm","sleep-mode","platform","allocator","cuda","xpu"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}