Skip to content

Commit 1f6595d

Browse files
authored
[skyrl-train] Make libnuma optional for training (#601)
# What does this PR do? Makes `libnuma` optional for training Signed-off-by: SumanthRH <sumanthrh99@gmail.com>
1 parent 8bf809e commit 1f6595d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

skyrl-train/skyrl_train/workers/worker.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,13 @@ class bitmask_t(Structure):
155155
("maskp", POINTER(c_ulong)),
156156
]
157157

158-
LIBNUMA = CDLL(find_library("numa"))
158+
try:
159+
LIBNUMA = CDLL(find_library("numa"))
160+
except Exception as e:
161+
logger.error(f"Skipping NUMA affinity setup because libnuma is not installed: {e}")
162+
_SET_AFFINITY = True
163+
return
164+
159165
LIBNUMA.numa_parse_nodestring.argtypes = [c_char_p]
160166
LIBNUMA.numa_parse_nodestring.restype = POINTER(bitmask_t)
161167
LIBNUMA.numa_run_on_node_mask.argtypes = [POINTER(bitmask_t)]

0 commit comments

Comments
 (0)