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

Remove pformat from stochastic swap log messages #3812

Merged
merged 1 commit into from
Feb 11, 2020

Conversation

mtreinish
Copy link
Member

@mtreinish mtreinish commented Feb 11, 2020

Summary

When profiling a level 0 transpile of a 20x50 random circuit the timing
data shows that after switching to retworkx the largest chunk of time in
in stochastic swap's _layer_permutation function is spent calling pformat
for log messages. This is just for debugging and is unnecessary, and in a
world where we're no longer bottle-necked on dag operations a significant
cost to the run time.

Details and comments

When profiling a level 0 transpile of a 20x50 random circuit the timing
data shows that after switching to retworkx the largest chunk of time in
in stochastic swap's _layer_permutation function is spent calling pformat
for log messages. This is just for debugging and is unecessary, and in a
world where we're no longer bottlenecked on dag operations a signifcant
cost to the run time.
@mtreinish
Copy link
Member Author

Here is the profiling data I was looking at:

Screenshot_2020-02-11_10-26-43

You can see pformat as the largest chunk on the left side column

@mtreinish
Copy link
Member Author

This is only really needed after #3810 Without that pr this is still a good fix but really a micro optimization because the dag operations using networkx are significantly slower than anything in stochastic swap.

@kdk kdk merged commit ed8f8f8 into Qiskit:master Feb 11, 2020
@mtreinish mtreinish deleted the remove-pformat-stochastic-swap branch February 11, 2020 16:17
@mtreinish
Copy link
Member Author

Just circling back for completeness now that's this merged running another profile graph with #3810 applied with this merged shows:

Screenshot_2020-02-14_08-39-43

We can't see the formatting in the string anymore and also stochastic swap's layer permutation no longer is the slowest function:

Screenshot_2020-02-14_08-44-00

faisaldebouni pushed a commit to faisaldebouni/qiskit-terra that referenced this pull request Aug 5, 2020
When profiling a level 0 transpile of a 20x50 random circuit the timing
data shows that after switching to retworkx the largest chunk of time in
in stochastic swap's _layer_permutation function is spent calling pformat
for log messages. This is just for debugging and is unecessary, and in a
world where we're no longer bottlenecked on dag operations a signifcant
cost to the run time.
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 this pull request may close these issues.

3 participants