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

Support for current dev version of qutip #45

Open
rkevk opened this issue Feb 7, 2023 · 5 comments
Open

Support for current dev version of qutip #45

rkevk opened this issue Feb 7, 2023 · 5 comments

Comments

@rkevk
Copy link

rkevk commented Feb 7, 2023

I'm considering toying around with this and installing it on our GPU server for our group to use, but it seems that the last version of qutip-cupy is incompatible with the latest version of qutip:
Given

$ pip freeze | grep qutip
qutip @ git+https://github.com/qutip/qutip.git@f013a4f441de5f5f8d40adf57cfe73b183d62477
qutip-cupy @ git+https://github.com/qutip/qutip-cupy.git@320efa80992e8b051a02ebdb2da0151714eb8b24

I get the following error:

>>> import qutip_cupy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/kevin/.local/lib/python3.8/site-packages/qutip_cupy/__init__.py", line 83, in <module>
    data.inv.add_specialisations([(CuPyDense, linalg.inv_cupydense)])
  File "qutip/core/data/dispatch.pyx", line 471, in qutip.core.data.dispatch.Dispatcher.add_specialisations
ValueError: specialisation (<class 'qutip_cupy.dense.CuPyDense'>, <function inv_cupydense at 0x7f414e458f70>) has wrong number of parameters: needed types for ('data',), an output type and a callable

I suppose qutip's API has changed sometime in the last two years and that made it incompatible with this backend. If this project is still alive, could someone take a look at relevant sections and fix what's needed to get it to run? I myself am not familiar with qutip or its inner workings, so I would have to catch up on a lot first to solve it myself...

@hodgestar @leofang in case either of you still consider yourself active in this project :)

@leofang
Copy link
Contributor

leofang commented Feb 7, 2023

Sorry, I am no longer active 😅 I guess there exists a combination of compatible versions of QuTiP and this plugin for things to work, @hodgestar should know better than I do.

@hodgestar
Copy link
Contributor

@rkevk Hello! I'm still active, but currently have quite a lot of other QuTiP work while we're in the QuTiP v5 alpha stage.

Yes, as you correctly deduced there have been some changes in QuTiP v5 since qutip-cupy was last updated. For this particular error, I think one only needs to change that line to:

data.inv.add_specialisations([(CuPyDense, CuPyDense, linalg.inv_cupydense)])

If you're up for creating a PR for that, I would be very grateful. The main blocker on my side is getting access to a machine with GPU support (or fixing the AWS GPU test runners).

@dstrbad
Copy link

dstrbad commented Mar 30, 2023

Hi @hodgestar and @rkevk is it okay if I test this on GPU and do the PR?

@hodgestar can I maybe also assist with fixing AWS GPU test runners?

Thanks

@hodgestar
Copy link
Contributor

@dstrbad That would be wonderful, thank you!

@dstrbad
Copy link

dstrbad commented Mar 30, 2023

@hodgestar pull request done, let me know if there's something else I should do in regards to this issue.

Pull requests introduces 2 changes:

  1. locked version of packaging (<=21.3.) due to te deprecation of LegacyVersion attribute used in qutip-cupy in newer versions of packaging library
  2. change to support QuTiPv5

Test was conducted on AWS GPU instance and basic check looks good but due to dated packages and qutip-cupy there is possibility for other issues to exist.

Will try to get AWS GPU test runners back online to see status of tests.

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

4 participants