Skip to content

Commit

Permalink
Merge pull request #547 from pentschev/fix-debug-tests
Browse files Browse the repository at this point in the history
Fix debug tests and remove duplicate functions
  • Loading branch information
jakirkham authored Jun 16, 2020
2 parents 391403a + 47e9977 commit bac9f1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
15 changes: 2 additions & 13 deletions debug-tests/debug_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
import cupy
import rmm

ITERATIONS = 100

from .utils import get_num_gpus

def cuda_array(size):
return rmm.DeviceBuffer(size=size)
ITERATIONS = 100


def set_rmm():
Expand Down Expand Up @@ -41,15 +39,6 @@ def parse_args(args=None):
return parser.parse_args()


def get_num_gpus():
import pynvml

pynvml.nvmlInit()
ngpus = pynvml.nvmlDeviceGetCount()
pynvml.nvmlShutdown()
return ngpus


def get_cuda_devices():
if "CUDA_VISIBLE_DEVICES" in os.environ:
return os.environ["CUDA_VISIBLE_DEVICES"].split(",")
Expand Down
3 changes: 2 additions & 1 deletion debug-tests/recv.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import pynvml
import pytest
import ucp
from utils import ITERATIONS, recv, send, set_rmm
from debug_utils import ITERATIONS, set_rmm
from utils import recv, send

pynvml.nvmlInit()

Expand Down
3 changes: 2 additions & 1 deletion debug-tests/send.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import cloudpickle
import pytest
import ucp
from utils import ITERATIONS, recv, send, set_rmm
from debug_utils import ITERATIONS, set_rmm
from utils import recv, send

cmd = "nvidia-smi nvlink --setcontrol 0bz" # Get output in bytes
# subprocess.check_call(cmd, shell=True)
Expand Down

0 comments on commit bac9f1c

Please sign in to comment.