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

Log time for execute steps #3922

Merged
merged 23 commits into from
Apr 7, 2020
Merged

Log time for execute steps #3922

merged 23 commits into from
Apr 7, 2020

Conversation

javabster
Copy link
Contributor

Summary

This PR fixes issue #3805

I've added logging for Total Transpile Time, Total Schedule Time, Total Assembly Time and backend job submission. Am happy to add more if there are further suggestions. Have added tests where possible, although sometimes was unsure of which file was the best place to put the tests (I'm still relatively new to Qiskit contributions).

Details and comments

@ajavadia ajavadia changed the title Fix issue #3805 Log time for execute steps Mar 13, 2020
Copy link
Member

@kdk kdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @javabster , sorry for the slow review. This looks good so far. Few comments below.

qiskit/compiler/assemble.py Show resolved Hide resolved
qiskit/execute.py Outdated Show resolved Hide resolved
qiskit/execute.py Outdated Show resolved Hide resolved
test/python/basicaer/test_qasm_simulator.py Show resolved Hide resolved
test/python/basicaer/test_qasm_simulator.py Outdated Show resolved Hide resolved
javabster and others added 9 commits April 2, 2020 18:58
@javabster javabster requested a review from kdk April 6, 2020 17:10
kdk
kdk previously approved these changes Apr 6, 2020
Copy link
Member

@kdk kdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good to go, thanks for the addressing the comments!

mtreinish
mtreinish previously approved these changes Apr 6, 2020
Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, thanks for doing this. It's good to get more log messages being emitted to help in debugging. My only nit would be the unit choice of milliseconds especially for transpile() since I'm used to working on the order of seconds or minutes for the things I'm normally doing. That being said I have a couple of small suggestions in the tests, but nothing worth blocking over and something easy enough to fix in a follow up PR.

test/python/compiler/test_transpiler.py Outdated Show resolved Hide resolved
@@ -696,6 +699,37 @@ def test_measure_doesnt_unroll_ms(self, optimization_level):
self.assertEqual(qc, out)


class StreamHandlerRaiseException(StreamHandler):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this class is only 3 lines I feel like we should move it some where common to avoid having a copy in every place we're asserting log output.

test/python/compiler/test_assembler.py Outdated Show resolved Hide resolved
test/python/basicaer/test_qasm_simulator.py Outdated Show resolved Hide resolved
Co-Authored-By: Matthew Treinish <mtreinish@kortar.org>
@javabster javabster dismissed stale reviews from mtreinish and kdk via 397548b April 6, 2020 20:14
javabster and others added 2 commits April 6, 2020 21:14
Co-Authored-By: Matthew Treinish <mtreinish@kortar.org>
Co-Authored-By: Matthew Treinish <mtreinish@kortar.org>
@kdk kdk merged commit 9d7c711 into Qiskit:master Apr 7, 2020
@kdk kdk added the Changelog: New Feature Include in the "Added" section of the changelog label Apr 9, 2020
faisaldebouni pushed a commit to faisaldebouni/qiskit-terra that referenced this pull request Aug 5, 2020
* Added logging for total transpile time

* Added logging for total assembly time

* Added total schedule time logging

* Added total schedule time logging

* Added logging for job submission and fixed linting errors

* Fixed linting errors

* Update qiskit/compiler/assemble.py

time.time returns a time in seconds.

Co-Authored-By: Kevin Krsulich <kevin@krsulich.net>

* Update qiskit/execute.py

Change LOG to logger for consistency

Co-Authored-By: Kevin Krsulich <kevin@krsulich.net>

* Update test/python/basicaer/test_qasm_simulator.py

log_output better than output

Co-Authored-By: Kevin Krsulich <kevin@krsulich.net>

* Made updates to job submission based on PR comments

* Fixed styling error

* Fixed test error

* Revert "Update qiskit/compiler/assemble.py
"

This reverts commit 86219c7.

* Update test/python/compiler/test_transpiler.py

Co-Authored-By: Matthew Treinish <mtreinish@kortar.org>

* Update test/python/compiler/test_assembler.py

Co-Authored-By: Matthew Treinish <mtreinish@kortar.org>

* Update test/python/basicaer/test_qasm_simulator.py

Co-Authored-By: Matthew Treinish <mtreinish@kortar.org>

Co-authored-by: Kevin Krsulich <kevin@krsulich.net>
Co-authored-by: Kevin Krsulich <kevin.krsulich@ibm.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants