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

Analyze and improve performance of Qiskit Machine Learning #14

Open
adekusar-drl opened this issue Aug 13, 2021 · 4 comments
Open

Analyze and improve performance of Qiskit Machine Learning #14

adekusar-drl opened this issue Aug 13, 2021 · 4 comments

Comments

@adekusar-drl
Copy link

adekusar-drl commented Aug 13, 2021

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.

@HuangJunye HuangJunye added the status: matched The project is matched and will not take any more mentees label Sep 9, 2021
@HuangJunye HuangJunye removed the status: matched The project is matched and will not take any more mentees label Oct 6, 2021
@HuangJunye
Copy link
Collaborator

@cnktysz Can you please upload your presentation here by the end of today? Thank you!

@cnktysz
Copy link

cnktysz commented Oct 6, 2021

Checkpoint 1 presentation: #14 Analyze and improve performance of Qiskit Machine Learning.pdf

@cnktysz
Copy link

cnktysz commented Nov 11, 2021

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

@cnktysz
Copy link

cnktysz commented Dec 8, 2021

Final Presentation

#14 Analyze and improve performance of Qiskit Machine Learning.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants