-
-
Notifications
You must be signed in to change notification settings - Fork 899
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add P2P env when multi-gpu but not the full node (#2041)
Co-authored-by: Wing Lian <[email protected]>
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
""" | ||
utils to get GPU info for the current environment | ||
""" | ||
from accelerate.utils.environment import ( | ||
check_cuda_p2p_ib_support as accelerate_check_cuda_p2p_ib_support, | ||
) | ||
from accelerate.utils.environment import get_gpu_info | ||
|
||
|
||
def check_cuda_p2p_ib_support(): | ||
if not accelerate_check_cuda_p2p_ib_support(): | ||
return False | ||
unsupported_devices = {"RTX 6000 Ada"} | ||
try: | ||
device_names, device_count = get_gpu_info() | ||
if 1 < device_count < 8: | ||
if any( | ||
device_name in unsupported_device | ||
for device_name in device_names | ||
for unsupported_device in unsupported_devices | ||
): | ||
return False | ||
except Exception: # pylint: disable=broad-except # nosec | ||
pass | ||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters