Skip to content

Conversation

nonhermitian
Copy link
Contributor

Checks local hardware information, and determines if a given number of qubits can be simulated locally.

Description

Motivation and Context

Want to prevent users from running simulations that they cannot actually handle.

How Has This Been Tested?

Tested on OSX and Windows. Original code comes from QuTiP.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • [X ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [ X] My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Checks local hardware information, and determines if a given number of qubits can be simulated locally.
@nonhermitian nonhermitian changed the title Determine if a given number of qubits can be run locally [WIP] Determine if a given number of qubits can be run locally Apr 3, 2018
@nonhermitian
Copy link
Contributor Author

Currently this is just the code that does the check, but is not integrated.

@atilag
Copy link
Member

atilag commented Apr 13, 2018

Great!
I was wondering if it's more realistic to take into account actual available memory (MemAvailable) instead of all physical memory, this way we can void intense swapping or being killed by the Out Of Memory killer... I guess that at the end the difference will be 1 qubit.
screenshot from 2018-04-13 10-07-18

@atilag atilag self-requested a review April 13, 2018 08:28
@atilag
Copy link
Member

atilag commented Apr 13, 2018

@nonhermitian is the intention of this PR to integrate it within QISKit? or just the tool and have an integration later, in another PR.

@diego-plan9
Copy link
Member

Actually, can we explore already existing options for retrieving system information before going with a custom implementation? There seem to be a number of popular ones that might be suited for our purposes (psutil, for example), and would most likely provide a more robust implementation (plus avoiding the burden of having to maintain platform-specific code ourselves).

On an unrelated note - pinging @ajavadia to make sure the licensing for the current file in the PR is fine (I wouldn't expect it to be an issue, but just in case)!

@atilag
Copy link
Member

atilag commented Apr 13, 2018

This is new BSD license (clause 3), which is compatible with our Apache 2.

@nonhermitian
Copy link
Contributor Author

It is waiting for other things to be finished, and then likely added to the validation part of the local simulators.

The code itself is from QuTiP, and has been used for a number of years now without many issues.

And indeed, you could drop the qubit count by one, but at least at the moment, I think that is probably unnecessary as the reported total memory is always just below a cutoff. In your case, 31.3 Gb rather than 32.

@jaygambetta
Copy link
Member

@atilag the intention is to make the local simulators check the size they can run rather than just have it hardcore to 30. This way if the user puts it on a bigger computer it can work.

Copy link
Member

@jaygambetta jaygambetta left a comment

Choose a reason for hiding this comment

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

can we add this to the backends for the local simulators as well.

@nonhermitian
Copy link
Contributor Author

The backends are now in aer, so this should be done there.

@jaygambetta
Copy link
Member

i agree

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