Skip to content

Commit 317f18c

Browse files
committed
fix check CUDA_DEVICE_MAX_CONNECTIONS
1 parent 4a6b453 commit 317f18c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internlm/utils/common.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,9 @@ def enable_pytorch_expandable_segments():
250250

251251

252252
def check_cuda_env():
253-
if os.getenv("CUDA_DEVICE_MAX_CONNECTIONS") is None:
254-
logger.warning("Env var CUDA_DEVICE_MAX_CONNECTIONS has not be set, please note this!")
253+
max_connections = os.getenv("CUDA_DEVICE_MAX_CONNECTIONS")
254+
assert max_connections is not None, "Env var CUDA_DEVICE_MAX_CONNECTIONS has not been set, please set it to 1!"
255+
assert max_connections == '1', "Env var CUDA_DEVICE_MAX_CONNECTIONS is set to {}, but it should be set to 1!".format(max_connections)
255256

256257

257258
class DummyProfile:

0 commit comments

Comments
 (0)