feat(vllm): Tackle out of memory errors (EAI-8058) - #251
Conversation
6190726 to
ee202f0
Compare
|
A few observations from a read of this change:
On the stack: #284's diff against this branch removes the sysfs fallback, its tests and the docs bullet — looks unintended. |
…e documentation Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
…back Address review feedback on PR #251: - resolve_gpu_indices now validates an explicit --gpu <index> against the DRM sysfs fallback's device count when amd-smi is unavailable, instead of only the amd-smi count. Previously an out-of-range index was silently accepted on a host with no amd-smi (sysfs works) and only failed later inside the engine. - read_drm_vram_usage no longer treats an unreadable mem_info_vram_used counter as 0 bytes used (which made the card look 100% free -- exactly what --gpu auto prefers first); it now skips that card instead. - read_drm_vram_usage withholds telemetry entirely when more than one AMD DRM card is present, since ascending card<N> order is only guaranteed to match HIP's compute-topology ordinal on a single-GPU host (an APU passes the same vendor + mem_info_vram_total filter as a discrete GPU, so an APU+dGPU host could previously feed a diverged ordinal into HIP_VISIBLE_DEVICES). - docs/vllm.md: corrected the fallback description, which only ever probes amd-smi (never rocm-smi) before falling back to DRM sysfs. Extracted the count-fallback logic into a new effective_gpu_count helper shared by --gpu auto ranking and --gpu <index> validation, and added unit tests for all of the above. Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
ee202f0 to
a97a39f
Compare
|
Thanks for the detailed review — pushed a fix commit (a97a39f) addressing the concrete bugs:
Added unit tests for all four ( On the Gherkin scenario: I didn't add one for the "no On #284: worth double-checking before merging that stack — its diff against this branch appears to drop the sysfs fallback, its tests, and the docs bullet, which does look unintended given this PR is what introduces them. |
This pull request improves GPU selection and user guidance for ROCm and vLLM, especially in shared or containerized environments where the standard
amd-smitool may not be available. It adds a fallback for GPU VRAM telemetry, enhances user warnings and hints for out-of-memory (OOM) conditions, and ensures consistent messaging across CLI and engine surfaces. The changes also include comprehensive tests for the new logic.GPU selection and VRAM telemetry improvements:
/sys/class/drm/card*/device/mem_info_vram_{total,used}) whenamd-smiis not available, so--gpu autoand low-VRAM warnings work reliably in stripped-down containers and shared nodes. The device count for selection now also derives from these sysfs rows ifamd-smiis missing. [1] [2] [3] [4]User guidance and warnings for vLLM:
VLLM_GPU_MEMORY_UTILIZATION_HINTfor the recommended workaround when running out of memory on a shared/busy GPU, ensuring CLI and engine logs use consistent wording.--gpu-memory-utilizationworkaround when vLLM is selected and the GPU is busy, both interactively and in the deployment summary. [1] [2] [3] [4] [5]Documentation:
docs/vllm.mdto explain the behavior on shared/busy GPUs, the fallback telemetry, and the recommended OOM workaround.These improvements make GPU selection more robust in diverse environments and provide clear, actionable guidance to users encountering memory issues with vLLM.