iitis / PyQBench

Apache License 2.0
4 stars 3 forks source link

Resolve fails when some jobs have failed #39

Open lpawela opened 1 year ago

lpawela commented 1 year ago

When some of the jobs in an experiment have failed, the entire resolve fails. Here is an example

02:36:04  |pyqbench|lpawela@fury PyQBench ±|lp/ibmq-experiments ✗|→ qbench disc-fourier resolve ibmq-experiments/test_batch_washington.yml ibmq-experiments/results/test_batch_washington.yml
INFO | 2022-10-12 02:36:07,790 | qbench | Enabling account and creating backend
INFO | 2022-10-12 02:36:15,943 | qbench | Reading jobs ids from the input file
INFO | 2022-10-12 02:36:15,943 | qbench | Fetching total of 22 jobs
Traceback (most recent call last):
  File "/home/lpawela/anaconda3/envs/pyqbench/bin/qbench", line 8, in <module>
    sys.exit(main())
  File "/home/lpawela/new-zksi-repo/PyQBench/qbench/cli.py", line 20, in main
    args.func(args)
  File "/home/lpawela/new-zksi-repo/PyQBench/qbench/fourier/_cli.py", line 26, in _resolve
    resolved = resolve_results(results)
  File "/home/lpawela/new-zksi-repo/PyQBench/qbench/fourier/_experiment.py", line 249, in resolve_results
    result_pairs = [
  File "/home/lpawela/new-zksi-repo/PyQBench/qbench/fourier/_experiment.py", line 253, in <listcomp>
    entry.keys, jobs_mapping[entry.job_id].result().get_counts()  # type: ignore
  File "/home/lpawela/anaconda3/envs/pyqbench/lib/python3.10/site-packages/qiskit/providers/ibmq/job/ibmqjob.py", line 290, in result
    raise IBMQJobFailureError(
qiskit.providers.ibmq.job.exceptions.IBMQJobFailureError: 'Unable to retrieve result for job 63347e3bfcf0f35ca5eae594. Job has failed: Internal Error. Error code: 9443.'

Can we skip the failed jobs and only resolve succesful ones? We can have "gaps" in the data, that is fine. We should just have a way to mark the parts that have failed.

lpawela commented 1 year ago

After merging master into lp/experiments I get the following error

11:25:50  |base|lpawela@strange PyQBench ±|lp/ibmq-experiments|→ qbench disc-fourier resolve
cd -- qbench disc-fourier resolve
bash: cd: too many arguments
lpawela commented 1 year ago

After installing in a clean conda environment the problem in comment https://github.com/iitis/PyQBench/issues/39#issuecomment-1277308342 has vanished. I still get the original error.

plewandowska777 commented 1 year ago

Try with my branch pl/fix-resolve-error.

lpawela commented 1 year ago

Now it looks like an infinite download loop

01:12:16  |pyqbench|lpawela@strange PyQBench ±|lp/ibmq-experiments ✗|→ qbench disc-fourier resolve ibmq-experiments/test_batch_washington.yml ibmq-experiments/results/test_batch_washington.yml
INFO | 2022-10-13 13:12:23,746 | qbench | Enabling account and creating backend
INFO | 2022-10-13 13:12:29,369 | qbench | Reading jobs ids from the input file
INFO | 2022-10-13 13:12:29,370 | qbench | Fetching total of 22 jobs
WARNING | 2022-10-13 13:12:33,156 | qbench | IBMQJobFailureError for job 63347e3bfcf0f35ca5eae594
WARNING | 2022-10-13 13:12:34,804 | qbench | IBMQJobFailureError for job 63347e3bfcf0f35ca5eae594
WARNING | 2022-10-13 13:12:36,624 | qbench | IBMQJobFailureError for job 63347e3bfcf0f35ca5eae594
WARNING | 2022-10-13 13:12:38,597 | qbench | IBMQJobFailureError for job 63347e3bfcf0f35ca5eae594
WARNING | 2022-10-13 13:12:40,212 | qbench | IBMQJobFailureError for job 63347e3bfcf0f35ca5eae594
WARNING | 2022-10-13 13:12:41,450 | qbench | IBMQJobFailureError for job 63347e3bfcf0f35ca5eae594
WARNING | 2022-10-13 13:12:43,126 | qbench | IBMQJobFailureError for job 63347e3bfcf0f35ca5eae594
WARNING | 2022-10-13 13:12:44,812 | qbench | IBMQJobFailureError for job 63347e3bfcf0f35ca5eae594
WARNING | 2022-10-13 13:12:46,658 | qbench | IBMQJobFailureError for job 63347e3bfcf0f35ca5eae594
WARNING | 2022-10-13 13:12:48,304 | qbench | IBMQJobFailureError for job 63347e3bfcf0f35ca5eae594

This continues indefinitely with the same job id.