NVIDIA-Merlin / core

Core Utilities for NVIDIA Merlin
Apache License 2.0
19 stars 14 forks source link

use HAS_GPU to determine of cuda is available #364

Open jperez999 opened 8 months ago

jperez999 commented 8 months ago

This PR changes how we determine if cuda is available on the system. We move from numba to using HAS_GPU which uses nvml device count. If there are no devices, then cuda is not available. Otherwise cuda is available.

copy-pr-bot[bot] commented 8 months ago

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

github-actions[bot] commented 8 months ago

Documentation preview

https://nvidia-merlin.github.io/core/review/pr-364

pentschev commented 8 months ago

Although this is tripping that block, I would suggest always using PyNVML to query GPU information, specifically what I mention in https://github.com/NVIDIA-Merlin/core/issues/363#issuecomment-1888595036 can be dangerous with Dask if for some reason the cuda = None is removed in the future.

jperez999 commented 8 months ago

This is not ready, the failures during writing have to do with when you are writing a file with a client available. Will continue investigating.

jperez999 commented 8 months ago

Investigated seems that the logic for int_slice_size was not full proof. Because of the floor divide you can find yourself in a scenario where you have less records in the df than the int_slice_size and that can result in a zero. Then when you go to mod on zero the thread raises an exception. I do wonder how we hit this now and not before.

jperez999 commented 8 months ago

/ok to test

rjzamora commented 8 months ago

I do wonder how we hit this now and not before.

I agree that this is strange - I wonder if I was wrong about pynvml_mem_size be "the same".

jperez999 commented 8 months ago

/ok to test

jperez999 commented 8 months ago

/ok to test