Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions python/cuml/cuml/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,11 @@ def _get_gpu_memory():
if len(tokens) > 1:
gpus_memory.append(int(tokens[0]))
gpus_memory.sort()
max_gpu_memory = ceil(gpus_memory[-1] / 1024)
return max_gpu_memory
if len(gpus_memory) > 0:
max_gpu_memory = ceil(gpus_memory[-1] / 1024)
return max_gpu_memory
else:
return None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think returning None here is a good idea, because it would lead to TypeErrors in many of our (stress) tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you recommend? Would returning 0 be a good solution?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only place we use this function is to set pytest.max_gpu_memory. That variable is implicitly expected to be a nonzero integer number wherever it is used.

I think using None is ok to indicate "unknown", but then we need to make sure to test for that wherever pytest.max_gpu_memory is used.



# =============================================================================
Expand Down