Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison with other Python NVML bindings #2

Open
jakirkham opened this issue Mar 23, 2019 · 9 comments
Open

Comparison with other Python NVML bindings #2

jakirkham opened this issue Mar 23, 2019 · 9 comments

Comments

@jakirkham
Copy link
Collaborator

Have noticed there are a few other implementations of Python NVML bindings. It seems worthwhile to compare these to see what they offer and how they differ (particularly from what is here).

@jakirkham
Copy link
Collaborator Author

Copying the authors of these other implementations in case they have thoughts on what was missing in the original package and what could be improved, @lukeyeager @nicolargo @fbcotter @jonsafari.

@fbcotter
Copy link

Not a lot was wrong or missing with the original, for me it was mainly:

  • It was wildly out of date with the current c version of nvml
  • It didn't support python3
  • It looks like it was automatically generated so there was no docstrings or help for any of the underlying functions.

Most of the work I've done on py3nvml has been addressing these issues and adding in some extra utility functions that I've found useful, but could easily be moved to another library.

Keeping up to date with nvml is hard, for example there was another release 5 days ago - 418.56 which already makes py3nvml slightly behind.

@kenhester
Copy link
Contributor

kenhester commented Mar 25, 2019 via email

@fbcotter
Copy link

Hi Ken,

The descriptions and dosctrings were taken from the latest nvml header file https://github.com/NVIDIA/nvidia-settings/blob/master/src/nvml.h. I've just copied them over for each function as a guide.

They are sadly not only in a non-pythonic shape, but incorrect. The python functions return the result and raise exceptions, whereas the docstring implies you need to pass the destination for the result as a parameter and interrogate the return value for errors.

They look like they've been formatted to automatically generate nice documentation on NVIDIA developer zone, I'd hoped to change them a little so that they would work with sphinx and we could get readthedocs style documentation for the functions, but I couldn't see an easy way to do this without painstakingly reformatting them by hand.

@lukeyeager
Copy link

Looks to me like all the other repos listed start with the old "official" python2-compliant bindings from NVIDIA and update them.

In my repo (https://github.com/lukeyeager/pynvml), I started from scratch. I mostly just wanted to show off how cool pybind11 is. The amount of code is super tiny (see here), but the number of supported functions is super low.

@mrocklin
Copy link
Contributor

That's pretty cool. I think it'd be great for a more modern Python binding around nvml to exist.

@lukeyeager do you have any intentions on continuing your work?

Personally as more of an end-user, I'm more excited about seeing functionality built on top of pynvml (like dashboards) than in the underlying wrapping technology. I'm personally inclined to build off of what's here (as archaic as it may be) until something nicer exists. If something nicer did exist (*nudges @lukeyeager) that'd be swell :)

@lukeyeager
Copy link

@mrocklin not right now, no. But you basically only need to go through the nvml header and add the rest of the APIs (IIRC). Have at it, if you like!

@patrikhuber
Copy link

It looks like NVIDIA has also updated their bindings on PyPi nvidia-ml-py to version 10.418.84 in 2019 https://pypi.org/project/nvidia-ml-py/#history. pip install nvidia-ml-py will still give a weird nvidia-ml-py-375.53.tar.gz version that I can nowhere find on PyPi but pip install nvidia-ml-py==10.418.84 does the trick for me. That version looks like it's working with Python 3 too.

I am guessing that this is the best choice to use now?

@jakirkham
Copy link
Collaborator Author

We’ve been updating and using pynvml. It’s used in JupyterLab dashboards and Dask clusters.

Mostly this conversation was spurred out of an interest in figuring out what role this library plays in this space. As well as trying to figure out how best to support the community with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants