Analyze and improve performance of Qiskit Machine Learning
Opened this issue · 4 comments
Description
This activity closely related to #13 and may be considered together depending on the number of participants. Current QML algorithms may take significant time to run and they definitely require improvements in terms of execution time. For instance, a simple classification example taken from the readme page: https://github.com/qiskit/qiskit-machine-learning may run up to 1.5 minutes. May be this fine, may be not. The goal of this project is to profile common algorithms, find the bottlenecks and potentially improve overall performance.
The project will roughly consist of:
- Pick a use case or a few of them that run slow.
- Look through the code and understand what it does
- Profile the use cases, find potential bottlenecks
- File the problems found
- Optionally fix performance problems by contributing PRs to the QML repo.
Mentor/s
Anton Dekusar, @adekusar-drl
Research Software Engineer / Qiskit Machine Learning contributor
Ability to mentor depends on #13.
Type of participant
Requirements:
- Excellent software engineering skills, understanding how performance issues can be analyzed and fixed.
- Willingness to look through third party code.
- Proficiency in Python.
- Interested in Qiskit Machine Learning and quantum computing in general.
Number of participants
1-2
Deliverable
A list of identified bottlenecks and optionally a few PRs that fix them.
@cnktysz Can you please upload your presentation here by the end of today? Thank you!
Checkpoint 1 presentation: #14 Analyze and improve performance of Qiskit Machine Learning.pdf
Checkpoint 2 Update
The goal of this project is to profile common algorithms in qiskit machine learning, find the bottlenecks and potentially improve overall performance. Since, the first checkpoint one PR (#247) has been made and merged to the main qiskit machine learning repository. The issue was first observed in the profiler output of a QSVM training task. A test with the IRIS dataset is performed for 10 data samples from 2 classes were used to train the QSVC algorithm. The algorithm was taking 55.0 seconds to be completed. When we analyzed the profiler output, which shows details of function run times and number of calls, we noticed that the transpiler was being called more than it should. Then, the source of the issue is located in the quantum_kernel.py
script. Circuits were being transpiled in quantum_kernel.py
but the necessary had_transpiled=True
flag was not being passed when the circuits were to be executed. This makes the transpilation operation re-run many times and as a result slows down the QSVC algorithm. With the proposed change the same script now takes 5.56 takes to be completed. Investigations continue to find potential improvements.
#14 Analyze and improve performance of Qiskit Machine Learning.pdf
Final Presentation
#14 Analyze and improve performance of Qiskit Machine Learning.pdf