Skip to content

Commit 61617d0

Browse files
committed
Replace platform.system() for consistency
Use sys.platform instead throughout the file. Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
1 parent e8cf91f commit 61617d0

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

vllm/utils/cpu_resource_utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import json
55
import os
6-
import platform
76
import subprocess
87
import sys
98
from dataclasses import dataclass
@@ -79,7 +78,7 @@ def parse_id_list(raw_str: str) -> list[int]:
7978

8079

8180
def get_memory_node_info(node_id: int = 0) -> MemoryNodeInfo:
82-
if platform.system() == "Darwin":
81+
if sys.platform == "darwin":
8382
# MacOS has no memory node
8483
return MemoryNodeInfo(
8584
total_memory=psutil.virtual_memory().total,
@@ -130,7 +129,7 @@ def get_allowed_cpu_list() -> list[LogicalCPUInfo]:
130129

131130

132131
def get_visible_memory_node() -> list[int]:
133-
if platform.system() == "Darwin":
132+
if sys.platform == "darwin":
134133
return [0]
135134

136135
allowed_memory_node_list = get_memory_affinity()
@@ -161,7 +160,7 @@ def _synthesize_cpu_list() -> list[LogicalCPUInfo]:
161160

162161

163162
def _get_cpu_list() -> list[LogicalCPUInfo]:
164-
if platform.system() == "Darwin":
163+
if sys.platform == "darwin":
165164
# For MacOS, no user-level CPU affinity and SMT, return all CPUs
166165
return _synthesize_cpu_list()
167166

0 commit comments

Comments
 (0)