Travis-S-IBM / q-kernel-ops

A repository for the QAMP Spring 2022 project
Apache License 2.0
3 stars 2 forks source link

Runtime exception and telemetry #26

Closed mickahell closed 2 years ago

mickahell commented 2 years ago

Resume

Catching the exception when Runtime return, the payload is too large. And then writing the telemetry about it.


Actions url : https://github.com/Travis-S-IBM/q-kernel-ops/runs/6062172004?check_suite_focus=true Actions logs :

  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/qiskit_ibm_runtime/qiskit_runtime_service.py", line 901, in run
    raise IBMRuntimeError(f"Failed to run program: {ex}") from None
qiskit_ibm_runtime.exceptions.IBMRuntimeError: "Failed to run program: '413 Client Error: Payload Too Large for url: https://runtime-us-east.quantum-computing.ibm.com/jobs. <html>\\r\\n<head><title>413 Request Entity Too Large</title></head>\\r\\n<body>\\r\\n<center><h1>413 Request Entity Too Large</h1></center>\\r\\n<hr><center>nginx</center>\\r\\n</body>\\r\\n</html>\\r\\n'"
cfilleke commented 2 years ago

I wonder if this would be as much of an issue if (a) there were local data volumes set up on the runtime host and (b) if the host had faster processing.

In other words, is it the volume of the data itself that's the problem, or is it the amount of time required to get it there? It seems like the former from the text of the error message, but is this a somewhat artificial limit set by the process handling the URL or is this data volume rejected closer to quantum process?

How would we measure the outgoing data size, and where are the data limits documented? Also, can the data be compressed before going out -- i.e. using 16-bit FP numbers rather than 32 or 64 *? What data format is expected on either end and how are those specified?

These would probably be useful facts to catalog in any operationalization study anyway.

mickahell commented 2 years ago

You can have local data volumes on the runtime machine :open_mouth: ? The former of the text message looks to be the qiskit-ibm-runtime lib itself.

For mesuring the datasize, I’m actually using the basic python function getsizeof() . The runtime is waiting a list of circuits.

cfilleke commented 2 years ago

I don't think you can have local data volumes on the runtime host by policy and practice but there's nothing stopping the sysadmin on the runtime host from setting those up & providing access to it. Not that I would expect that, but even some temporary local storage would help in cases like this.

Also, thinking if we can cut the size of each FP # by a quarter, we could quadruple the size of the circuit we'd send through. Or not -- not if the object that is created when you make a parameterized circuit has pre-determined types, for example.

mickahell commented 2 years ago

Hmm I think, I see what you mean. We have to find out any doc to be sure the format expected in input of the Runtime service. Because a circuit seems to be just a python dict and nothing more fancy. Also a simple python circuit seems to have a size of 88 bytes (check the telemetry files) : https://github.com/Travis-S-IBM/q-kernel-ops/blob/master/studies/runtime_study.ipynb