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

Fix QPU failover - signal solver failover condition (on resolve) #465

Merged
merged 11 commits into from
Oct 5, 2022

Conversation

randomir
Copy link
Member

@randomir randomir commented Sep 30, 2022

Change in DWaveSampler/DWaveCliqueSampler behavior: when failover=True is specified on construction, solver failover is only signalled, and the actual failover is left as an exercise for the developer. 😆

The "dirty" bit we solve here is SAPI/solver exception unification:

  • if we think sampling call is worth retrying on the same solver, we'll raise RetryCondition on sampleset resolve; and
  • if we think sampling should be retried on a different solver, we'll raise FailoverCondition on sampleset resolve.

Note that RetryCondition is a specialization of FailoverCondition, so catching FailoverCondition and doing sampler.trigger_failover() should handle all failover cases.

@codecov-commenter
Copy link

codecov-commenter commented Sep 30, 2022

Codecov Report

Merging #465 (3f75aad) into master (6a27508) will decrease coverage by 4.77%.
The diff coverage is 92.85%.

@@            Coverage Diff             @@
##           master     #465      +/-   ##
==========================================
- Coverage   91.13%   86.36%   -4.78%     
==========================================
  Files          23       23              
  Lines        1546     1540       -6     
==========================================
- Hits         1409     1330      -79     
- Misses        137      210      +73     
Impacted Files Coverage Δ
dwave/system/samplers/dwave_sampler.py 82.03% <91.66%> (-4.02%) ⬇️
dwave/system/exceptions.py 100.00% <100.00%> (ø)
dwave/system/samplers/clique.py 73.85% <100.00%> (-13.97%) ⬇️
dwave/system/coupling_groups.py 12.50% <0.00%> (-81.25%) ⬇️
dwave/system/samplers/leap_hybrid_sampler.py 61.42% <0.00%> (-14.29%) ⬇️
dwave/system/composites/embedding.py 96.57% <0.00%> (-1.15%) ⬇️
dwave/system/testing.py 95.12% <0.00%> (-0.82%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@arcondello arcondello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@randomir randomir changed the title Implement a new way of solver failover handling Fix QPU failover -- only signal solver failover condition (on resolve) Oct 4, 2022
@randomir randomir changed the title Fix QPU failover -- only signal solver failover condition (on resolve) Fix QPU failover - signal solver failover condition (on resolve) Oct 4, 2022
@randomir randomir requested a review from JoelPasvolsky October 4, 2022 20:06
dwave/system/exceptions.py Outdated Show resolved Hide resolved
dwave/system/samplers/clique.py Outdated Show resolved Hide resolved
dwave/system/samplers/clique.py Outdated Show resolved Hide resolved
dwave/system/samplers/clique.py Outdated Show resolved Hide resolved
dwave/system/samplers/dwave_sampler.py Outdated Show resolved Hide resolved
`dwave.cloud.Solver.is_software` was renamed in `dwave-cloud-client<0.8`.
Copy link
Member

@arcondello arcondello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@randomir randomir merged commit df7c347 into dwavesystems:master Oct 5, 2022
@randomir randomir deleted the fix-failover branch October 5, 2022 17:50
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

Successfully merging this pull request may close these issues.

4 participants