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

[BUG] CUDA Performance Warning #526

Open
johnzl-777 opened this issue Feb 3, 2023 · 0 comments
Open

[BUG] CUDA Performance Warning #526

johnzl-777 opened this issue Feb 3, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@johnzl-777
Copy link
Collaborator

johnzl-777 commented Feb 3, 2023

Describe the bug
When trying to initialize the integrator for a SchrodingerProblem put on the GPU via the adapt function, the following warning is issued:

 Warning: Performing scalar indexing on task Task (runnable) @0x00007fa59fb54010.
│ Invocation of getindex resulted in scalar indexing of a GPU array.
│ This is typically caused by calling an iterating implementation of a method.
│ Such implementations *do not* execute on the GPU, but very slowly on the CPU,
│ and therefore are only permitted from the REPL for prototyping purposes.
│ If you did intend to index this array, annotate the caller with @allowscalar.
└ @ GPUArraysCore ~/.julia/packages/GPUArraysCore/B3xv7/src/GPUArraysCore.jl:103

Calling CUDA.allowscalar(false) and repeating the operation produces a stack trace that highlights some issue over matrix-vector multiplication in LinearAlgebra.

To Reproduce

using Bloqade
using Adapt, CUDA

nsites = 10;
atoms = generate_sites(ChainLattice(), nsites, scale = 5.74)
h = rydberg_h(atoms; Ω = 4 * 2π, Δ = 0)
reg = zero_state(10)
prob = SchrodingerProblem(reg, 1.6, h)
gpu_prob = adapt(CuArray, SchrodingerProblem(reg, 1.6, h))

# where the warning pops up
integrator = init(gpu_prob, Vern8())

cc: @Roger-luo

@johnzl-777 johnzl-777 added the bug Something isn't working label Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant