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

Performance regression? #23

Closed
mcfarljm opened this issue Oct 11, 2021 · 4 comments
Closed

Performance regression? #23

mcfarljm opened this issue Oct 11, 2021 · 4 comments

Comments

@mcfarljm
Copy link

I'm seeing a performance regression in steepest descent in Ocean 4.1 vs Ocean 3.5. With Ocean 3.5, the sample code runs in about 2.4s, whereas with Ocean 4.1 it runs in about 3.9s. Is this expected? From what I can tell, they're both using the same version of greedy, so it seems surprising.

from time import perf_counter

import dimod
import greedy

bqm = dimod.generators.anti_crossing_clique(150)
sampler = greedy.SteepestDescentSolver()

def solve(bqm, sampler):
    results = sampler.sample(bqm, num_reads=50000)
    return results.first

tic = perf_counter()
first = solve(bqm, sampler)
toc = perf_counter()

print(toc-tic)

(Use of anti_crossing_clique as the test BQM is not significant, I just wanted something deterministic. I also saw similar differences with randomly generated BQM's.)

@randomir
Copy link
Member

I've hunt this down to slow energy calculation on the new default BQM (in dimod 0.10/Ocean 4).

See dwavesystems/dimod#1025.

The irony is the energies are calculated during initial states generation (in dimod.Initialized.parse_initial_states, i.e. SampleSet.from_samples_bqm), for randomly generated states, only to be discarded by the sampler :-/

@arcondello
Copy link
Member

In the long run we'll want to make having an energy data vector in sample sets optional. But for right now this is one of those prices of abstraction.

@randomir
Copy link
Member

Absolutely. We've being toying with this idea for a while now, but with CQM out, we might want to prioritize it.

@mcfarljm
Copy link
Author

Appears that this has been resolved in Ocean 5.0.

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

No branches or pull requests

3 participants