LeapHybridSolver timing overhead
I'm using LeapHybridSampler() to solve an optimization problem. In order to compare it with other classical solvers, I use the time.time() function to measure the computation time. However, the computation time of different runs of the same problem solved with LeapHybridSampler() span from 15 to 200 s. Analyzing the memory and CPU usage, it seems to me that the process waits for something. I would like to discern the actual local CPU computation from waiting time, since from the task manager it is not so simple.
Thank you in advance for the clarification,
To get more accurate runtimes for the LeapHybridSampler, please use the timing information as outlined in the documentation:
You can access the timing info from the SampleSet returned from a sample() call like this:
Using the time.time() function can vary quite a bit.
This function will vary with the type of computer you have, what is running on the machine concurrently with your code, the network connectivity in your area, and other such factors.
Since the samplers make calls to the QPU over the network, this can affect the value calculated using time.time().
Hopefully this helps. Please let us know if you have any questions.
Thank you for your quick reply. I already know that it is possible to retrieve that kind of information. However, the computation time obtained using time.time() varies too much. I think it depends on QPU scheduling due to the number of tasks in the queue. Is this intuition correct or not?
Although it is possible for QPU scheduling and number of tasks in the queue to affect the time.time() result, it does not seem likely in this case, but I will inquire further to be certain. I will update as soon as I have more information.
I believe the variation is expected and is just part of the nature of the sampler.
One thing I was curious about is the time range. Is it 15 - 200 s or 15 - 200 ms?
Thank you for your patience and coordination.
It looks like the problems ran a total of 4-11 seconds for problems run on the hybrid solver.
Does this look right?
Yes, it looks like a reasonable time. Maybe, it was a temporary Dwave's problem. However, it is not clear to me how to distinguish computation time (QPU access time and CPU run time) from queuing time, if present.
Unfortunately we do not have a way of explicitly identifying queueing time, however it is possible to take the difference between the run_time in the timing info provided by the sampler and the total runtime of the call to the sample() function. This difference will include queueing time, network latency, data transfer time, etc.
Please sign in to leave a comment.