-
Notifications
You must be signed in to change notification settings - Fork 368
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
Disable jsonschema validation by default #688
Disable jsonschema validation by default #688
Conversation
Currently the aer backends are running jsonschema validation on the Qobj objects passed in via terra by default. This is unecessary overhead as terra is programatically creating these objects and they're extremely unlikely to be structurally invalid (which is all jsonschema will catch). Even, if it was this will be caught later when something goes to use it and the error message from that is more likely to be useful since the way the json schemas are constructed precludes useful error message. This commit changes the default value of this to be opt-in on the run() method to avoid this unecessary overhead.
The test failures here are unrelated. It looks like they're caused by Qiskit/qiskit#4016 which merged this morning |
I agree to disable json schema validation by default temporary, while we come up with a better validation strategy (I'm currently working on it). Anyway, after analyzing several profiling reports, the time spent validating in large simulations can be considered negligible. I can't think of any real use-case where this is a real problem, apart from competitive benchmarkings of course :) |
Just a reminder: If we decide to disable schema validation by default, we have to coordinate with our cloud simulator team so they explicitly activate validation |
This is independent of the cloud simulator. As I said in the commit message this is just for the aer provider. The cloud simulator runs in standalone mode so this won't affect it. Additionally, the qobj is validated prior to the standalone aer simulator receiving it. |
@atilag this disabling is fine as we basically validate twice anyway, once in python and again when we are parsing the JSON into C++. If we were disabling the checking of the C++ validation (which is not done via schema, but by explicitly checking instructions for things like right number of qubits and no duplicate qubits etc) we would need to coordinate with cloud team. |
No, let's only disable the Python schema validation for now. |
Currently the aer backends are running jsonschema validation on the Qobj objects passed in via terra by default. This is unecessary overhead as terra is programatically creating these objects and they're extremely unlikely to be structurally invalid (which is all jsonschema will catch). Even, if it was this will be caught later when something goes to use it and the error message from that is more likely to be useful since the way the json schemas are constructed precludes useful error message. This commit changes the default value of this to be opt-in on the run() method to avoid this unecessary overhead. Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
Currently the aer backends are running jsonschema validation on the Qobj objects passed in via terra by default. This is unecessary overhead as terra is programatically creating these objects and they're extremely unlikely to be structurally invalid (which is all jsonschema will catch). Even, if it was this will be caught later when something goes to use it and the error message from that is more likely to be useful since the way the json schemas are constructed precludes useful error message. This commit changes the default value of this to be opt-in on the run() method to avoid this unecessary overhead. Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
A lone release note file accidently got commited to qiskit/providers/aer in Qiskit#688. This commit corrects this oversight and moves the file to the proper location under releasenotes/notes.
A lone release note file accidently got commited to qiskit/providers/aer in #688. This commit corrects this oversight and moves the file to the proper location under releasenotes/notes.
A lone release note file accidently got commited to qiskit/providers/aer in Qiskit#688. This commit corrects this oversight and moves the file to the proper location under releasenotes/notes.
Summary
Currently the aer backends are running jsonschema validation on the Qobj
objects passed in via terra by default. This is unnecessary overhead as
terra is programatically creating these objects and they're extremely
unlikely to be structurally invalid (which is all jsonschema will
catch). Even, if it was this will be caught later when something goes to
use it and the error message from that is more likely to be useful since
the way the json schemas are constructed precludes useful error message.
This commit changes the default value of this to be opt-in on the run()
method to avoid this unnecessary overhead.
Details and comments