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

Benchmarking time with CPU/GPU solvers for comparison #63

Open
naezzell opened this issue Dec 8, 2020 · 1 comment
Open

Benchmarking time with CPU/GPU solvers for comparison #63

naezzell opened this issue Dec 8, 2020 · 1 comment
Assignees
Labels
GPU issues related to GPU acceleration support

Comments

@naezzell
Copy link
Member

naezzell commented Dec 8, 2020

We've added a GPU solver

function solve_schrodinger_gpu(A::Annealing, tf::Real; tspan = (0, tf), kwargs...)
u0 = cu(build_u0(A.u0, :v))
p = ODEParams(A.H, float(tf), A.annealing_parameter)
update_func = function (C, u, p, t)
update_cache!(C, p.L, p, p(t))
end
cache = cu(get_cache(A.H))
diff_op = DiffEqArrayOperator(cache, update_func = update_func)
jac_cache = cu(similar(cache))
jac_op = DiffEqArrayOperator(jac_cache, update_func = update_func)
ff = ODEFunction(diff_op, jac_prototype = jac_op)
prob = ODEProblem{true}(ff, u0, Float32.(tspan), p)
solve(prob; alg_hints = [:nonstiff], kwargs...)
end

which will get integrated better soon. We've shown informally that for n = 10 qubits and tf = 10ns anneal, the GPU version takes around 1 second and the CPU version 8 seconds. We'd like to get more systematic benchmarking/ run data on these to show when you get and improvement and by how much.

The informal timing was done with the following test code:
https://github.com/naezzell/accelqat/blob/b617c423daaa4cb0ab2f4c1a4d8f2536fb9f7bb3/cuda/try_gpu_accel.jl#L1-L66
with 2 CPUs and 1 GPU on USC Discovery cluster.

@naezzell naezzell added the GPU issues related to GPU acceleration support label Dec 8, 2020
@SuperElephant
Copy link
Collaborator

SuperElephant commented Dec 9, 2020

For the GPU accelerated solver we have done a preliminary benchmarking for comparision. It shows advantage when init Hamiltonian is big enough.
The test code can be find here naezzell/accelqat/cuda/scaling_test.jl.
The test result and relevent CPU information can be find here naezzell/accelqat/cuda/scaling_test_result/ (with one NVIDIA Tesla K40 GPU)

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GPU issues related to GPU acceleration support
Projects
None yet
Development

No branches or pull requests

4 participants