Skip to content

Commit

Permalink
Fix ray peristently setting OMP_NUM_THREADS=1 (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
dongreenberg committed Apr 12, 2024
1 parent 6f0a246 commit 6c51e62
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion runhouse/servers/obj_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ def __init__(self):
# TODO this had no effect when we did it below where we set CUDA_VISIBLE_DEVICES, so we may need to move that
# here and mirror the same behavior (setting it based on the detected gpus in the whole cluster may not work
# for multinode, but popping it may also break things, it needs to be tested).
num_threads = os.environ.pop("OMP_NUM_THREADS", None)
num_threads = os.environ.get("OMP_NUM_THREADS")
if num_threads is not None and num_threads != "1":
os.environ["OMP_NUM_THREADS"] = num_threads
else:
os.environ["OMP_NUM_THREADS"] = ""

async def ainitialize(
self,
Expand Down

0 comments on commit 6c51e62

Please sign in to comment.