-
Notifications
You must be signed in to change notification settings - Fork 125
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
[NDTensors] [BUG] Many basic tensor operations fail with CUDA extension due to LoadError: Scalar indexing is disallowed.
#1193
Comments
Thanks for the report. @kmp5VT could you take a look? |
Hello! I am testing out the updated NDTensor CUDA extension. I am using ITensors.jl MWE - Trying to truncate after a direct sum of two MPS using CUDA, ITensors
function main()
gpu = cu
d = 2
N = 5
n = d^N
x = LinRange(1, 2, n)
f = x .^ 2
g = sin.(x)
s = siteinds(d, N)
fmps = gpu(MPS(f, s))
gmps = gpu(MPS(g, s))
hmps = gpu(MPS(zeros(n), s))
hmps .= add(fmps, gmps; alg="directsum")
truncate!(hmps; cutoff=1E-8)
end
main() |
@NuclearPowerNerd could you double check to make sure you are using the latest version? The error you quoted in the first post should have been fixed by #1194. |
@mtfishman I think there still might be an issue here, specifically in the |
Yes. I double checked and I have ITensors |
Thanks for confirming. Some of my confusion was that this appears to be specific to the CUDA.jl backend, I was running the code you shared using our Metal.jl backend and wasn't seeing any issues. We are investigating this, it looks like it is an easy fix though we might make some more involved changes to make it easier for us to fix issues that are particular to certain GPU backends in the future so will take a bit of time. |
This will be fixed by #1220. |
I can create a new issue if needed - please just let me know. I am still getting this error any time I try to use the |
Could you start a new issue reporting a particular problem with a minimal code example as well as the full error message/stack trace? Also be sure to test against the latest versions of |
Description of bug
I am attempting to use the CUDA extension for NDTensors. I am finding that tensor contraction sometimes fails, along with other functions like
permute
, as well as theNDTensors.generic_randn
call used in the example of the NDTensors CUDA extension (NDTensors/ext/examples/NDTensorCUDA.jl
).They all fail with
ERROR: LoadError: Scalar indexing is disallowed.
(or emit a similar warning in the REPL where scalar indexing is allowed).Minimal code demonstrating the bug or unexpected behavior
Minimal runnable code
Expected output or behavior
NDTensors.cu()
should work without warning in REPL onITensors.ITensor
, andITensors.permute
should work without the scalar indexing error.Actual output or behavior
Output of minimal runnable code
Output of `cuA, cuB = NDTensors.cu(A), NDTensors.cu(B)` in REPL
Also, running `NDTensors/ext/examples/NDTensorCUDA.jl` results in a similar error
Version information
versioninfo()
:Other relevant version info
I am very new to Julia (and ITensors.jl), sorry if there is something obvious I'm missing!
The text was updated successfully, but these errors were encountered: