-
Notifications
You must be signed in to change notification settings - Fork 163
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
Remove backend cache from QiskitRuntimeService #1732
Conversation
b7c0699
to
f0cf50f
Compare
Pull Request Test Coverage Report for Build 9412509945Details
💛 - Coveralls |
I think there is value in caching the backend data, so we don't need to call the server again to retrieve the same exactly data just to build a target that with different basis gates. Having said that, the existing caching code is just too complicated, and this PR is a good opportunity to clean it up. A follow up improvement can be a "backend cache" that only stores server data (backend config etc), and |
Pull Request Test Coverage Report for Build 9443084694Details
💛 - Coveralls |
Done in deb6cb6. Cache code is now very simple. Edit: Some numbers from benchmark. On my laptop
Of course it depends on internet bandwidth, but seems like this simple cache is sufficient. |
Pull Request Test Coverage Report for Build 9445194300Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Actually, one more comment - Both |
I think this behavior should be okey because instance-wise these information are cached. Maybe I should write upgrade note. |
2f5a7eb
to
4015075
Compare
Pull Request Test Coverage Report for Build 9459880776Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9465140454Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Summary
In #1715 we implemented new pattern to retrieve backend from the service, namely, opt-int. With opt-in, the same backend can have different Target, and thus they must be different Python objects.
This PR removes backend instance cache mechanism from
QiskitRuntimeService
. Instead, cache for the configuration data is implemented in theRuntimeClient
.IBMBackend
object is created every time it is requested, but the source data is cached and the communication with the server occurs only once.Details and comments
Once after we announce the fractional gate opt-in (not limited to fractional, some future opt-ins), user may try to compare the performance of our system with and without opt-in. One may write
Note that this does NOT work as expected BUT doesn't raise any warning or error. Note that
backend_with_fg
is silently mutated at the second retrieval via the cache, and both sampler jobs run without fractional gates. One may wonder why two results look comparable.This PR will remove this complication and make internal code much simpler.