Skip to content
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

Reduce tests duration #1142

Closed
MatteoRobbiati opened this issue Dec 20, 2023 · 1 comment · Fixed by #1145 or #1148
Closed

Reduce tests duration #1142

MatteoRobbiati opened this issue Dec 20, 2023 · 1 comment · Fixed by #1145 or #1148
Milestone

Comments

@MatteoRobbiati
Copy link
Contributor

Many of the tests we have in Qibo take long times.
It should be useful to reduce them to minimal working examples (e.g. less qubits or less iterations in the variational examples).

@scarrazza
Copy link
Member

scarrazza commented Dec 20, 2023

In #1144 I have reduced the execution time of some tests, e.g. VQE/TSP, however it looks like the quantum info package is consuming a non negligible amount of time.

@renatomello could you please check if you can reduce some of the timings below?

========================================================= slowest 60 durations =========================================================
201.72s call     tests/test_quantum_info_metrics.py::test_frame_potential[tensorflow-4-2-100]
116.36s call     tests/test_quantum_info_metrics.py::test_frame_potential[tensorflow-3-2-100]
55.30s call     tests/test_quantum_info_metrics.py::test_frame_potential[tensorflow-2-2-100]
27.56s call     tests/test_quantum_info_random.py::test_uniform_sampling_U3[tensorflow-seed2]
27.55s call     tests/test_quantum_info_random.py::test_uniform_sampling_U3[tensorflow-None]
27.52s call     tests/test_noise.py::test_noisy_circuit[tensorflow-True-20000]
27.51s call     tests/test_quantum_info_metrics.py::test_frame_potential[qibojit-numba-4-2-100]
27.02s call     tests/test_quantum_info_metrics.py::test_frame_potential[numpy-4-2-100]
26.53s call     tests/test_quantum_info_random.py::test_uniform_sampling_U3[tensorflow-10]
26.45s call     tests/test_noise.py::test_noisy_circuit[tensorflow-False-20000]
18.14s call     tests/test_quantum_info_utils.py::test_haar_integral[tensorflow-3-3]
14.36s call     tests/test_quantum_info_metrics.py::test_frame_potential[numpy-3-2-100]
14.28s call     tests/test_quantum_info_metrics.py::test_frame_potential[qibojit-numba-3-2-100]
13.18s call     tests/test_models_tsp.py::test_tsp[tensorflow-8]
12.41s call     tests/test_models_qcnn.py::test_qcnn_training
11.58s call     tests/test_models_error_mitigation.py::test_vncdr[tensorflow-True-3-noise2-CNOT-readout2]
11.33s call     tests/test_models_error_mitigation.py::test_vncdr[tensorflow-False-3-noise2-CNOT-readout2]
10.47s call     tests/test_models_tsp.py::test_tsp[qibojit-numba-8]
9.56s call     tests/test_quantum_info_utils.py::test_haar_integral[qibojit-numba-3-3]
9.40s call     tests/test_quantum_info_utils.py::test_haar_integral[numpy-3-3]
9.16s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[tensorflow-16-seed2]
9.10s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[tensorflow-16-10]
9.01s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[tensorflow-16-None]
8.48s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[numpy-16-seed2]
8.41s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[numpy-16-10]
8.28s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[numpy-16-None]
7.92s call     tests/test_models_tsp.py::test_tsp[qibojit-numba-6]
7.51s call     tests/test_models_tsp.py::test_tsp[tensorflow-6]
7.47s call     tests/test_noise.py::test_noisy_circuit[qibojit-numba-True-20000]
7.32s call     tests/test_noise.py::test_noisy_circuit[qibojit-numba-False-20000]
7.21s call     tests/test_models_qgan.py::test_default_qgan
6.48s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[qibojit-numba-16-seed2]
6.44s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[qibojit-numba-16-10]
6.38s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[qibojit-numba-16-None]
6.23s call     tests/test_quantum_info_metrics.py::test_frame_potential[numpy-2-2-100]
6.15s call     tests/test_quantum_info_metrics.py::test_frame_potential[qibojit-numba-2-2-100]
5.97s call     tests/test_models_circuit_noise.py::test_probabilities_repeated_execution[qibojit-numba-6]
4.81s call     tests/test_models_tsp.py::test_tsp[numpy-8]
4.78s call     tests/test_noise.py::test_noisy_circuit[numpy-False-20000]
4.72s call     tests/test_models_circuit_fuse.py::test_fusion_with_measurements[tensorflow-3]
4.69s call     tests/test_models_circuit_fuse.py::test_fusion_with_measurements[tensorflow-2]
4.68s call     tests/test_models_circuit_fuse.py::test_fusion_with_measurements[tensorflow-1]
4.52s call     tests/test_noise.py::test_noisy_circuit[numpy-True-20000]
4.21s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[tensorflow-8-None]
4.17s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[tensorflow-8-seed2]
4.14s call     tests/test_models_tsp.py::test_tsp[tensorflow-4]
4.12s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[tensorflow-8-10]
3.99s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[qibojit-numba-8-None]
3.91s call     tests/test_models_qgan.py::test_custom_qgan
3.91s call     tests/test_models_tsp.py::test_tsp[qibojit-numba-4]
3.84s call     tests/test_models_circuit_noise.py::test_probabilities_repeated_execution[tensorflow-6]
3.83s call     tests/test_models_variational.py::test_vqe[tensorflow-Powell-options0-True-vqe_powell.out]
3.76s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[qibojit-numba-8-seed2]
3.66s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[qibojit-numba-8-10]
3.66s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[numpy-8-None]
3.63s call     tests/test_models_error_mitigation.py::test_vncdr[tensorflow-True-3-noise1-CNOT-readout1]
3.62s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[numpy-8-10]
3.61s call     tests/test_models_encodings.py::test_unary_encoder_random_gaussian[numpy-8-seed2]
3.52s call     tests/test_models_error_mitigation.py::test_vncdr[qibojit-numba-False-3-noise2-CNOT-readout2]
3.50s call     tests/test_models_error_mitigation.py::test_vncdr[tensorflow-False-3-noise1-CNOT-readout1]

@renatomello renatomello linked a pull request Dec 21, 2023 that will close this issue
4 tasks
@renatomello renatomello added this to the Qibo 0.2.4 milestone Dec 21, 2023
@scarrazza scarrazza reopened this Dec 21, 2023
@scarrazza scarrazza linked a pull request Dec 21, 2023 that will close this issue
4 tasks
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 a pull request may close this issue.

3 participants