lanl-ansi / dwisc

D-Wave Ising Sample Collector (D-WISC)
Other
3 stars 2 forks source link

Tiling #12

Open zmorrell opened 2 years ago

zmorrell commented 2 years ago

I am most of the way done with the tiling implementation, but I wanted to provide a few cautions about the capabilities of tiling which seem to be inherent due to the way that tiling is called. I am putting this in an issue rather than just mentioning it in the pull request when everything is tested to be working, since I expect that it may cause some problems which are not inherent in the implementation of the code. I will outline how the tiling works compared to the method that we have been using below.

Currently when we submit a job to DWave, we use a Solver. When we call solver.sample_ising(h,J,**args), it returns an object of type Future. This future object provides a lot of nice features such as being able to use Future.wait(time), which we currently use to allow resubmission if we time out.

On the other hand, to use tiling, you have to create an EmbeddingComposite object which is a Sampler rather than a Solver (see here). When you call a Sampler, it instead returns a SamplerSet object rather than a Future object. This is because Samplers are post-processing operations implemented by DWave on Solvers Unfortunately, the SamplerSet object doesn't provide a wait function, which is what we have been using to help block/resubmit timed out jobs.

We can still break the calls into multiple smaller jobs (the current standard block size we use is 10,000), but I cannot currently find a way to set a resubmission on timeout, at least not with the built in methods from DWave. We just run the risk of running into the old issue we had with large submissions stalling.

zmorrell commented 2 years ago

Another oddity that comes up is that the Sampler calls the reads "samples", while the Solver calls the reads "solutions". In fact, the Solver used to call the results "samples", but that has become deprecated apparently. A possible solution is to use the Future.sampleset rather than the Future.result(), to keep the postprocessing the same for the purposes of DWISC. This could lead to some issues, since the Future.result() method is blocking while the Future.sampleset property is not blocking. I think this could be easily be worked around by checking if (not args.tiling) and (problem.done()): answer = problem.sampleset, but I am not sure and do not currently plan to implement this since it would possbily change the existing implementation and lead to bugs. I will instead implement a new samples_to_solution method which will allow us to implement the other fix later if needed

zmorrell commented 2 years ago

For some reason, DWave is changing my solver to only be Advantage4.1. I will deal with this next week. I have no idea what would cause this. I will try using the standard Ocean install instead of the fork to see if it is an issue in the standard software or in the forked software

image

image