-
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
[BUG] sample
in mps.jl
broken when using CUDA
#92
Comments
Thanks for the report, it looks like we are implicitly constructing some tensors on CPU inside that code. The fix you wrote is reasonable, though it can be made more general (for other GPU backends) using something like |
@kmp5VT could you make a PR? |
Also, I see a lot of places in that code that implicitly use double precision, like https://github.com/ITensor/ITensorMPS.jl/blob/v0.3.1/src/mps.jl#L685 ( |
Hi @mtfishman and @kmp5VT, I created a pull request encorporating the desired changes, which fixes the issue in my workflow (A100 gpu and CUDA.jl). I also tested for normal CPU based MPS. |
The following minimal working example crashes in a
MethodError: no method matching DenseVector{Float64}(::UndefInitializer, ::Tuple{Int64})
in ITensorMPS version 0.3.1:The error can be mitigated by copying the MPS to the cpu first, or by adopting the
sample
function in the following way:I suppose that there is a more performant fix, since the above implementation is rather slow.
The text was updated successfully, but these errors were encountered: