SystemsGenetics / KINC

Knowledge Independent Network Construction
MIT License
11 stars 4 forks source link

Documentation unclear on how KINC makes use of GPU #151

Closed JohnHadish closed 4 years ago

JohnHadish commented 4 years ago

The documentation introduction to GPU useage currently looks like this: """ Since KINC can be run with a variety of hardware configurations, including single-CPU, multi-CPU, single-GPU, and multi-GPU, there are several settings that control how KINC uses this hardware. In particular, the multi-GPU configuration for similarity is the most complex and uses all of the execution parameters. Here we describe each execution parameter and provide recommendations based on performance benchmarking and experience. """ The first sentence inplies that there are settings for designating a "single-CPU", "multi-CPU", "single-GPU" or "multi-GPU", but then says nothing else about these configurations. This implies that a user must set these settings.

It needs to be made very clear how a user can change what resources are going to be used by KINC. It is currently not clear how to designate what hardware is being used. It needs to be made very clear to the user if their GPU is being used by KINC.

JohnHadish commented 4 years ago

Reason for this request: I ran the new KINC examples on my local machine and it was unclear to me if my GPU was being used or not. It required some digging to see if it actually was being used. Users appreciate knowing what is going on behind the sceen, even if it is just a high level message like GPU detected and in use

bentsherman commented 4 years ago

@JohnHadish The conventional way we confirm GPU usage is by running something like watch nvidia-smi in a separate terminal. However I agree it would be nice for KINC to say explicitly what it is using. For similarity, you could add print statements to the initialize methods of the Serial, CUDA, and OpenCL classes saying something like "using CPU" or "using GPU via CUDA".

The tricky thing here is that when you run KINC with MPI, each MPI rank is free to use serial / cuda / opencl independently of the others, so if you ran KINC with np=16 you would get 15 different messages of each worker telling you which implementation they are using.

spficklin commented 4 years ago

The most recent documentation clarifies the issue raised by @JohnHadish . See here: https://kinc.readthedocs.io/en/latest/usage.html#gpu-performance-considerations.

@JohnHadish if this isn't quite right, please reopen.