-
Notifications
You must be signed in to change notification settings - Fork 8
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
Adjusting example 3 to a GPU backend #21
Comments
Do you get the same error when running the calculation on CPU ie not using CUDA? I ask because the error message seems more related to SciML parameters than the presence of the CuArray though I could be wrong. |
Hi, thanks for the quick response. No, with a CPU backend (the first code snippet), the integrator works and produces the correct answers (compared with ED). The output is:
|
Interesting, thanks for the report. Maybe worth looking at https://github.com/SciML/DiffEqGPU.jl?tab=readme-ov-file#example-of-within-method-gpu-parallelism. The only difference I see in that example from our example is that we aren't defining an in-place version of the solver time stepping function: https://github.com/ITensor/ITensorMPS.jl/blob/v0.2.3/examples/03_updaters.jl#L11-L14, or there is something more subtle about how we are calling the ODE solver that I am missing. |
Also note that if you are using GPU, probably you want to use single precision (i.e. elt = Float32
ω₁ = one(elt) / 10
tol = 10 * eps(elt) but of course feel free to handle that however you prefer. |
I see the issue, this line here is too restrictive: https://github.com/ITensor/ITensorMPS.jl/blob/v0.2.3/examples/03_updaters.jl#L12 and should allow any |
This is being fixed in #22. |
Thanks a lot! It works also on my PC over a GPU backend. |
Dear Matt,
I tried using Nvidia's GPU backend for ITensorMPS TDVP calculations, but encountered an issue with the data types being passed to the ODE solver.
The problem is described below using code snippets.
Do you have a quick fix in mind for this issue?
Thanks,
Yotam
Consider, for example, the code in:
https://github.com/ITensor/ITensorMPS.jl/tree/main/examples/03_tdvp_time_dependent.jl'
I changed it a bit so it would run with my current versions:
"ITensors v0.3.68"
"ITensorMPS v0.2.1"
The following code runs:
But, when I pass psi and H as cuMPS and cuMPO, i.e.:
I get the following error:
The text was updated successfully, but these errors were encountered: